mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-07 23:43:37 +00:00
Bug 1822999 - allow mute from PiP window for YouTube Shorts r=pip-reviewers,niklas
Differential Revision: https://phabricator.services.mozilla.com/D179378
This commit is contained in:
parent
65be1cbe7a
commit
44662a6086
@ -6,7 +6,13 @@
|
||||
|
||||
class PictureInPictureVideoWrapper {
|
||||
constructor(video) {
|
||||
this.player = video.closest("#movie_player")?.wrappedJSObject;
|
||||
// Use shorts player only if video is from YouTube Shorts.
|
||||
let shortsPlayer = video.closest("#shorts-player")?.wrappedJSObject;
|
||||
let isYTShorts = !!(video.baseURI.includes("shorts") && shortsPlayer);
|
||||
|
||||
this.player = isYTShorts
|
||||
? shortsPlayer
|
||||
: video.closest("#movie_player")?.wrappedJSObject;
|
||||
}
|
||||
isLive(video) {
|
||||
return !!document.querySelector(".ytp-live");
|
||||
|
Loading…
x
Reference in New Issue
Block a user