Popup after video plays?

Hi All,

I’m just getting started and trying to create a popup (asking for email subscriptions) after a user finishes watching a Youtube video. I’m not a coding genius but I found this code that seems like it might be a good solution so I went and enabled developer tools in Wix to work it into the code. Surprisingly, the code displayed blank even though there are multiple elements on the page already. From this, I have 2 questions - 1) What is the best way to create a popup after a youtube video plays? and 2) Is there a way to see and integrate with the full code on the page that I’m missing? Thanks for the help!

Hi,
The code described in the thread is both HTML and javascript. Note that you don’t have access to the HTML code of your page. Therefore, you would need to add an iFrame and embed the code there.
Moreover, you can use messaging to post or get messages from or to the iFrame.

Good luck,
Tal.

Thanks Tal, this was immensely helpful. For anyone else looking at this in the future, just a couple notes - 1) the code I link to initially needs to be updated from to (Wix required HTTPS)

  1. Google’s API reference is also helpful if you need to do more with the youtube video - YouTube Player API Reference for iframe Embeds  |  YouTube IFrame Player API  |  Google for Developers