From e351418503bd4623047b7ef98a02558dcf43d9a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Fern=C3=A1ndez?= Date: Sun, 29 Dec 2024 13:04:11 +0100 Subject: [PATCH] fix(PlayerElement): wait for next tick so element is mounted before setting source (#2549) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fernando Fernández --- frontend/src/components/Playback/PlayerElement.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Playback/PlayerElement.vue b/frontend/src/components/Playback/PlayerElement.vue index ff1a08d6260..192ceb6321f 100644 --- a/frontend/src/components/Playback/PlayerElement.vue +++ b/frontend/src/components/Playback/PlayerElement.vue @@ -203,11 +203,16 @@ watch(mediaElementRef, async () => { }); watch(playbackManager.currentSourceUrl, - (newUrl) => { + async (newUrl) => { if (hls) { hls.stopLoad(); } + /** + * Ensure element is mounted before setting the source. + */ + await nextTick(); + if ( mediaElementRef.value && (!newUrl