admin管理员组

文章数量:1402971

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 of currentTime to 0, nothing changes...that is, currentTime continues having the previous value.

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 of currentTime to 0, nothing changes...that is, currentTime continues having the previous value.

Share Improve this question asked Jun 6, 2013 at 15:55 Daniel Garcia SanchezDaniel Garcia Sanchez 2,3445 gold badges22 silver badges35 bronze badges 4
  • What platform or browser are you seeing this behavior on? I could not reproduce your issue: jsfiddle/8SPs7 – apsillers Commented Jun 6, 2013 at 16:25
  • I'm trying with chrome – Daniel Garcia Sanchez Commented Jun 7, 2013 at 6:15
  • 1 Found the problem!! It doesn't seem work well with .mp3 file, your jsfiddle contains a .ogg file...I changed it adding a mp3, and it doesn't work...jsfiddle/8SPs7/3 – Daniel Garcia Sanchez Commented Jun 7, 2013 at 6:56
  • I have an mp3 and setting it to currentTime = 0 does not do anything. Chrome or Firefox. No effect..

    本文标签: javascripthtml5 audio currentTime doesn39t workStack Overflow