зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1835638 - fix play/pause and mute btns sync on Udemy site inside PIP r=pip-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D180917
This commit is contained in:
Родитель
b2160e6a33
Коммит
e56c50d203
|
@ -5,6 +5,33 @@
|
|||
"use strict";
|
||||
|
||||
class PictureInPictureVideoWrapper {
|
||||
play(video) {
|
||||
let playPauseButton = document.querySelector(
|
||||
`[data-purpose="play-button"]`
|
||||
);
|
||||
if (video.paused) {
|
||||
playPauseButton?.click();
|
||||
}
|
||||
}
|
||||
|
||||
pause(video) {
|
||||
let playPauseButton = document.querySelector(
|
||||
`[data-purpose="pause-button"]`
|
||||
);
|
||||
if (!video.paused) {
|
||||
playPauseButton?.click();
|
||||
}
|
||||
}
|
||||
|
||||
setMuted(video, shouldMute) {
|
||||
let muteButton = document.querySelector(
|
||||
`[data-purpose="volume-control-button"]`
|
||||
);
|
||||
if (video.muted !== shouldMute && muteButton) {
|
||||
muteButton.click();
|
||||
}
|
||||
}
|
||||
|
||||
setCaptionContainerObserver(video, updateCaptionsFunction) {
|
||||
let container = document.querySelector(
|
||||
".video-player--video-player--1sfof"
|
||||
|
|
Загрузка…
Ссылка в новой задаче