|
@@ -22,13 +22,14 @@ class CommunityVideoPlayView: UIView {
|
|
|
playerLayer = AVPlayerLayer.init(player: player)
|
|
|
playerLayer.videoGravity = .resizeAspectFill
|
|
|
self.layer.addSublayer(self.playerLayer)
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private var asset: AVAsset?
|
|
|
private var playerItem: AVPlayerItem?
|
|
|
private var playerLayer: AVPlayerLayer = AVPlayerLayer.init()
|
|
|
private var player: AVPlayer?
|
|
|
+// private var indicatorView: UIActivityIndicatorView?
|
|
|
|
|
|
init() {
|
|
|
super.init(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: kScreenHeight))
|
|
@@ -58,6 +59,15 @@ class CommunityVideoPlayView: UIView {
|
|
|
CATransaction.commit()
|
|
|
}
|
|
|
|
|
|
+ func play() {
|
|
|
+ player?.play()
|
|
|
+ }
|
|
|
+
|
|
|
+ // 暂停
|
|
|
+ func pause() {
|
|
|
+ player?.pause()
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
// func setupViews() {
|