This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Bimma Bimma
Posted Jun 07 - Read on Facebook

Module question anyone:

I have multiple modules that I want to run sequentially. The first module simply runs a 2 second video, but I do not want the second module to load / execute until the video completes. How can I signal to the top (root) level that a media element (video) in the first module has completed, then fire the next module? Right now they both execute at the same time obviously.

4 Comments

Chris Clark

The quick/hacky way would be to use Utils.delay to time the loading of the second module manually. But since VideoLayer.player emits Media Events (https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events) you could listen for the "ended" event and load the second module on that.

Sergio Majluf

Maybe integrating popcorn.js? It's a powerful yet simple library for manipulation of media

Koen Bok

I would wrap whatever you want to do in a function in the module, and call it on the player end event.

Bimma Bimma

All great recommendations. Many thanks.

Read the entire post on Facebook