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
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"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",
},
},
aol: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
arte: {
videoWrapperScriptPath: "video-wrappers/arte.js",
},
},
bbc: {
videoWrapperScriptPath: "video-wrappers/bbc.js",
},
videoWrapperScriptPath: "video-wrappers/bbc.js",
},
},
brightcove: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
cbc: {
videoWrapperScriptPath: "video-wrappers/cbc.js",
},
},
dailymotion: {
videoWrapperScriptPath: "video-wrappers/dailymotion.js",
},
},
disneyplus: {
videoWrapperScriptPath: "video-wrappers/disneyplus.js",
},
},
edx: {
videoWrapperScriptPath: "video-wrappers/edx.js",
},
},
frontendMasters: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
funimation: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
hbomax: {
"https://play.hbomax.com/page/*": { policy: TOGGLE_POLICIES.HIDDEN },
videoWrapperScriptPath: "video-wrappers/hbomax.js",
},
},
hotstar: {
videoWrapperScriptPath: "video-wrappers/hotstar.js",
},
},
hulu: {
videoWrapperScriptPath: "video-wrappers/hulu.js",
},
},
instagram: {
"https://www.instagram.com/*": { policy: TOGGLE_POLICIES.ONE_QUARTER },
},
laracasts: {
"https://*.laracasts.com/*": { policy: TOGGLE_POLICIES.ONE_QUARTER },
},
msn: {
visibilityThreshold: 0.7,
},
},
mxplayer: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
nebula: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
netflix: {
videoWrapperScriptPath: "video-wrappers/netflix.js",
},
"https://*.netflix.com/browse*": { policy: TOGGLE_POLICIES.HIDDEN },
"https://*.netflix.com/latest*": { policy: TOGGLE_POLICIES.HIDDEN },
"https://*.netflix.com/Kids*": { policy: TOGGLE_POLICIES.HIDDEN },
"https://*.netflix.com/title*": { policy: TOGGLE_POLICIES.HIDDEN },
"https://*.netflix.com/notification*": { policy: TOGGLE_POLICIES.HIDDEN },
"https://*.netflix.com/search*": { policy: TOGGLE_POLICIES.HIDDEN },
},
nytimes: {
videoWrapperScriptPath: "video-wrappers/nytimes.js",
},
},
pbs: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
piped: {
videoWrapperScriptPath: "video-wrappers/piped.js",
},
videoWrapperScriptPath: "video-wrappers/piped.js",
},
},
radiocanada: {
videoWrapperScriptPath: "video-wrappers/radiocanada.js",
},
},
reddit: {
"https://*.reddit.com/*": { policy: TOGGLE_POLICIES.ONE_QUARTER },
},
sonyliv: {
videoWrapperScriptPath: "video-wrappers/sonyliv.js",
},
},
ted: {
showHiddenTextTracks: true,
},
},
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,
},
},
viki: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
voot: {
videoWrapperScriptPath: "video-wrappers/voot.js",
},
},
wired: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.js",
},
},
yahoo: {
videoWrapperScriptPath: "video-wrappers/videojsWrapper.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",
},
},
primeVideo: {
visibilityThreshold: 0.9,
videoWrapperScriptPath: "video-wrappers/primeVideo.js",
},
visibilityThreshold: 0.9,
videoWrapperScriptPath: "video-wrappers/primeVideo.js",
},
},
};
}