Streaming live at 10am (PST)

Close lightbox at the end of videos



So I have a lightbox with a vimeo and was wondering if it was possible either through custom code or (ideally) native to close a lightbox when the video ends... @cyberdave it would be great to hear your thoughts on this.

If it is not possible I will add it to the wishlist woo smile



Autoplay Video in Lightbox (without using default webflow video lightbox)

Something like this would need be done with custom code. Something like when the Vimeo player notices that the video is finished, it'll fire an event those could close a webflow modal.

Here is the JS API for Vimeo, maybe this will lead you in the right direction:

good luck and have fun smile


Thanks @PixelGeek I had taken a look at that, do you know what trigger would close the mobile in webflow? I could export a lightbox site and trawl through the js but would probably miss it, if you happen to know let me know. smile



A quick hack is to just trigger the event assigned to the close icon:


For more details, you'll need to beautify the source code (@danro mentioned in another thread that it was not minified aside from third-party libs, but I must be blind!), and then look for the function createLightbox().

To trigger that after your video is done, you'd listen for the finish event via the Vimeo API:

document.getElementById('vimeo_player').api_addEventListener('finish', function(event) {




Thanks @cyberdave @dkenzik, I will play around with the options on this!



Has anyone had any luck implementing how to close a lightbox after a video has ended?

closed #8

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.