I am trying to play remote MKV video in my iOS application, but the video will not play.
I tried with AVKit / AVFoundation and MobilePlayer and worked with the MP4 file.
Here is an example of my code:
AVKit / AVFoundation
let videoURL = NSURL(string: url)!
playerView = AVPlayer(URL: videoURL)
playerViewController.player = playerView
self.presentViewController(playerViewController, animated: true) {
self.playerViewController.player!.play()
}
Mobileplayer
let videoURL = NSURL(string: url)!
let playerVC = MobilePlayerViewController(contentURL: videoURL)
playerVC.title = videoURL.lastPathComponent
playerVC.activityItems = [videoURL]
self.presentViewController(playerVC, animated: true) {
playerVC.play()
}
source
share