diff --git a/ui/controls.js b/ui/controls.js index 648f45da7..86c70fcc3 100644 --- a/ui/controls.js +++ b/ui/controls.js @@ -134,7 +134,8 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget { // seconds in case a user immediately initiates another mouse move to // interact with the menus. If that didn't happen, go ahead and hide // the menus. - this.hideSettingsMenusTimer_.tickAfter(/* seconds= */ 2); + this.hideSettingsMenusTimer_.tickAfter( + /* seconds= */ this.config_.closeMenusDelay); }); /** diff --git a/ui/externs/ui.js b/ui/externs/ui.js index 9f7e6669d..639d9e94e 100644 --- a/ui/externs/ui.js +++ b/ui/externs/ui.js @@ -81,6 +81,7 @@ shaka.extern.UIVolumeBarColors; * trackLabelFormat: shaka.ui.Overlay.TrackLabelFormat, * textTrackLabelFormat: shaka.ui.Overlay.TrackLabelFormat, * fadeDelay: number, + * closeMenusDelay: number, * doubleClickForFullscreen: boolean, * singleClickForPlayAndPause: boolean, * enableKeyboardPlaybackControls: boolean, @@ -182,6 +183,9 @@ shaka.extern.UIVolumeBarColors; * interacting with them. We recommend setting this to 3 on your cast * receiver UI. * Defaults to 0. + * @property {number} closeMenusDelay + * The delay (in seconds) before close the opened menus when the UI is hidden. + * Defaults to 2. * @property {boolean} doubleClickForFullscreen * Whether or not double-clicking on the UI should cause it to enter * fullscreen. diff --git a/ui/ui.js b/ui/ui.js index e300d382f..f85155443 100644 --- a/ui/ui.js +++ b/ui/ui.js @@ -321,6 +321,7 @@ shaka.ui.Overlay = class { trackLabelFormat: shaka.ui.Overlay.TrackLabelFormat.LANGUAGE, textTrackLabelFormat: shaka.ui.Overlay.TrackLabelFormat.LANGUAGE, fadeDelay: 0, + closeMenusDelay: 2, doubleClickForFullscreen: true, singleClickForPlayAndPause: true, enableKeyboardPlaybackControls: true,