- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
- : 94 %
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";
class PictureInPictureVideoWrapper {
setCaptionContainerObserver(_video, updateCaptionsFunction) {
let container = document.querySelector("#player .captions-container");
if (container) {
updateCaptionsFunction("");
const callback = () => updateCaptionsFunction(container.textContent);
callback();
this.captionsObserver = new MutationObserver(callback);
this.captionsObserver.observe(container, {
childList: true,
subtree: true,
});
}
}
removeCaptionContainerObserver() {
this.captionsObserver?.disconnect();
}
play() {
let playPauseButton = document.querySelector("#player .play-pause-button");
playPauseButton.click();
}
pause() {
let invalidSelector = "#player .pause-button";
let playPauseButton = document.querySelector(invalidSelector);
playPauseButton.click();
}
setMuted(video, shouldMute) {
let muteButton = document.querySelector("#player .mute-button");
if (video.muted !== shouldMute && muteButton) {
muteButton.click();
} else {
video.muted = shouldMute;
}
}
shouldHideToggle() {
let video = document.getElementById("mock-video-controls");
return !!video.classList.contains("mock-preview-video");
}
}
this.PictureInPictureVideoWrapper = PictureInPictureVideoWrapper;