下载和播放离线HLS内容-iOS 10 [英] Downloading and playing offline HLS Content - iOS 10

查看:147
本文介绍了下载和播放离线HLS内容-iOS 10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从iOS 10开始,Apple提供了下载HLS(m3u8)视频以供离线查看的支持.

Since iOS 10, Apple has provided the support for downloading HLS (m3u8) video for offline viewing.

我的问题是:是否只有在播放HLS时才可以下载HLS?或者,我们只在用户按下下载按钮并显示进度时才下载.

My question is: Is it necessary that we can only download HLS when it is being played ? Or we can just download when user press download button and show progress.

有人在Objective C版本中实现了此功能吗?实际上,我以前的应用程序是在Objective C中制作的.现在,我想增加对下载HLS而不是MP4的支持(以前我是为了离线查看而下载MP4).

Does anyone has implemented this in Objective C version? Actually my previous App is made in Objective C. Now I want to add support for downloading HLS rather than MP4 (previously I was downloading MP4 for offline view).

我真的很绝望.请分享想法或任何实施的代码.

I am really desperate to this. Please share thoughts or any code if implemented.

推荐答案

唯一的方法是设置HTTP服务器,以在下载文件后在本地提供文件.

The only way you can do this is to set up an HTTP server to serve the files locally after you've downloaded them.

实时播放列表使用滑动窗口.您需要在目标持续时间之后定期重新加载它,并仅下载列表中显示的新段(稍后将其删除).

The Live playlist uses a sliding-window. You need to periodically reload it after target-duration time and download only the new segments as they appear in the list (they will be removed at a later time).

以下是一些相关的答案:IOS设备可以使用html5视频和phonegap/cordova从本地文件系统流式传输m3u8分段视频吗?

Here are some related answers: Can IOS devices stream m3u8 segmented video from the local file system using html5 video and phonegap/cordova?

这篇关于下载和播放离线HLS内容-iOS 10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆