Skip to content

Commit

Permalink
fix(player): controls component delay overriding player prop
Browse files Browse the repository at this point in the history
ref #972
  • Loading branch information
mihar-22 committed Oct 23, 2023
1 parent ebc5771 commit 35bf1e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/vidstack/src/components/ui/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export class Controls extends Component<ControlsProps, {}, ControlsEvents> {
private _watchHideDelay() {
const { controls } = this._media.player,
{ hideDelay } = this.$props;
controls.defaultDelay = hideDelay();

// Use controls delay prop on player if this is the default value.
controls.defaultDelay = hideDelay() === 2000 ? this._media.$props.controlsDelay() : hideDelay();
}

private _isShowing() {
Expand Down
4 changes: 2 additions & 2 deletions packages/vidstack/src/core/state/media-request-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class MediaRequestManager extends MediaPlayerController implements MediaR

this.listen('fullscreen-change', this._onFullscreenChange.bind(this));

effect(this._onControlsHideDelayChange.bind(this));
effect(this._onControlsDelayChange.bind(this));
effect(this._onFullscreenSupportChange.bind(this));
effect(this._onPiPSupportChange.bind(this));
}
Expand Down Expand Up @@ -325,7 +325,7 @@ export class MediaRequestManager extends MediaPlayerController implements MediaR
);
}

private _onControlsHideDelayChange() {
private _onControlsDelayChange() {
this._controls.defaultDelay = this.$props.controlsDelay();
}

Expand Down

0 comments on commit 35bf1e0

Please sign in to comment.