Skip to content

Commit

Permalink
fix(core): initial muted state is not set on media embeds
Browse files Browse the repository at this point in the history
  • Loading branch information
mihar-22 committed Nov 21, 2021
1 parent 64a658e commit df0e6bc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,14 @@ export class Dailymotion implements MediaProvider<HTMLVmEmbedElement> {
this.dispatch = createProviderDispatcher(this);
this.dispatch('viewType', ViewType.Video);
this.onVideoIdChange();
this.initialMuted = this.muted;
this.internalState.muted = this.muted;
this.defaultInternalState = { ...this.internalState };
}

componentDidLoad() {
this.initialMuted = this.muted;
}

private getOrigin() {
return 'https://www.dailymotion.com';
}
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/components/providers/vimeo/vimeo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,13 @@ export class Vimeo implements MediaProvider<HTMLVmEmbedElement> {
this.dispatch = createProviderDispatcher(this);
this.dispatch('viewType', ViewType.Video);
this.onVideoIdChange();
this.initialMuted = this.muted;
this.defaultInternalState = { ...this.internalState };
}

componentDidLoad() {
this.initialMuted = this.muted;
}

disconnectedCallback() {
this.cancelTimeUpdates();
this.pendingPlayRequest = undefined;
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/components/providers/youtube/youtube.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,13 @@ export class YouTube implements MediaProvider<HTMLVmEmbedElement> {
this.dispatch = createProviderDispatcher(this);
this.dispatch('viewType', ViewType.Video);
this.onVideoIdChange();
this.initialMuted = this.muted;
this.defaultInternalState = { ...this.internalState };
}

componentDidLoad() {
this.initialMuted = this.muted;
}

/** @internal */
@Method()
async getAdapter() {
Expand Down

0 comments on commit df0e6bc

Please sign in to comment.