在Android HTML5播放器中开始播放所需的用户手势 [英] User gesture required to start playback in Android HTML5 player
问题描述
我在Android上使用HTML5视频标签,有时Chrome浏览器说它需要明确的用户手势/点击才能开始播放:
无法在'HTMLMediaElement'上执行'play':API只能是用户手势发起的
I知道这是Android中的一个已知问题,但我不明白为什么有时它会自动播放,而在其他场合它需要用户操作!
我正在使用具有自动播放选项的视频标记。
截至2017年1月24日
<如果视频静音,HTML5视频标签可以在Android上自动播放。您需要在标记中包含静音和自动播放属性,以使其按预期工作。
以下是文章的链接:自Android版Chrome 53开始在Chrome上自动播放
I am using the HTML5 video tag on android and sometimes the chrome browser says it requires an explicit user gesture/click to start playback:
Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated by a user gesture
I know this is a known issue in Android but what I don't understand is why sometimes it plays automatically and on other occasions it requires a user action!
I am using the video tag with autoplay option.
As of January 24th, 2017
HTML5 video tags can autoplay on android if the video is muted. You would need to include the muted and autoplay attributes in the tag to make it work as intended.
Here is a link to the article: Autoplay on Chrome for Android as of version 53
这篇关于在Android HTML5播放器中开始播放所需的用户手势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!