Fix invidious support

Fixes https://github.com/ajayyy/SponsorBlock/issues/636
This commit is contained in:
Ajay Ramachandran 2021-02-03 18:28:50 -05:00
parent 318d00a9c4
commit 54b4681fc3

View file

@ -1528,7 +1528,8 @@ function getSegmentsMessage(sponsorTimes: SponsorTime[]): string {
}
function addHotkeyListener(): boolean {
const videoRoot = document.getElementById("movie_player") as HTMLDivElement;
let videoRoot = document.getElementById("movie_player") as HTMLDivElement;
if (onInvidious) videoRoot = document.getElementById("player-container") as HTMLDivElement;
if (!videoRootsWithEventListeners.includes(videoRoot)) {
videoRoot.addEventListener("keydown", hotkeyListener);