首页 > iOS 4.2.1 以后的版本Safari怎么自动播放

iOS 4.2.1 以后的版本Safari怎么自动播放

在做一个需要播放声音的页面,调用player.load()和player.play()以后,在以前的版本是可以自动播放的
但是4.2.1貌似播放不出来了,是因为Safari修改了什么东西,不允许自动播放了?


苹果官方文档 http://developer.apple.com/library/sa...

User Control of Downloads Over Cellular Networks

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.

This plays the movie: <input type="button" value="Play" onclick="document.myMovie.play()">

This does nothing on iOS: <body onload="document.myMovie.play()">
【热门文章】
【热门文章】