mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
potential fix for mpv clear (#1360)
This commit is contained in:
@@ -114,7 +114,7 @@ const createMpv = async (data: {
|
|||||||
mpv.on('status', (status) => {
|
mpv.on('status', (status) => {
|
||||||
if (status.property === 'playlist-pos') {
|
if (status.property === 'playlist-pos') {
|
||||||
if (status.value === -1) {
|
if (status.value === -1) {
|
||||||
mpv?.stop();
|
mpv?.pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status.value !== 0) {
|
if (status.value !== 0) {
|
||||||
|
|||||||
@@ -156,9 +156,11 @@ export const MpvPlayerEngine = (props: MpvPlayerEngineProps) => {
|
|||||||
mpvPlayer.setQueue(currentSrc, nextSrc, playerStatus !== PlayerStatus.PLAYING);
|
mpvPlayer.setQueue(currentSrc, nextSrc, playerStatus !== PlayerStatus.PLAYING);
|
||||||
setPreviousCurrentSrc(currentSrc);
|
setPreviousCurrentSrc(currentSrc);
|
||||||
} else {
|
} else {
|
||||||
// Clear queue if no current song
|
// Only clear queue if we had a previous currentSrc (intentional clear)
|
||||||
mpvPlayer.setQueue(undefined, undefined, true);
|
if (previousCurrentSrc !== undefined) {
|
||||||
setPreviousCurrentSrc(undefined);
|
mpvPlayer.setQueue(undefined, undefined, true);
|
||||||
|
setPreviousCurrentSrc(undefined);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If currentSrc hasn't changed but nextSrc has, update position 1
|
// If currentSrc hasn't changed but nextSrc has, update position 1
|
||||||
|
|||||||
Reference in New Issue
Block a user