我在 index.html 文件中嵌入了一个 youtube 视频。
<iframe id="video" width="640" height="360" src="//www.youtube.com/embed/xxxxxxxxx?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>
我通过 cmd 使用 Cordova Phonegap 创建了应用程序,如下所示:
cordova create hello com.example.hello HelloWorld
替换了 app 文件夹中的 html、css、js 文件。
添加了android平台:
cordova platform add android
打开 Eclipse,导入应用程序,然后运行它。
我将 .apk 安装到我的平板电脑上,一切正常,但视频不工作。
我收到错误“网页不可用”而不是视频。
我该如何解决这个问题?
最佳答案
您可能应该将 youtube 列入白名单。
http://cordova.apache.org/docs/en/3.6.0/guide_appdev_whitelist_index.md.html
<access origin="http://*.youtube.com" />
关于android - 带有 Phonegap 的 Android 混合应用程序上的 Iframe 视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26184895/