Skip to content

Commit

Permalink
Decrease controls hide delay
Browse files Browse the repository at this point in the history
  • Loading branch information
alopatindev committed Nov 1, 2024
1 parent 75db199 commit 190f638
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/vidstack/src/components/ui/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { setAttributeIfEmpty } from '../../utils/dom';
*/
export class Controls extends Component<ControlsProps, {}, ControlsEvents> {
static props: ControlsProps = {
hideDelay: 2000,
hideDelay: 1000,
hideOnMouseLeave: false,
};

Expand Down Expand Up @@ -66,7 +66,7 @@ export class Controls extends Component<ControlsProps, {}, ControlsEvents> {
{ hideDelay, hideOnMouseLeave } = this.$props;

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

Expand Down
2 changes: 1 addition & 1 deletion packages/vidstack/src/core/api/player-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const mediaPlayerProps: MediaPlayerProps = {
preferNativeHLS: false,
src: '',
title: '',
controlsDelay: 2000,
controlsDelay: 1000,
hideControlsOnMouseLeave: false,
viewType: 'unknown',
streamType: 'unknown',
Expand Down
4 changes: 2 additions & 2 deletions packages/vidstack/src/core/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export class MediaControls extends MediaPlayerController {
* The default amount of delay in milliseconds while media playback is progressing without user
* activity to indicate an idle state (i.e., hide controls).
*
* @defaultValue 2000
* @defaultValue 1000
*/
defaultDelay = 2000;
defaultDelay = 1000;

/**
* Whether controls can hide after a delay in user interaction. If this is false, controls will
Expand Down

0 comments on commit 190f638

Please sign in to comment.