mirror of
https://github.com/janishutz/MusicPlayerV2.git
synced 2025-11-25 13:04:23 +00:00
fix playback pos update on song change
This commit is contained in:
@@ -407,7 +407,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let progressTracker = 0;
|
let progressTracker: ReturnType<typeof setInterval> = setInterval( () => {}, 1000 );
|
||||||
|
clearInterval( progressTracker );
|
||||||
let hasReachedEnd = false;
|
let hasReachedEnd = false;
|
||||||
let hasStarted = false;
|
let hasStarted = false;
|
||||||
const startProgressTracker = () => {
|
const startProgressTracker = () => {
|
||||||
@@ -432,6 +433,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( pos.value > 0 && !hasStarted ) {
|
if ( pos.value > 0 && !hasStarted ) {
|
||||||
|
if ( player.getPlaying() ) {
|
||||||
getDetails();
|
getDetails();
|
||||||
playingSong = player.getPlayingSong();
|
playingSong = player.getPlayingSong();
|
||||||
pos.value = player.getPlaybackPos();
|
pos.value = player.getPlaybackPos();
|
||||||
@@ -441,6 +443,7 @@
|
|||||||
notificationHandler.emit( 'playback-start-update', new Date().getTime() - pos.value * 1000 );
|
notificationHandler.emit( 'playback-start-update', new Date().getTime() - pos.value * 1000 );
|
||||||
hasStarted = true;
|
hasStarted = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const minuteCount = Math.floor( pos.value / 60 );
|
const minuteCount = Math.floor( pos.value / 60 );
|
||||||
nicePlaybackPos.value = minuteCount + ':';
|
nicePlaybackPos.value = minuteCount + ':';
|
||||||
|
|||||||
Reference in New Issue
Block a user