ember-hifi icon indicating copy to clipboard operation
ember-hifi copied to clipboard

audio-ended fired before position update

Open Glarregle opened this issue 2 years ago • 4 comments

I've found that audio-ended event is fired but after it position property is updated again. I have to keep track of the audio playing until it totally ends (to display progress). But how can I certainly track the audio position until its end?

Here an example of logs:

handleEnded(hifi) {
    console.log('isPlaying', hifi.isPlaying);
    console.log('service', hifi);
    console.log('position', hifi.position);
    console.log('duration', hifi.duration);
}

You'll see here, I get the position in the event as 1814.147 and then it updates again to 2263.946

isPlaying false
service Class { /* expand Class preview after around 1 sec */
 ...
 _position: 2263.946
 ...
}
position 1814.147
duration 2263.946

Glarregle avatar Jun 29 '22 15:06 Glarregle

I could fix this by setting positionInterval option to 10 milliseconds.

Glarregle avatar Jul 20 '22 19:07 Glarregle

@Glarregle Unfortunately I don't think anyone is maintaining this repository anymore. I forked this last year and updated it to modern standards making it way more ergonomic and I'd highly recommend you switch to using ember-stereo instead. Interactive docs are at ember-stereo.com, and am actively supporting that.

jkeen avatar Jul 21 '22 15:07 jkeen

@jkeen Thanks, we're on [email protected]. Can you tell me what package version of ember-stereo would work w/ it?

Glarregle avatar Jul 25 '22 11:07 Glarregle

@Glarregle The latest version requires 3.27 or higher, but I think if you pin ember-stereo to ~ 3.0.4 it should work on 3.24

jkeen avatar Jul 26 '22 06:07 jkeen