howler.js icon indicating copy to clipboard operation
howler.js copied to clipboard

playing method return false when sound is playing

Open hotfireeagle opened this issue 6 years ago • 6 comments

I am run the examples's player demo, when i click progress bar , it should trigger seek method, and then sound.playing return false, so the progress status has been reset to zero.

// player demo line 216
step: function() {
    var self = this;

    // Get the Howl we want to manipulate.
    var sound = self.playlist[self.index].howl;

    // Determine our current seek position.
    var seek = sound.seek() || 0;
    timer.innerHTML = self.formatTime(Math.round(seek));
    progress.style.width = (((seek / sound.duration()) * 100) || 0) + '%';

    // If the sound is still playing, continue stepping.
    console.log('playing', sound.playing());            // => return false
    if (sound.playing()) {
      requestAnimationFrame(self.step.bind(self));
    }
  }

hotfireeagle avatar May 05 '19 07:05 hotfireeagle

Hi, i have the same proble,e. Have you found a solution ?

Thx

Gizmo091 avatar Jul 05 '19 12:07 Gizmo091

I'm not sure I follow, what are you saying the issue is?

goldfire avatar Jul 05 '19 19:07 goldfire

When audio is seeked to a specific time that has not been already in browser cache, sound.playing() return false, so requestAnimationFrame doesn't loop on itself, so progress.style.width will never be updated again. Excepted if user switch manually to play => pause => play.

Gizmo091 avatar Jul 08 '19 16:07 Gizmo091

Hi, i have the same proble,e. Have you found a solution ?

ghost avatar Aug 11 '22 03:08 ghost

I check playing status before seeking audio and after seeked if playing return false if delay the requestAnimationFrame.

setTimeout(() => {
                            requestAnimationFrame(this.step.bind(this));
                        }, 50);

Gizmo091 avatar Aug 11 '22 08:08 Gizmo091

I'm very sorry for the insufficient description of this issue and the long-ignored Notifications of this issue.

For this, I have uploaded a video that reproduces the problem.

The video link is: https://www.youtube.com/watch?v=nSfMRtZSVQo

This problem is not easy to reproduce.

In the video, I frequently modify the progress, and then at about 24 seconds of the video, the progress has been stuck at 0:02 seconds. Although the sound is still playing at this time, but the progress continue been stuck at 0:02.

My browser version is chrome 104.0.5112.79 (official version) (x86_64). I reproduced this problem by using the first demo on the official website, music player.

sorry again I only completed the description today.

hotfireeagle avatar Aug 21 '22 15:08 hotfireeagle