Question

I've been banging my head on trying to get my embedded youtube playlist to stop (preferrably pause) when the user opens a new browser window via a link from within the webpage. This link goes to another page which also automatically starts a video (nobody wants two videos playing at once). This is the bare bones code I have thus far. Thanks for the help.

<iframe width="452" height="278" src="//www.youtube.com/embed/videoseries?list=PL3NaSh-osYfmAc4IUijQN1aJGDehZepVQ&autoplay=1?enablejsapi=1" frameborder="0" allowfullscreen></iframe>

No correct solution

OTHER TIPS

You can catch the link onClick, call pause to the Youtube control and continue with opening the link. More like this:

Remove the href from your link, and set a #mark. Set an id (let's suppose is myLink). Catch the click on the link:

 $("#myLink").click(function(e) {
   //call pause on your Youtube control. See this response: http://stackoverflow.com/a/12522499/335905 
   // as long as you are not calling e.preventDefault(), the link should continue opening as expected. 

   });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top