Source code
Revision control
Copy as Markdown
Other Tools
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
"use strict";
/* globals browser */
let AVAILABLE_PIP_OVERRIDES;
{
// See PictureInPictureControls.sys.mjs for these values.
// eslint-disable-next-line no-unused-vars
const TOGGLE_POLICIES = browser.pictureInPictureChild.getPolicies();
const KEYBOARD_CONTROLS = browser.pictureInPictureChild.getKeyboardControls();
AVAILABLE_PIP_OVERRIDES = {
// The keys of this object are match patterns for URLs, as documented in
//
// Example:
// const KEYBOARD_CONTROLS = browser.pictureInPictureChild.getKeyboardControls();
//
//
// policy: TOGGLE_POLICIES.THREE_QUARTERS,
// disabledKeyboardControls: KEYBOARD_CONTROLS.PLAY_PAUSE | KEYBOARD_CONTROLS.VOLUME,
// },
// policy: TOGGLE_POLICIES.TOP,
// disabledKeyboardControls: KEYBOARD_CONTROLS.ALL,
// },
tests: {
// FOR TESTS ONLY!
{
videoWrapperScriptPath: "video-wrappers/mock-wrapper.js",
},
{
videoWrapperScriptPath: "video-wrappers/mock-wrapper.js",
},
},
abcnews: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
airmozilla: {
videoWrapperScriptPath: "video-wrappers/airmozilla.js",
},
},
},
},
bbc: {
videoWrapperScriptPath: "video-wrappers/bbc.js",
},
videoWrapperScriptPath: "video-wrappers/bbc.js",
},
},
brightcove: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
canalplus: {
videoWrapperScriptPath: "video-wrappers/canalplus.js",
disabledKeyboardControls: KEYBOARD_CONTROLS.LIVE_SEEK,
},
videoWrapperScriptPath: "video-wrappers/canalplus.js",
},
},
},
},
},
cspan: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
dailymotion: {
videoWrapperScriptPath: "video-wrappers/dailymotion.js",
},
},
disneyplus: {
videoWrapperScriptPath: "video-wrappers/disneyplus.js",
},
},
},
fandom: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
fastcompany: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
frontendMasters: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
funimation: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
},
hbomax: {
videoWrapperScriptPath: "video-wrappers/hbomax.js",
},
},
},
hulu: {
policy: TOGGLE_POLICIES.ONE_QUARTER,
videoWrapperScriptPath: "video-wrappers/hulu.js",
},
},
},
indpendentuk: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
indy100: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
instagram: {
},
internetArchive: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
laracasts: {
},
},
},
mxplayer: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
nbcnews: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
nbcUniversal: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
nebula: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
netflix: {
videoWrapperScriptPath: "video-wrappers/netflix.js",
},
},
},
pbs: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
piped: {
videoWrapperScriptPath: "video-wrappers/piped.js",
},
videoWrapperScriptPath: "video-wrappers/piped.js",
},
},
primeVideo: {
visibilityThreshold: 0.9,
videoWrapperScriptPath: "video-wrappers/primeVideo.js",
},
visibilityThreshold: 0.9,
videoWrapperScriptPath: "video-wrappers/primeVideo.js",
},
},
radiocanada: {
videoWrapperScriptPath: "video-wrappers/radiocanada.js",
},
},
reddit: {
},
reuters: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
},
},
},
},
timvision: {
videoWrapperScriptPath: "video-wrappers/canalplus.js",
disabledKeyboardControls: KEYBOARD_CONTROLS.LIVE_SEEK,
},
videoWrapperScriptPath: "video-wrappers/canalplus.js",
},
},
tubi: {
videoWrapperScriptPath: "video-wrappers/tubilive.js",
},
videoWrapperScriptPath: "video-wrappers/tubi.js",
},
videoWrapperScriptPath: "video-wrappers/tubi.js",
},
},
twitch: {
videoWrapperScriptPath: "video-wrappers/twitch.js",
policy: TOGGLE_POLICIES.ONE_QUARTER,
disabledKeyboardControls: KEYBOARD_CONTROLS.LIVE_SEEK,
},
videoWrapperScriptPath: "video-wrappers/twitch.js",
policy: TOGGLE_POLICIES.ONE_QUARTER,
disabledKeyboardControls: KEYBOARD_CONTROLS.LIVE_SEEK,
},
videoWrapperScriptPath: "video-wrappers/twitch.js",
policy: TOGGLE_POLICIES.ONE_QUARTER,
disabledKeyboardControls: KEYBOARD_CONTROLS.LIVE_SEEK,
},
},
udemy: {
videoWrapperScriptPath: "video-wrappers/udemy.js",
policy: TOGGLE_POLICIES.ONE_QUARTER,
},
},
univision: {
videoWrapperScriptPath: "video-wrappers/jwplayerWrapper.js",
},
},
},
},
},
},
},
youtube: {
/**
* The threshold of 0.7 is so that users can click on the "Skip Ads"
* button on the YouTube site player without accidentally triggering
* PiP.
*/
visibilityThreshold: 0.7,
videoWrapperScriptPath: "video-wrappers/youtube.js",
},
visibilityThreshold: 0.9,
videoWrapperScriptPath: "video-wrappers/youtube.js",
},
},
washingtonpost: {
videoWrapperScriptPath: "video-wrappers/washingtonpost.js",
},
},
};
}