HTML5 audio starts from the wrong position in Firefox

后端 未结 5 990
栀梦
栀梦 2021-01-04 12:09

I\'m trying to play an mp3 file and I want to jump to specific location in the file. In Chrome 33 on Windows, the file jumps the correct position (as compared with VLC play

5条回答
  •  無奈伤痛
    2021-01-04 12:25

    I work on SoundJS and while implementing audio sprites recently ran into similar issues. According to the spec, setting the position of html audio playhead can be inaccurate by up to 300ms. So that could explain some of the issues you are seeing.

    Interestingly, your fiddle plays correctly for me in FF 28 on win 8.1 if I just let it play through from the start.

    There are also some known issues with audio length accuracy that may also have an effect, which you can read about here.

    If you want precision, I would definitely recommend using Web Audio where possible or a library like SoundJS.

    Hope that helps.

提交回复
热议问题