Forum Discussion
'Continue' block completion with embedded video
I'd like to propose an alternative approach involving the use of a Kaltura Playlist. This might seem a bit complex at first, but I believe it could be a safer option than a time-based approach.
Imagine having two videos in a Kaltura Playlist: the first video contains the content, and the second video indicates that "this video has completed". The videos would have the seek function disabled and their players hidden. These videos could then be added to the 'Play: My Videos' section in Storyline.
The Kaltura Playlist could then be shared and embedded. By editing the iframe, we could control what is displayed. For instance, we could use the [ nextPrevBtn.plugin ] and Right {Playlist ]. There seem to be numerous customisable options in the iframe code. One of these must hide the other videos so the learner can jump to the final video?
With this setup, we would have an iframe containing two videos that can't be fast-forwarded. The only way to access the second video would be to watch the first one. As each video progresses, the URL in the playlist changes.
We could then use JavaScript in Storyline to monitor the URL in the iframe and change a variable. This would allow us to unlock the 'next' button via a variable when the playlist completes.
Here's a sample JavaScript code:
var iframe = document.createElement('iframe');
var url = "https://kaltura.com/playlist/dedicated/5_71op61/9_jaysta5y";
iframe.src = url;
document.body.appendChild(iframe);
var oldPath = url.split('/').pop();
iframe.onload = function() {
var newPath = iframe.contentWindow.location.href.split('/').pop();
if (newPath !== oldPath) {
oldPath = newPath;
// Change your variable here
}
};
Althought I must admit that the JavaScript code provided assumes that the iframe's content (the Kaltura Playlist) is on the same domain as the parent page (the Storyline course). If they are not on the same domain, the same-origin policy will prevent the JavaScript from accessing the iframe's contentWindow.location.href due to security reasons which could be an issue?
Could this approach work for your needs? I'd appreciate any feedback or suggestions.
Related Content
- 7 months ago
- 9 months ago
- 4 months ago