mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-14 15:56:38 +03:00
Added 'doubleClickForFullscreen' config to UI.
This configuration, which is true by default, lets a user optionally disable the "go fullscreen on double-click" functionality. This allows a developer to fully disable fullscreen mode, if they so wish, or to retain the fullscreen button but disable other methods of entering fullscreen. Issue #2459 Change-Id: I196602fc9843e0fd799c78703de60f864e906841
This commit is contained in:
@@ -187,6 +187,7 @@ describe('UI', () => {
|
||||
overflowMenuButtons: [
|
||||
'quality',
|
||||
],
|
||||
doubleClickForFullscreen: false,
|
||||
};
|
||||
const ui = UiUtils.createUIThroughAPI(videoContainer, video, config);
|
||||
const controls = ui.getControls();
|
||||
@@ -195,6 +196,13 @@ describe('UI', () => {
|
||||
|
||||
const controlsContainer =
|
||||
videoContainer.querySelector('.shaka-controls-container');
|
||||
// When double-click for fullscreen is disabled, it shouldn't happen.
|
||||
UiUtils.simulateEvent(controlsContainer, 'dblclick');
|
||||
await Util.shortDelay();
|
||||
expect(spy).not.toHaveBeenCalled();
|
||||
// Change the configuration and try again.
|
||||
config.doubleClickForFullscreen = true;
|
||||
(/** @type {!shaka.ui.Overlay} */ (ui)).configure(config);
|
||||
UiUtils.simulateEvent(controlsContainer, 'dblclick');
|
||||
await Util.shortDelay();
|
||||
expect(spy).toHaveBeenCalledTimes(1);
|
||||
|
||||
Reference in New Issue
Block a user