Loading Audio Element After Dynamically Changing the Source

前端 未结 3 701
攒了一身酷
攒了一身酷 2021-01-02 20:16

I have a couple of audio elements that appear in the body of my page. They look like this.

      
3条回答
  •  再見小時候
    2021-01-02 20:57

    load() followed by play() right away leads to trouble. Trying listening for the canplay event before attempting to play the audio as suggested in https://stackoverflow.com/a/8705478/1374208

提交回复
热议问题