Reputation: 1686
i wanted to ask a question regarding this chrome extension called Turn Off The Lights , im aware of how to dim the background using jquery and css etc.. but what i am interested in knowing is how to get the current video playing from popular websites like YouTube, dailymotion etc.. before applying the jquery effects..?
Upvotes: 1
Views: 163
Reputation: 1000
search with javascript to this "movie_player" id (YouTube only) and check if it's playing, if yes -> dim the web page.
More information about detecting the video player status, see this API link: https://developers.google.com/youtube/js_api_reference#Playback_controls
Upvotes: 1
Reputation: 3073
I can only assume that it looks for or elements in the page using some selector.
Then it would add the div to dim the background using a content script, changing the z-index of the found video element to a higher value.
Upvotes: 0