在PhoneGap中自动播放视频 [英] Autoplay video in PhoneGap
问题描述
我已经在index.html中创建了一个最小的PhoneGap应用程序:
I have created a minimal PhoneGap app that has just this in the index.html:
<!-- ... -->
<body>
<video src="test.m4v" autoplay onerror="alert('Error')"></video>
</body>
在PhoneGap.plist中,我将MediaPlaybackRequiresUserAction设置为NO。
In the PhoneGap.plist I have set MediaPlaybackRequiresUserAction to NO.
但是,我仍然无法让视频在加载网页时自动播放。
Yet I still cannot get the video to autoplay when the page loads. I have tried different ways of scripting it but to no avail.
有没有人知道我做错了什么?
Does anybody have a clue what I'm doing wrong?
推荐答案
解决了。原来是PhoneGap 1.3中的一个错误,修复了昨天发布的版本1.4(!)。
Solved it. Turned out to be a bug in PhoneGap 1.3 which was fixed in version 1.4 released yesterday(!).
从发行说明:
固定CB-42 - MediaPlaybackRequiresUserAction现在可以设置为NO
Fixed CB-42 – MediaPlaybackRequiresUserAction can now be set to NO
这篇关于在PhoneGap中自动播放视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!