-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add extra options to disable double click fullscreen
- Loading branch information
Showing
4 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
import { tryToggleFullscreen } from "./HandleFullscreen"; | ||
import { PolyDictionary } from "./definitions"; | ||
import { getVideo } from "./getters"; | ||
|
||
/** | ||
* Handle adding event listeners to existing elements. | ||
* For example, adds a double click event to the player to enter fullscreen mode | ||
*/ | ||
export function injectEventsToExistingElements() { | ||
export function injectEventsToExistingElements(options: PolyDictionary) { | ||
const player: HTMLElement | null = getVideo(); | ||
|
||
// double click the player to enter fullscreen mode | ||
if (player !== null) player.addEventListener("dblclick", tryToggleFullscreen); | ||
if (player !== null && options["fullScreenDoubleClick"]) | ||
player.addEventListener("dblclick", tryToggleFullscreen); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters