IOS设备流从本地文件系统使用html5视频和phonegap / cordova的m3u8分段视频? [英] Can IOS devices stream m3u8 segmented video from the local file system using html5 video and phonegap/cordova?

查看:731
本文介绍了IOS设备流从本地文件系统使用html5视频和phonegap / cordova的m3u8分段视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用phonegap / cordova 2.1和我的应用程序有本地存储的资产(在设备上),需要在构建时加密,并在执行时在内存中解密。该应用程序仅适用于iPad。

I'm using phonegap/cordova 2.1 and my app has locally stored assets (on the device) which need to be encrypted on build and decrypted in memory when used in execution. The app is for iPad only.

对于我想要实现类似 http://codebycoffee.com/2012/01/08/decrypting-http-streaming-video-with-nsurlprotocol 其中mediafilesegmenter用于分段和加密每个视频文件,然后自定义加密文件网址协议为视频播放器请求m3u8文件时的每个视频的密钥。

For the videos I want to implement something similar to http://codebycoffee.com/2012/01/08/decrypting-http-streaming-video-with-nsurlprotocol where mediafilesegmenter is used to segment and encrypt each video file and then a custom encrypted file url protocol serves the key for each video when the video player requests the m3u8 file.

我的问题是我似乎不能通过使用html5视频标签和phonegap / cordova播放m3u8文件。我甚至创建了未加密的视频段,使用mediafilesegmenter作为测试。这些可以通过在OSX中打开m3u8文件与VLC,但在phonegap / cordova中使用视频标签时,我得到'加载...'消息后面是一个弹出窗口操作无法完成

My problem is that I can't seem to play m3u8 files by using the html5 video tag and phonegap/cordova. I have even created unencrypted video segments with the use of mediafilesegmenter as a test. These can be played by opening the m3u8 file with VLC in OSX but when using the video tag in phonegap/cordova I get 'loading...' message followed by a popup saying "The operation could not be completed"

推荐答案

OK,结果是m3u8文件必须通过HTTP提供,我已经走了捆绑一个cocoahttpserver的路线https://github.com/robbiehanson/CocoaHTTPServer 与应用程式。这样,我可以请求视频流:

OK so it turns out that m3u8 files have to be served over HTTP and I have gone down the route of bundling a cocoahttpserver https://github.com/robbiehanson/CocoaHTTPServer in with the app. This way I can request the video streams with:

<video src="http://127.0.0.1:12345/path.m3u8"

这篇关于IOS设备流从本地文件系统使用html5视频和phonegap / cordova的m3u8分段视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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