javascript - How does jQuery implement preloading of sound effects on mobile pages?
phpcn_u15822017-05-19 10:41:56
0
2
563
The mobile page animation will be accompanied by sound effects. The first loading of music will cause a delay in the sound effects. How can I solve this problem?
Now all mobile terminals prohibit the automatic loading and playback of audio and video resources, requiring manual triggering of user interaction events, such as click, touchstart等事件. 对于自动播放, 这个是无解的, 当然有一些浏览器改了内核表现可以实现, 比如微信. 对于自动加载, 可以使用dataurl来实现, 比如base64编码的src.
Just use PxLoader for preloading. It’s
pxloader-all.min.js
that file.Now all mobile terminals prohibit the automatic loading and playback of audio and video resources, requiring manual triggering of user interaction events, such as
click
,touchstart
等事件.对于自动播放, 这个是无解的, 当然有一些浏览器改了内核表现可以实现, 比如微信.
对于自动加载, 可以使用dataurl来实现, 比如
base64
编码的src
.