YouTube Control

Auto-pause iframed Youtube videos when out of view

On a non-Ceros web page, an iframed YouTube video will not pause automatically when it’s out of view. This plugin was built to give you better control to pause Youtube videos when hidden so you can achieve a seamless user-experience and prevent that annoying after-play.

How we did it

We used event listeners to trigger calls to YouTube’s API to pause and play the videos with API functions.

What you need

  • The custom HTML snippet
  • A Ceros experience
  • The embed code for the YouTube video(s) you want to add to Ceros
  • Note: if you import the demo to your Ceros account, you’ll need to add the custom HTML snippet yourself for it to function. We’re working on a smoother experience. In the meantime, help us help you!

How to implement

  • 1

    Add Custom HTML Script

  • 2

    Add Embedded Object & Get Your YouTube Embed Code

  • 3

    Add Modified YouTube Embed Code

  • 4

    Edit Embed Code

  • 5

    Replace src URL

  • 6

    Tag & Payload HTML Object

  • 7

    Set Up Hotspot

  • 8

    Test Your Experience