Search code examples
javascriptcsswordpressembedvimeo

Add a class to body when play is pressed on a Vimeo embed


I could really use some help on this one. I need to add a class to the body tag when someone presses the play button on a Vimeo embed.

The background on the site is white and when someone presses the play button, a class is added to the body tag so the background fades to black (body class="bgcolor_black"). And when the movie is paused or stops it goes back to the white background (body class="bgcolor_white").

Is this possible? The site is built on Wordpress. I have searched alot but all I can find is about a extra button to "turn the lights off".

Thanks in advance and sorry if the english is bad :)


Solution

  • This cannot be done unless vimeo.com allows your domain to execute cross-domain interaction. It is not allowed for security reasons. This security measure is known as the Same Origin Policy.