Skip to content

Commit

Permalink
fix(PlayerElement): wait for next tick so element is mounted before s…
Browse files Browse the repository at this point in the history
…etting source (#2549)

Signed-off-by: Fernando Fernández <[email protected]>
  • Loading branch information
ferferga authored Dec 29, 2024
1 parent ad81868 commit e351418
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/components/Playback/PlayerElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e351418

Please sign in to comment.