Skip to main content
Known Participant
February 6, 2016
Question

End of video

  • February 6, 2016
  • 2 replies
  • 2729 views

I want to prompt interactivity when video file is finished. As it is, the video just stays on the last frame and users don't know it's finished or could be just buffering or paused. Video length in seconds is not a reliable method because of differences in platforms. Can't Captivate pick up end of video as an event I can use to trigger an action?

    This topic has been closed for replies.

    2 replies

    TLCMediaDesign
    Inspiring
    February 6, 2016

    We have abandoned video using the options in Captivate, and using YouTube as a delivery platform also.

    Our approach is to create HTML5 pages and inserting into Captivate as HTML5 animations. Video then uses the native browser playbar with fullscreen functionality and closed-captioning using vtt or injecting the CC into CP's closed captioning format.

    You can then use the video events built into the browser and control your CP course.

    Known Participant
    February 6, 2016

    This sounds interesting. Can you share an example or sample slide so I can

    see the detail for how you implemented this?

    Thanks so much,

    Jeff

    On Sat, Feb 6, 2016 at 2:42 AM, TLCMediaDesign <forums_noreply@adobe.com>

    TLCMediaDesign
    Inspiring
    February 6, 2016

    Here is a simple implementation. Save this html file as the exact same name as your video (mp4), do not use spaces in either name. Zip them both together and insert as an HTML5 Animation. This is set up for 480p (854 x 480). Resize the animation in Captivate to the video size and turn off scrolling.

    For example:

    myVideo.html

    myVideo.mp4

    The line: wp.cp.show("Text_Caption_1"); designates what should happen when the video is done. In this case it shows Text_Caption_1. Showing will only work for HTML5. You could alert something also.

    <!doctype html>
    <html>
    <head>
    <meta charset= "utf-8">
    <title>Video</title>
    <script>
    var wp = window.parent;

    function loadVideo()
    {
        var url = decodeURIComponent( window.location.pathname );
    var filename = url.substring( url.lastIndexOf( '/' ) + 1 );
    var n = filename.lastIndexOf( '.' );   
    var vid = filename.substr( 0, n ) + '.mp4';
    var setSrc = document.getElementById( "myVideo" ).src = vid;

    myVid = document.getElementById( 'myVideo' );
    myVid.addEventListener( 'ended', videoEnd, false);
    }

    function videoEnd( e )
    {
    wp.cp.show("Your text caption prompt");
    myVid.removeEventListener( 'ended', videoEnd, false );
    }

    function clearAll()
    {
    myVid.removeEventListener( 'ended', videoEnd, false );
    wp = null, myVid = null;
    }

    </script>
    </head>

    <body style="margin:0 0 0 0" onload="loadVideo();" onUnload="clearAll();">
    <video id="myVideo" src="" controls autoplay preload="none" width="854" height="480"></video>
    </body>
    </html>

    RodWard
    Community Expert
    Community Expert
    February 6, 2016

    Not at the moment no.  End of a video is not a usable event to trigger actions.

    f_master_s
    Participant
    May 5, 2016

    This was brought up over 2 years ago and Adobe still hasn't implemented what should be a STANDARD feature of a built in event listener for the end of the video.  How can they think this wouldn't be useful?

    Lilybiri
    Legend
    May 5, 2016

    Did you log a feature request?