iPhone Safariã ã¨audio/videoã¿ã°ã®autoplay, autobufferå±æ§ãå¹ããªã
Resources - Safari - Apple Developer ã®
User Control of Downloads Over Cellular Networksãã®é¨å
In Safari on iPhone OS (for all devices, including iPad), where the user may be on a cellular network and be charged per data unit, autobuffering 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() method is triggered by user action. In other words, a user-initiated Play button works, but an onLoad play event does not.
ãæºå¸¯ãå¾é課éã¨ãã®å¯è½æ§ããããããautoplayã¨autobufferã¯ç¡å¹ã«ãã¦ããã
ã¦ã¼ã¶ãæå³ãã¦åçãéå§ããã¾ã§ããã¼ã¿ã¯ãã¼ããããªããã
ããã¯ãã¦ã¼ã¶ã®ã¢ã¯ã·ã§ã³ãããªã¬ã¼ã«ãã¦åçãéå§ããã¾ã§ã¯ãJSã®play()ã¨ãload()ãæ©è½ããªãã£ã¦ãã¨ãæå³ãããã
ã¤ã¾ããã¦ã¼ã¶ã«ãã£ã¦éå§ãããplay()ã¯åä½ãããã©ãonloadã¨ãã®ã¤ãã³ãã ã¨åä½ããªãããã
ã£ã¦æãã§ããããã
ãããã«ãå®é以ä¸ã®ãããªhtmlãæ¸ãã¦ããåçãããªãã£ãã
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>html5 audio test on iPhone</title> </head> <body> <audio src="music.mp3" autoplay></audio> </body> </html>
ã§ããä¸ã®ãããªhtmlã¯åçããã¦ã¯ãããªãã¯ããªã®ã ãåçãããã
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>html5</title> <script type="text/javascript"><!-- function onload_play() { var aud = document.getElementById('aud'); aud.load(); aud.play(); } //--></script> </head> <body onload="onload_play();"> <audio id="aud" src="music.mp3"></audio> </body> </html>
ããããã°ãªã®ãã©ããã¯ããããªãã
ãããããã«ããããµã¤ã¬ã³ãã¢ã¼ããç¡è¦ãã¦åçãããã®ã§ã
é³ãé³´ããã®ã¯å¾®å¦ã
ãªããããæ¹æ³ã¯ãªãã®ãããã