【问题标题】:How to play ts file using the cache in the AVPlayer?如何使用 AVPlayer 中的缓存播放 ts 文件?
【发布时间】:2015-06-19 05:11:13
【问题描述】:

我想在 ts 文件中缓存 HLS。 Apple 演示站点为此站点使用自定义架构。

https://developer.apple.com/library/ios/samplecode/sc1791/Introduction/Intro.html

此示例使用自定义架构。但它对 ts 文件使用重定向。 我搜索了“如何使用 AVPlayer 中的缓存播放 ts 文件”。我发现使用重定向本地代理。但是移动背景对苹果来说是禁止的。

https://developer.apple.com/library/ios/technotes/tn2277/_index.html#//apple_ref/doc/uid/DTS40010841-CH1-SUBSECTION2

是否可以在AVPlayer上启动本地缓存的ts文件?

【问题讨论】:

    标签: ios objective-c http-live-streaming


    【解决方案1】:

    据我所知,直接使用 iOS Player (AVPlayer) 播放 ts 文件是不可能的。 不过有办法玩。

    1. 下载.ts文件并保存在app文档目录中。
    2. 使用这个库Keemotion/TS2MP4 将 ts 文件转换为 mp4 可以使用 AVPlayer 播放。

    现在您可以谨慎地下载 -> 转换 -> 播放每个文件。 或者您可以下载多个 -> 将它们转换为一个大的 mp4 文件并播放。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-01
      • 1970-01-01
      相关资源
      最近更新 更多