Video Player播放视频Swift后控制器无法正常工作

时间:2015-12-04 12:13:12

标签: ios swift

我正在尝试从本地播放视频并将其放入滑块,视频正在播放,但播放按钮之一消失,视频中没有任何工作。

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

}

0 个答案:

没有答案