skywalker2909
skywalker2909

Reputation: 1686

Chrome extension to dim the background

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

Answers (2)

user1731468
user1731468

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

Andrew Hall
Andrew Hall

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

Related Questions