Fix audio player seek bar position (#31127)

* fix(audio): stop clock when the source audio reaches the end

* test(audio): add test for playback when audio source ended
This commit is contained in:
Florian Duros
2025-10-29 17:05:04 +01:00
committed by GitHub
parent a9993aef85
commit 2ab42df0c8
2 changed files with 24 additions and 3 deletions

View File

@@ -202,6 +202,7 @@ export class Playback extends EventEmitter implements IDestroyable, PlaybackInte
private onPlaybackEnd = async (): Promise<void> => {
await this.context.suspend();
this.emit(PlaybackState.Stopped);
this.clock.flagStop();
};
public async play(): Promise<void> {
@@ -248,9 +249,8 @@ export class Playback extends EventEmitter implements IDestroyable, PlaybackInte
this.emit(PlaybackState.Paused);
}
public async stop(): Promise<void> {
await this.onPlaybackEnd();
this.clock.flagStop();
public stop(): Promise<void> {
return this.onPlaybackEnd();
}
public async toggle(): Promise<void> {