【发布时间】:2015-12-19 18:43:54
【问题描述】:
我想在我的 iOS 上的 CORDOVA 应用程序中的 html5 页面中播放一个小 mp4 视频。
可以播放本地 mp4 但我可以播放存储在远程服务器上的视频。我不知道为什么。
=> 是否有任何配置选项或元素可以添加到我的 html 页面以在 CORDOVA iOS 应用中播放远程视频?在这里查看我的代码:
cordova 中的 HTML 页面:
<!doctype html><html lang="en">
<head>
<meta charset="utf-8">
<title>TEST</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
<script src="cordova.js"></script>
</head>
<body>
<h1>TEST APP</h1>
<video width="320" height="240" controls webkit-playsinline>
<source src="http://video.tsara-autisme.com/test/010101_360p.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<img src="http://video.tsara-autisme.com/test/test.jpg" alt="test">
</body>
</html>
Config.xml 文件:
...
<access origin="*"/>
<allow-navigation href="https://api.tsara-autisme.com/*"/>
<allow-navigation href="http://video.tsara-autisme.com/*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<preference name="Fullscreen" value="true" />
<preference name="AllowInlineMediaPlayback" value="true"/>
...
感谢您的帮助。 配置:Cordova 5.1.1、Xcode 7.2、iOS Simulator 9、iPhone 上的 iOS 9
【问题讨论】: