Forum Discussion

CruzRincon's avatar
CruzRincon
Community Member
9 years ago

Storyline Toggle Fullscreen Mode in Web Browser

Compatible with HTML5 compliant browsers only. Tested on Chrome 57 for Windows and Chrome for Android Nougat (Storyline 3)

Proof of concept:

https://cruzrincon.github.io/Fullscreen/story_html5.html

Instructions: Assign the following Javascript to be executed via Trigger:

if ((document.fullScreenElement && document.fullScreenElement !== null) || 
(!document.mozFullScreen && !document.webkitIsFullScreen)) {
if (document.documentElement.requestFullScreen) {
document.documentElement.requestFullScreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullScreen) {
document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.cancelFullScreen) {
document.cancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}

16 Replies

  • Thank you for this code, most helpful.  Can you advise how to add a button to leave full screen.

  • CruzRincon's avatar
    CruzRincon
    Community Member

    This code includes a toggle like behavior. It will switch in and out of the full screen state whenever assigned to a button trigger

  • Hello, any progress on that? did you manage to solve the issue on Iphones? thanks!!!

  • fabian's avatar
    fabian
    Community Member

    Would be great to have this functionality within the Modern Player Menu and if it could work on iOS. Do you know if there will be a solution from Articulate anytime soon?