如何在Iphone Phonegap中播放内联视频 [英] How to play Inline Video in Iphone Phonegap

查看:138
本文介绍了如何在Iphone Phonegap中播放内联视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Phonegap创建一个应用,它必须有内联视频。当我为内联视频设置代码时,它在iPad上运行良好,但它不适用于iPhone。在iPhone上,它只是自动全屏显示它。我已经尝试在config.xml文件中放入首选项窗格,但它仍然无效。这是代码:

I'm creating an app using Phonegap, and it has to have inline videos. When I put the code for inline videos, it works great on iPads, but it doesn't work on iPhones. On an iPhone, it just automatically fullscreens it. I've tried putting in a preference pane in the config.xml file, but it still doesn't work. Here's the code:

config.xml

config.xml

<preference name="AllowInlineMediaPlayback" value="true" />

index.html

index.html

<video width="95%" style="display: block; margin: auto; margin-top: 10%;border: 1px inset #bbbbbb;" autoplay="" id="video" webkit-playsinline>
        <source src="used_files/lesson2_1.mp4" type="video/mp4" id="video">
        Your browser does not support the video tag.
</video>


推荐答案

我终于弄清楚出了什么问题。由于config.xml仅在构建项目时更新,因此它确实有效,但不在测试视图中。我将它作为原生iPhone应用程序运行,它可以在iPhone应用程序中运行。

I finally figured out what was wrong. Since the config.xml only updates when you build your project, it does work, but not in the test view. I ran it as a native iPhone app, and it works in the iPhone app.

这篇关于如何在Iphone Phonegap中播放内联视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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