How to stop an embedded Vimeo video when you hide the object

We embed Vimieo videos into our courses using the the embedded code in an HTML Extension. This works great, however, we are now doing a course where we have 2 videos on one page. When you click a button video1 appears and you can click the play button on the video. If you click button2 video1 will hide and video2 will appear. The issue is that when we hide the HTML Extension (video1) the video doesn't show, but the audio keeps playing. Anyone know how to stop the video when you hide the HTML object?

Discussion (3)

This is a BIG guess but hopefully it will just work!

On the first Vimeo external HTML object add these two actions:

Action -> On Page Show -> RunJavaScript

getDisplayWindow().vimeoVideo1 = %HTMLNAME%;

Action -> On Hide -> RunJavaScript

triv$(';iframe';, getDisplayWindow().vimeoVideo1.div)[0].contentWindow.postMessage(';pause';, ';*';);

If it doesn't it would help if you can post an example title or publish to a public area where we can try it!

Thanks,

Joe

That's awesome @timk if we implement a vimeo object I'll be calling you!

Vimeo provides a Javascript API that lets you control the videos. I produced a simple example:

https://community.trivantis.com/shared-content/how-to-control-vimeo/

Much more than that is possible.

Discussions have been disabled for this post