Skip to content

Commit

Permalink
Give an embedded page time to load the video player
Browse files Browse the repository at this point in the history
  • Loading branch information
WesselKroos committed May 16, 2024
1 parent e73f6ae commit 8a0dc1f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/scripts/injected.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const tryInitAmbientlight = async () => {
if (window.ambientlight) return true
if (!isWatchPageUrl()) return
if(!document.querySelector('video')) return

if(isEmbedPageUrl()) {
const videoElem = document.querySelector('#player #movie_player video.html5-main-video')
if (!videoElem) {
Expand Down Expand Up @@ -262,11 +262,6 @@ const loadAmbientlight = async () => {
let observerTarget = document.querySelector('ytd-app')
if(!observerTarget) {
if(isEmbedPageUrl()) {
if(!document.querySelector('#player')) {
logErrorEventWithPageTrees('initialize - not found yet: #player')
errorEvents.send('Found no #player element on the embed page', true)
return
}
observerTarget = document.body
} else {
const otherAppElems = getOtherUnknownAppElems()
Expand Down

0 comments on commit 8a0dc1f

Please sign in to comment.