Custom Controls are not displaying in MobileVLCKit media player

1.5k views Asked by At

I am using MobileVLCKit in my swift project. I am using cocoapod MobileVLCKit-prod(2.7). I want to add video controls to player. This is the my code.

 override func viewDidAppear(_ animated: Bool) {
       super.viewDidAppear(animated)
       let filePath = Bundle.main.url(forResource: "bunny", withExtension: "webm")
       self.mediaPlayer.media = VLCMedia(url: filePath)
       self.mediaPlayer.drawable = self.view
       self.addVideoControls()
       self.mediaPlayer.play()    

}

func addVideoControls() {
    let videoControls = MPVolumeView(frame: CGRect(x: 0, y: 0, width: self.view.frame.maxX, height: 60.0))
    videoControls.backgroundColor = UIColor.blue
    let videoView = self.mediaPlayer.drawable as! UIView
    videoView.addSubview(videoControls)
    videoView.bringSubview(toFront: videoControls)
}

VLC team provided explore is not compiling. How to customize the video player.please understand me what is the wrong in my code.

0

There are 0 answers