From 771eaaa9969b6897e67e26896bafd351eb4ba1a5 Mon Sep 17 00:00:00 2001 From: Digital Date: Mon, 29 Apr 2024 00:43:34 -0400 Subject: [PATCH] player expand hack update --- v2/src/components/VNewPersistentPlayer.vue | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/v2/src/components/VNewPersistentPlayer.vue b/v2/src/components/VNewPersistentPlayer.vue index 0b405c2..5069de9 100644 --- a/v2/src/components/VNewPersistentPlayer.vue +++ b/v2/src/components/VNewPersistentPlayer.vue @@ -485,19 +485,15 @@ const toggleExpanded = async (e) => { // hack for the audio player to not pause when the player is appended to the expanded player and back. const delay = e ? 255 : 490 - if (isPlaying.value) { - clearTimeout(timeOutPlay) - timeOutPlay = setTimeout(() => { - $mediaPlayerRef.value?.play() - }, delay + 2) - } clearTimeout(timeOutMove) - timeOutMove = setTimeout(() => { + timeOutMove = setTimeout(async () => { if (e) { expandedPlayerLocationRef.value.appendChild($mediaPlayerRef.value) } else { defaultPlayerLocationRef.value.appendChild($mediaPlayerRef.value) } + await nextTick() + isPlaying.value ? $mediaPlayerRef.value?.play() : null }, delay) }