I'm trying to play a remote MKV video in my iOS app but the video won't play.
I tried with AVKit/AVFoundation and MobilePlayer and it's working with a MP4 file.
Here's a sample of my code:
AVKit / AVFoundation
let videoURL = NSURL(string: url)! // http://localhost:4000/../file.mkv
playerView = AVPlayer(URL: videoURL)
playerViewController.player = playerView
self.presentViewController(playerViewController, animated: true) {
self.playerViewController.player!.play()
}
MobilePlayer
let videoURL = NSURL(string: url)! // http://localhost:4000/../file.mkv
let playerVC = MobilePlayerViewController(contentURL: videoURL)
playerVC.title = videoURL.lastPathComponent
playerVC.activityItems = [videoURL]
self.presentViewController(playerVC, animated: true) {
playerVC.play()
}