youtube as embed object...need a done playing action to work!
June 10, 2016 12:00 AM
Has anyone figured out how to read when an embedded youtube video is done playing?
I had to use the youTube embed code (vs streaming using the "Share" website address- videos wouldn't play on my company's computers) for some videos in a module, which I published to html. Ultimately, however, the course will be house in an LMS.
I inserted the embed code as an External HTML object as a Custom DIV. Problem is, my "On Done Playing" action doesn't work, since the video is embedded (it worked just fine when I streamed the video).
Any ideas on how Lectora can tell when an embedded video is done playing? And how I can retrieve and use that data? I would like to direct the user to a new page when the video has reached the end (even if they scrolled to the end). Help!
Discussion (10)
Live demo: http://intea.lv/files/youtube/index.html
Source files attached. All you have to do is look inside the Ext HTML Object and replace the "action63" with your own action name that you need to fire. And of course, replace the video URL.
Let me know if you need anything else :)

I reported this issue after LUC and I'm happy to say a fix should be coming out in the next release :)
That the "on done" doesn't trigger once a YouTube video is done playing using native actions.
> I reported this issue after LUC and I’m happy to say a fix should be coming out in the next release :)
What issue?
Well, I couldn't get mine to work....where you have action63.....how do I use that value? I can't figure out where in Lectora I put "action63" to be read/where that name is retrieved from in your title. I'm a little slow when it comes to code. :/
In the interim, I just set the video to autoreplay, with a note up front that the video is set to replay. This was the only way that I could figure out how to not show that final youtube page where users could continue viewing other videos.

"action63" is the HTML name of the action you want to fire at the end of the video. To view the HTML name of an action (or any object in Lectora), select the object, go to Properties tab, click the little "expand" arrow in the bottom left corner in the first section (official guide from Trivantis). Screenshot:
Also, according to that URL that you've shared, you can add ?rel=0 to your video URL to disable display of related video thumbnails at the end of the video. Is this what you wanted?
I found some data online.....that's how I figured out those parameters..fyi. Thought I would share for you non-developers!
https://developers.google.com/youtube/player_parameters
@ssneg You. Are. A. Genius.
It worked! I copied and pasted your assets, made a couple of tweaks (didn't want full screen, had to change width and height)...and voila! This is why I love this Community site. Thank you. Thank you. THANK YOU!!!! You saved the day, once again. :)
Discussions have been disabled for this post