【问题标题】:Play MKV video from remote从远程播放 MKV 视频
【发布时间】:2016-12-27 00:28:33
【问题描述】:

我正在尝试在我的 iOS 应用中播放远程 MKV 视频,但视频无法播放。

我尝试使用 AVKit/AVFoundation 和 MobilePlayer,它正在处理 MP4 文件。

这是我的代码示例:

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()
}

手机播放器

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()
}

【问题讨论】:

  • 不支持 MKV 格式。 stackoverflow.com/questions/1535836/…
  • 哦好吧..谢谢你
  • 您可以从VLCengine 嵌入您的视频播放器。因此您可以播放任何视频格式。
  • 非常感谢@MohanSingh
  • @TheAbstractDev 你找到任何可行的解决方案了吗?

标签: ios swift video-player mkv


【解决方案1】:

AVKit/AVFoundation 不支持 mkv 视频格式。您可以考虑使用其他视频框架,例如 VLCKit

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-11
    • 1970-01-01
    • 1970-01-01
    • 2020-11-15
    • 2015-03-07
    相关资源
    最近更新 更多