0
votes

We need help figuring out the code to generate to do the following:

  1. The website has on its homepage a jquery slider with a Youtube video on the first slide. But the video won't autoplay, we want it to be played only when the Fancybox popup close is triggered.
  2. A Fancybox v2x will be displayed automatically on the same page at first. This Fancybox will have an image linking to an external URL
  3. If we close the Fancybox window, we would like the Youtube video (from the jquery slider) to play automatically.

We haven't generated the code yet, but because usually it's the other way around (having the video play on the Fancybox rather than having Fancybox trigger a Youtube autoplay from another div, this becomes complicated.

Your help would be really appreciated.

Thanks

1

1 Answers

0
votes

Haven't tested this, but you can declare a callback when Fancybox closes

$('#fancybox').fancybox({
    //options,
    'onClose': playYoutubeVideo()
});

function playYoutubeVideo() {
    //code to play video
    //depends if it's html5 or flash
}