audiojs icon indicating copy to clipboard operation
audiojs copied to clipboard

Problem in FIrefox (can't skip audio)

Open SilverSilencer opened this issue 9 years ago • 3 comments

There is a problem in skipping audio in Firefox (I use latest version). Audio plays normally, but I can't skip it for example to the middle or at the end, because black line is standing still and does not load to the end (I also tried in Chrome and there it works). Is there any solution for that?

SilverSilencer avatar Feb 04 '15 21:02 SilverSilencer

I'm also seeing this (in Firefox v31.0) and all works well in Chrome. Anyone found a workaround? Thanks!

craigphiz avatar May 06 '15 21:05 craigphiz

Same problem happend in several mobile browsers. The loaded bar always be 0 (I read the source code and it seems that the object audio.buffered not work well in some browsers). To skip audio, i tried this:

Find function skipTo() in audio.js, remove code: if (percent > this.loadedPercent) return;

then the skip function can work. But it's not a perfect solution.

STLighter avatar Nov 30 '15 08:11 STLighter

Here is problem in Firefox:

        loadTimer = setInterval(function() {
          audio.loadProgress.apply(audio);
          if (audio.loadedPercent >= 1) clearInterval(loadTimer);
        });

Fires only once. Here is solution:

        loadTimer = setInterval(function() {
          audio.loadProgress.apply(audio);
          if (audio.loadedPercent >= 1) clearInterval(loadTimer);
        }, 100);

Even better:

        loadTimer = setInterval(function() {
          audio.loadProgress.apply(audio);
          if (audio.loadedPercent > 0.99) clearInterval(loadTimer);
        }, 100);

because in Firefox audio.loadedPercent = 0.9999... and this function will never stop. I don't know why but never reach 1:

    var durationLoaded = this.element.buffered.end(this.element.buffered.length - 1);
    this.loadedPercent = durationLoaded / this.duration;

pe-pe80 avatar Apr 13 '17 09:04 pe-pe80