HTML5 影音手持裝置適應不良篇
Temperature: 0 °C
這天下午跟客戶開完會...
客戶針對專案中手持裝置網站適應性做了需調整的說明..另外還包括影音檔播放
一開始我也覺得很奇怪,在video的指令裡我已經下了autoplay了,理論上來說應該可以自動播放...@@
HTML5不是就是為了手持裝置跟PC而存在的嘛!!
不大可能手持裝置要下不同指令吧...
所以我又Google了...結果...
Apple has made the decision to disable the automatic playing of video on iOS devices, through both script and attribute implementations.
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 auto-play are disabled. No data is loaded until the user initiates it. - Apple documentation.
...不是吧...接著不死心的針對Android做Google,結果..
Autoplay on most mobile platforms (Android, iOS) gets blocked to avoid poor user experiences - video should only play following a user action. You can usually work around it by triggering the play() on another event (eg the onloaded event)
所以,手持裝置不接受自動播放是吧...ㄟ害!!
台北市松山區八德路四段650號 Go