Search code examples
javascripthtmlhtml5-audiomozillafirefox-os

fastSeek method not working in Firefox OS device Spice MIFX1


I am trying to make an app for Firefox OS where I use the fastSeek method. There is a function which play the audio from beginning as shown below.

var tapSound=new Audio("sounds/tap.wav");
function playfrombegin()
{
    tapSound.fastSeek(0);
    tapsound.play();
}

And when I press a key this function is called.

This is working just fine in all browsers and the Firefox OS simulator too. But when I install it in my device Spice MIFX1 the function is not working and the audio does not play. But when I comment the line

//tapSound.fastSeek(0);

It is working just fine. Seems like the device does not know the fastSeek method.

I need to seek the audio to the beginning as the audio may be still playing when I call the function. And when I call the function the audio must start from beginning.

Is this a bug with the device?

If yes, is there an alternate way to play the audio from beginning?


Solution

  • You can try this as well

      var tapSound=new Audio("sounds/tap.wav");
    
        function playfrombegin()
        {
            tapSound.currentTime = 0;
            tapsound.play();
        }