Home  >  Q&A  >  body text

javascript - How does jQuery implement preloading of sound effects on mobile pages?

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?

phpcn_u1582phpcn_u15822682 days ago533

reply all(2)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-19 10:43:56

    Just use PxLoader for preloading. It’s pxloader-all.min.jsthat file.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-19 10:43:56

    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.

    reply
    0
  • Cancelreply