I’m trying to hide an embedded video using som simple jQuery and it all worked fine till turned my speakers on. The video hides fine but the sound keeps on playing in the background.
Is there a function I can cal that either mutes the video aswell or completely removes it?
Check the link below for an example, play the video then click the hide video link to see what I’m talking about. Been at this for ages and it’s properly annoying me now.
Well Vimeo’s API reference is horrible, but check out this page. http://developer.vimeo.com/player/js-api Mainly the
play()andpause()functions. It says you need to send any of these API functions indirectly to the iFrame containing the video. To do this you need to addapi=1to the iFrame url like this<iframe id="video2" src="http://player.vimeo.com/video/16965687?title=0&byline=0&portrait=0&api=1" width="400" height="225" frameborder="0"></iframe>You can’t call these functions directly on the iFrame though, you have to use
postMessage()to send the function call to the iFrame.https://developer.mozilla.org/en/DOM/window.postMessage has some good documentation on the syntax of that function. Hope this helps.