html5 audio currentTime doesn't work

前端 未结 2 1663
面向向阳花
面向向阳花 2020-12-21 06:19

I don\'t know why but it doesn\'t work. I have this:

function stop()
{
  audio.pause();
  audio.currentTime = 0;
}

When I change the value

2条回答
  •  心在旅途
    2020-12-21 06:43

    I solved it:

    audio.pause();
    audio.src = audio.src;
    

    It reload the audio tag, and set currentTime to 0

提交回复
热议问题