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

bcalhoun4409
Community Member Posts: 3 ☆ Roadie ☆
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?
Comments
-
wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 665 eLearning ROCKSTAR Admin TeamThis 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 -> RunJavaScriptgetDisplayWindow().vimeoVideo1 = %HTMLNAME%;
Action -> On Hide -> RunJavaScripttriv$('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 -
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.
Categories
- 35.8K All Categories
- 108 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 28.9K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 22 ELB Learning Content
- 22 ELB Learning Content Discussions
- 321 CenarioVR®
- 188 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 41 Rockstar Learning Platform®
- 38 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 5 The Training Arcade®
- 5 The Training Arcade Discussions
- 934 All Things eLearning
- 36 eLearning Development
- 546 Learning Management System (LMS) Integration
- 332 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products