Skip to content

Commit

Permalink
fix(player/react): not loading on remount
Browse files Browse the repository at this point in the history
  • Loading branch information
mihar-22 committed Oct 9, 2023
1 parent 9131ef0 commit f8f785f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/vidstack/src/components/provider/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ export class MediaProvider extends Component<MediaProviderProps, MediaProviderSt
protected _runLoader(target: HTMLElement | null | undefined) {
if (!this.scope) return;

const loader = this.$state.loader();
const loader = this.$state.loader(),
{ $provider } = this._media;

if (this._loader === loader && loader?.target === target) return;
if (this._loader === loader && loader?.target === target && peek($provider)) return;

this._destroyProvider();
this._loader = loader;
Expand Down

0 comments on commit f8f785f

Please sign in to comment.