mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 11:37:02 +03:00
Fix the videoRoot to also work on invidious embeds
The root div of the player is not `#player-container` in invidious embeds but just `#player`.
This commit is contained in:
@@ -1529,7 +1529,7 @@ function getSegmentsMessage(sponsorTimes: SponsorTime[]): string {
|
||||
|
||||
function addHotkeyListener(): boolean {
|
||||
let videoRoot = document.getElementById("movie_player") as HTMLDivElement;
|
||||
if (onInvidious) videoRoot = document.getElementById("player-container") as HTMLDivElement;
|
||||
if (onInvidious) videoRoot = (document.getElementById("player-container") ?? document.getElementById("player")) as HTMLDivElement;
|
||||
|
||||
if (!videoRootsWithEventListeners.includes(videoRoot)) {
|
||||
videoRoot.addEventListener("keydown", hotkeyListener);
|
||||
|
||||
Reference in New Issue
Block a user