File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -89,9 +89,15 @@ export class PlaybackQueue {
8989 private onPlaybackStateChange ( playback : Playback , mxEvent : MatrixEvent , newState : PlaybackState ) : void {
9090 // Remember where the user got to in playback
9191 const wasLastPlaying = this . currentPlaybackId === mxEvent . getId ( ) ;
92- if ( newState === PlaybackState . Stopped && this . clockStates . has ( mxEvent . getId ( ) ! ) && ! wasLastPlaying ) {
93- // noinspection JSIgnoredPromiseFromCall
94- playback . skipTo ( this . clockStates . get ( mxEvent . getId ( ) ! ) ! ) ;
92+ const currentClockState = this . clockStates . get ( mxEvent . getId ( ) ! ) ;
93+ if ( newState === PlaybackState . Stopped && currentClockState !== undefined && ! wasLastPlaying ) {
94+ if ( currentClockState > 0 ) {
95+ // skipTo will pause playback, which causes the clock to render the current
96+ // playback seconds. If the clock state is 0, then we can just ignore
97+ // skipping entirely.
98+ // noinspection JSIgnoredPromiseFromCall
99+ playback . skipTo ( currentClockState ) ;
100+ }
95101 } else if ( newState === PlaybackState . Stopped ) {
96102 // Remove the now-useless clock for some space savings
97103 this . clockStates . delete ( mxEvent . getId ( ) ! ) ;
You can’t perform that action at this time.
0 commit comments