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

This discussion is closed. You can start a new discussion or contact Articulate Support.