Is there an oncomplete event for HTML5 audio?

前端 未结 2 1547
傲寒
傲寒 2020-12-05 18:35

Is there an oncomplete event for HTML5 audio? I could not find anything on this. I am trying to play a sound after it completes.

Well, specifically I am

2条回答
  •  醉酒成梦
    2020-12-05 18:51

    The correct way to to this is using the addEventListener function:

    audio.addEventListener('ended', PlayNext);
    

提交回复
热议问题