Mobile Launches and forceFrameset


Engine has somewhat surprising behavior when launching content on mobile devices because it will in some cases override the "SCO Launch Type" package property. This is done in order to make the SCORM player as reliable as possible in the face of a couple of issues unique to mobile environments.

The first issue is that some mobile browsers will suspend JavaScript processing in background windows and tabs. That means that configurations where the SCO and the player are in different windows (i.e., any setup where the SCO is opened in a new window) may not be reliable on all devices, because the SCORM API object is in the background player window. The result could be that API discovery fails altogether, or that SCORM API calls start failing partway through the course.

Another issue has to do with how to allow the user to safely exit the course in a way that reliably triggers an exit postback to Engine, and that's tricky to do when the SCO is launched in a frameset. We’ve seen that mobile browsers are more aggressive about window teardown, so that requests made in the onbeforeunload or onunload event handlers don’t always get a chance to complete, and that's where the final exit postback from the SCORM player is made if the window is closed while the course is still running. Exiting via the player’s "Return to LMS" navigation link is generally safer, because the final postback can be made in response to the click, before the window is closed.

The solutions to these two issues clearly conflict with one another – background JavaScript processing may be suspended, so you can’t launch the SCO in a new window; but if the SCO is in a frameset, the user may not be able to safely exit the course. Therefore, Engine makes a compromise. If it detects that the player is being launched in a mobile browser (with user-agent sniffing), it will check what the launch properties are for the package. If the SCO is to be launched in a frameset, and the player navigation bar and "Return to LMS" button are disabled, then it will force the SCO into a new window. This makes the exit behavior more reliable, but it runs the risk of the API JavaScript being suspended by the browser.

The best mobile experience, from a reliability standpoint, is achieved by launching the SCO in a frameset, with the player navigation bar and "Return to LMS" button enabled. You can do this by setting the appropriate package properties, but that means they will take effect for all launches, not just ones on mobile devices. That’s why in Engine 2013.2, we added a "forceFrameset" launch parameter, which will turn on the appropriate package properties for a single launch.

To use forceFrameset on mobile browsers, you’ll need to do some user agent sniffing at the point where you create the launch URL. Engine looks for the following strings to determine if the launch is on a mobile device, so you'll probably want to check for at least these: "android", "ipod", "iphone", "ipad", "iemobile", and "silk". If a mobile device is detected, then you just need to append "&forceFrameset=true" onto the launch URL query string.

In summary:

  • Engine will override its own settings when it detects a mobile launch if it determines that the settings would create unreliable launches in a mobile context. So, for instance, even setting frameset/frameset for player and SCO launch types won't be enough to keep content from launching in a new window on mobile.
  • Prefer to use forceFrameset when building your launch URLs to avoid forcing all content to launch in a frameset, even for desktop launches.
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request
Powered by Zendesk