我正在尝试从本地播放视频并将其放入滑块,视频正在播放,但播放按钮之一消失,视频中没有任何工作。
playVideo () {
guard let videoPath = NSBundle.mainBundle().pathForResource(files.fileImage, ofType: "mp4")
else {
print ("Error")
break
}
let player = AVPlayer(URL: NSURL(fileURLWithPath: videoPath))
let playerController = AVPlayerViewController()
playerController.player = player
playerController.view.frame = svSlider.frame
playerController.showsPlaybackControls = true
let videoPlayerView = playerController.view
videoPlayerView.frame = svSlider.frame
self.svSlider.addSubview(videoPlayerView)
fromLeft += videoPlayerView.frame.width
}