Use JavaScript to make Storyline skip an HTML5 video in Firefox
Mar 28, 2015
Hi,
As Firefox does not seem to be able to show videos in HTML5-mode I am trying to make Storyline (1) skip a video in the HTML5 version if the user is running Firefox. I think this should be possible to accomplish using JavaScript, by setting a variable in story_html5.html, and then letting a JavaScript trigger inside Storyline detect that variable and check if the user agent is running Firefox, and then use that information to make Storyline skip the video. But alas I am not a JavaScript expert, and I just can't seem to get it to work.
-EDIT- I managed to get it to work. This is the code I used:
In story_html5.html
<script>
var HTML5spelaren = true;
</script>
The trigger inside Storyline
var player=GetPlayer();
if(navigator.userAgent.indexOf("Firefox") != -1 && player.GetVar("HTML5spelaren") != "yes")
{
var slVariable=player.GetVar("HTML5spelaren");
if(window.parent.HTML5spelaren) {
var variable1 = "yes";
player.SetVar("story_html5",variable1);
}
}
I then use the "story_html5" variable to skip the video.
3 Replies
Hi Andreas,
Thanks for sharing some information here in regards to the Javascript, but I did also want to point out that Storyline doesn't support HTML5 in Firefox as detailed here in our system requirements.
Thank you for your reply, Ashley.
Yes I read that Firefox's HTML5 capabilities apparently are limited, which is unfortunate. Thankfully I have found workarounds for most of the HTML5-problems I have encountered, and now both versions of the course are running quite well on both Firefox and IE.
Awesome - happy to hear it Andreas and feel free to let us know if you need anything else.
This discussion is closed. You can start a new discussion or contact Articulate Support.