Explore the community Forums Lectora Lectora Questions & Answers How to stop an embedded Vimeo video when you hide the object

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #428509 Score: 0
    Profile photo of Brenda Calhoun
    Brenda Calhoun
    Member
    beginner
    intermediate
    LUC17 Attendee
    curious george
    @bcalhoun4409

    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?

    #428580 Score: 0
    Profile photo of Joe Wieloch
    Joe Wieloch
    Moderator
    beginner
    intermediate
    friend finder
    contributor
    LUC16 Attendee
    verified member
    wise owl
    LUC17 Attendee
    advanced
    picture perfect
    53 pts
    @wheels

    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

    #428608 Score: 1
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    321 pts
    @timk

    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.

    This post has received 1 vote up.
    #428631 Score: 0
    Profile photo of Joe Wieloch
    Joe Wieloch
    Moderator
    beginner
    intermediate
    friend finder
    contributor
    LUC16 Attendee
    verified member
    wise owl
    LUC17 Attendee
    advanced
    picture perfect
    53 pts
    @wheels

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

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.