mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-16 08:27:03 +03:00
Merge pull request #701 from manualmanul/fix-youtube-tv
Partially fix YouTube TV support
This commit is contained in:
@@ -1530,8 +1530,9 @@ function getSegmentsMessage(sponsorTimes: SponsorTime[]): string {
|
|||||||
function addHotkeyListener(): boolean {
|
function addHotkeyListener(): boolean {
|
||||||
let videoRoot = document.getElementById("movie_player") as HTMLDivElement;
|
let videoRoot = document.getElementById("movie_player") as HTMLDivElement;
|
||||||
if (onInvidious) videoRoot = (document.getElementById("player-container") ?? document.getElementById("player")) as HTMLDivElement;
|
if (onInvidious) videoRoot = (document.getElementById("player-container") ?? document.getElementById("player")) as HTMLDivElement;
|
||||||
|
if (video.baseURI.startsWith("https://www.youtube.com/tv#/")) videoRoot = document.querySelector("ytlr-watch-page") as HTMLDivElement;
|
||||||
|
|
||||||
if (!videoRootsWithEventListeners.includes(videoRoot)) {
|
if (videoRoot && !videoRootsWithEventListeners.includes(videoRoot)) {
|
||||||
videoRoot.addEventListener("keydown", hotkeyListener);
|
videoRoot.addEventListener("keydown", hotkeyListener);
|
||||||
videoRootsWithEventListeners.push(videoRoot);
|
videoRootsWithEventListeners.push(videoRoot);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user