How do I display a Full Screen Event for a set number of seconds, before closing automatically?

Avatar
Chris Broughton

Full Screen Events/Actions are designed to be shown at the start, end, or during playback of a video.

If they are placed throughout the video content, they will show a Call to Action (CTA) at a specific timepoint and pause playback. The viewer should then be presented with a button to continue playback, whether that is a 'Submit' option on a form, or 'Skip' in the top right corner.

You may have a requirement to have the Event/Action show for a number of seconds before disappearing. This would mean that there is no need to show 'Skip' or have another method of closing the Event as a viewer interaction.

Code

You can use the following within the Event/Action HTML to set a 'timeout'. This is defaulted at 3 seconds. 

<script type="text/javascript">
   window.addEventListener('showEvent', function () {
     setTimeout(function() { API.closeCta(); }, 3000);
   });
 </script>

To change the number of seconds, you can replace the 3000 with another number (defined in milliseconds).

Need support

Submit a ticket or start a chat. We'll provide a self-serve resource or connect you with our support team, available 24x5.

Chat with Our Team