Skip to content

Commit e351418

Browse files
authored
fix(PlayerElement): wait for next tick so element is mounted before setting source (#2549)
Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
1 parent ad81868 commit e351418

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

frontend/src/components/Playback/PlayerElement.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,16 @@ watch(mediaElementRef, async () => {
203203
});
204204
205205
watch(playbackManager.currentSourceUrl,
206-
(newUrl) => {
206+
async (newUrl) => {
207207
if (hls) {
208208
hls.stopLoad();
209209
}
210210
211+
/**
212+
* Ensure element is mounted before setting the source.
213+
*/
214+
await nextTick();
215+
211216
if (
212217
mediaElementRef.value
213218
&& (!newUrl

0 commit comments

Comments
 (0)