Skip to content

Commit

Permalink
fix(mux-video,mux-audio): (re)load core when connected, since we curr…
Browse files Browse the repository at this point in the history
…ently unload core when disconnected.
  • Loading branch information
cjpillsbury committed Sep 5, 2023
1 parent 5d4554d commit ef382bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/mux-audio/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,13 @@ class MuxAudioElement extends CustomAudioElement implements Partial<MuxMediaProp
}
}

connectedCallback(): void {
super.connectedCallback?.();
if (this.nativeEl && this.src && !this.#core) {
this.#requestLoad();
}
}

disconnectedCallback() {
this.unload();
}
Expand Down
3 changes: 2 additions & 1 deletion packages/mux-video/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,8 @@ class MuxVideoElement extends CustomVideoElement implements Partial<MuxMediaProp
}

connectedCallback(): void {
if (this.src && !this.#core) {
super.connectedCallback?.();
if (this.nativeEl && this.src && !this.#core) {
this.#requestLoad();
}
}
Expand Down

0 comments on commit ef382bb

Please sign in to comment.