Created
November 11, 2020 01:15
-
-
Save shsw228/bdc9792526e883c64b803f14e18f4260 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class playerView: UIView { | |
var player: AVPlayer? { | |
get { | |
return playerLayer.player | |
} | |
set { | |
playerLayer.player = newValue | |
} | |
} | |
var playerLayer: AVPlayerLayer{ | |
return layer as! AVPlayerLayer | |
} | |
override static var layerClass: AnyClass{ | |
return AVPlayerLayer.self | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment