onPresentationPlaybackComplete event, iSpring Pro6.2
Author | Message |
We have an issue with the onPresentationPlaybackComplete event within a modifed index.html file not firing for the AS3 Streamline player. Code: var thisPtr = this; this.m_movie.playbackController_setEventListener("playbackListener_onPresentationPlaybackComplete", "fsplayer.api.PlaybackControllerEvents.PresentationPlaybackCompleteHandlers." + this.m_id); fsplayer.api.PlaybackControllerEvents.PresentationPlaybackCompleteHandlers[this.m_id] = function() { thisPtr.onPresentationPlaybackComplete(); }; Here is my modified index.html file, that works with legacy lite player but not as3 streamline player: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>PowerPoint Presentation</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script type="text/javascript" src="js/fsplayer.js"></script> <script type="text/javascript" src="lms.js"></script> <script type="text/javascript" src="js/swfobject.js"></script> <style type="text/css" media="screen"> html, body, table, td { height: 100%; } html { background-color: #ffffff; } body { margin: 0px; } table { width: 100%; border-collapse:collapse; } td { padding: 0px; text-align: center; } </style> </head> <body> <table> <tr> <td id="movieContent"></td> </tr> </table> <script type="text/javascript"> //<!-- var loader = new fsplayer.api.PresentationLoader(); // vars var lmsType = "2004"; var debug = false; var lmsId = "lmsId"; var quizzes = []; var rateSlidesCount = 16; var rateSlidesWeight = 1; var gradeTotalScore = 100; var gradePassingScore = 100; var limitTime = 0; var limitTimeShowMessage = false; var limitTimeExit = false; var limitTimeMessage = "You have exceeded available time.\n" + (limitTimeExit ? "The lesson will be interrupted." : "You may continue the lesson."); var quizzesInfo = []; for (var i = 0; i < quizzes.length; ++i) { quizzesInfo.push({ index: quizzes[i][0], weight: quizzes[i][1] }); } if (debug) { document.write("<textarea id=\"iSpring_log\" style=\"width: 100%; height: 100px;\"></textarea><br>"); } var lmsObject; var pc = null; var thisPtr = this; loader.onPlayerInit = function(player) { lmsObject = new iSpring.LMS(thisPtr.lmsId, thisPtr.lmsType, player, thisPtr.limitTime, thisPtr.limitTimeExit, thisPtr.limitTimeShowMessage, thisPtr.limitTimeMessage, thisPtr.quizzesInfo, thisPtr.rateSlidesWeight, thisPtr.rateSlidesCount, thisPtr.gradeTotalScore, thisPtr.gradePassingScore); window.onunload = function() { lmsObject.closeLms(); } window.onbeforeunload = function() { lmsObject.closeLms(); } pc = player.getPlaybackController(); pc.enableAllEventHandlers(); pc.onPresentationPlaybackComplete = playbackComplete; } loader.load("movie.swf", "movieContent", "newPlayerId", "722", "577"); // function to handle playbackComplete event - D Forrest 29/3/12 function playbackComplete() { // get all anchor tags anchors = parent.document.getElementsByTagName("a"); var discoveredLink = ""; // look through anchor tags, look for exit link for(i=0; i < anchors.length; i++) { if(anchors[i].title == "Exit activity") { // found exit link so get href discoveredLink = anchors[i].href; } } // if we found the link if(discoveredLink.length > 0) { // forward on browser parent.location.href = discoveredLink; } else { alert("Please click the 'Exit activity' link to return to the course menu."); } } // aicc function aiccDataFrameLoaded() { document.getElementById("aiccFrameLoaded").value = "1"; } //--> </script> <input type="hidden" id="aiccFrameLoaded" name="aiccFrameLoaded" value="0" /> <iframe id="aiccDataFrame" name="aiccDataFrame" src="empty.html" style="width:1px;height:1px;border:0px" onload="aiccDataFrameLoaded();"></iframe> <iframe id="target_frame" name="target_frame" src="empty.html" style="width:1px;height:1px;border:0px"></iframe> <iframe id="emptyFrame" name="emptyFrame" src="empty.html" style="width:1px;height:1px;border:0px"></iframe> <form id="aiccDataForm" name="aiccDataForm" method="POST" action="empty.html" target="aiccDataFrame"> <input type="hidden" id="session_id" name="session_id" value=""> <input type="hidden" id="command" name="command" value=""> <input type="hidden" id="version" name="version" value="4"> <input type="hidden" id="aicc_data" name="aicc_data" value=""> </form> </body> </html> Just to note: We are not trying this locally, it's on a server AND we HAVE ticked the 'Enable interaction with Javascript' option while publishing!! Do I need to adjust my code for the AS3 Streamline player? Or, is the AS3 player wired differently, in which case, do iSpring need to modify the fsplayer.js event wirings? Thanks in advance. Dave
|
There is a difference in how this onPresentationComplete event is generated in AS2 and AS3. On the last slide when last animation is completed onPresentationComplete is broadcasted in AS2 immediately, while in AS3 a user should click play button again to end the show and generate this event.
|
Thanks Mikhail,
|
Great solution! Thank you for sharing it here.
|
||||
|
Who is online | |
---|---|
![]() |
In total there are 9 users online :: 1 registered, 0 hidden and 8 guests (based on users active over the past 5 minutes) Most users ever online was 803 on Sat Dec 12, 2020 9:21 am Registered users: Bing [Bot] |