I'm writing a chrome extension that displays content synced with the video.
I need to wait until the viewer finishes the ad/midroll before displaying the content. How do I do something such as the following via javascript?
if (videoOnAd == true) {
//do something
} else {
//do something else
}
Thanks in advance!
Solution!
if (document.querySelector("div.ad-showing")) {
//Ad is active as a video
console.log("this is an ad")
}
else {
console.log("the video is playing")
}
}
Enjoy everyone!