javascript – 如何在iOS上自动播放HTML5和标签?

我和我的团队正在努力在iPad上制作一个Web应用程序自动播放HTML5视频/音频标签.到目前为止,经过CSS和JavaScript的多次尝试都没有运气.

The question is: What other option is there to make it autoplay ?

我正在考虑使用带有iOS API调用的集成浏览器的原生应用来模拟触摸/点击,从而使视频/音频标签自动播放.

是否可能,如果是,iOS版本如何以及使用哪个版本?

谢谢

您无法在正常模式下在iOS上自动播放视频和音频,您可以使用模拟用户输入等技巧来自动播放视频和音频.

Safari HTML5 Audio and Video Guide

In Safari on iOS (for all devices, including iPad), where the user may be on a cellular network and be charged per data unit, preload and autoplay are disabled. No data is loaded until the user initiates it. This means the JavaScript play() and load() methods are also inactive until the user initiates playback, unless the play() or load() method is triggered by user action. In other words, a user-initiated Play button works, but an onLoad=”play()” event does not.

这播放电影:< input type =“button”value =“Play”onclick =“document.myMovie.play()”>

这在iOS上没有任何作用:< body onload =“document.myMovie.play()”>

https://stackoverflow.com/questions/32945273/how-to-autoplay-html5-video-and-audio-tags-on-ios

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:javascript – 如何在iOS上自动播放HTML5和标签?