即便利用JS ,调用audio 工具的播放方法 play() 也不能自动播放!
这是为什么呢?
于是冲破砂锅问到底的决心,做了好多种demo,例子
http://m.slicy.cn/bg-music.html
测试,苹果、安卓还是弗成,末了创造原形的我,眼泪掉下来 。 缘故原由在这:
为了防止不必要的自动播放摧残浪费蹂躏流量,手机网页访问带有audio的页面是不会自动播放的。
Safari屏蔽了autoplay,必须由用户交互事宜触发,由于autoplay在移动网络环境下可能会造成用户流量费剧增
下面是引自Safari Reference
In Safari on iPhone OS (for all devices, including iPad), where theuser 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.