FancyBox and Youtube API events

前端 未结 2 1506
慢半拍i
慢半拍i 2020-12-12 03:57

I\'m trying to fire an event once the youtube video that I\'m playing into my fancybox is ended.

So I can close automatically the fancybox once the video is over.

2条回答
  •  既然无缘
    2020-12-12 04:18

    Possible causes:

    • Testing "locally" (loading the file without going through http://localhost)
    • Mixing Embed API (where you declare an iframe) with iframe API (where you declare a DIV and load some JS). The events only seem to work with the latter.
    • ID on the DIV does not match ID on new YT.Player(...) call

提交回复
热议问题