Monitor JWPLayer video as Web Object complete

Okay, so I have changed from YouTube to JWPlayer now and have pretty much the same question as here. What is annoying about this is that this methodology below has worked in the past but it does not work now.

So I have this code within an HTML page in a folder that contains my video, JWPlayer bits & bobs, and is linked via WebObject. All cool and dandy:

jwplayer().on('play', function(e) {
var player = window.parent.GetPlayer();
player.SetVar("zJWP_Completed", "false");
player.SetVar("zJWP_Started", "true");
});
jwplayer().on('complete', function(e) {

var player = window.parent.GetPlayer();
player.SetVar("zJWP_Completed", "true");
player.SetVar("zJWP_Started", "false");
});
function playVideo(){
playerInstance.play(true);
}

I have triggers on my WebObject slides that monitor the zJWP_Completed and zJWP_Started variables as one can see in this screenshot.

 

The CLOSE button over the video (the white X) has a PROMPT state which displays a message to move on.

When the video completes the two variables toggle TRUE or FALSE.

The following screenshots show that the module does in fact record the variables changing from within the JWPlayer and that the changes are monitored within Storyline.

 START:Start

 COMPLETE:Complete

But, as one can see, whilst the variable changes, the TRIGGER doesn't implement the zJWP_Completed trigger change. I then tried to see if the variables could affect another variable (called PROMPT) but that too failed to trigger.

So it seems that Storyline does see the JWPlayer triggers being toggled they have no impact on any Storyline triggers or variables within the module other than themselves.

Does anyone have any similar experience and/or solutions to this issue? I'd love to just rely on the inbuilt player but the client insists on the JWPlayer methodology. Apparently, no one has noticed this as an issue till now.

4 Replies
Diarmaid Collins

The ever-brilliant Matt Bibby got in touch and let me know that if I simply removed the inverted commas around the instances of the words TRUE and FALSE in my code the thing should work, and it does!

jwplayer().on('play', function(e) {
var player = window.parent.GetPlayer();
player.SetVar("zJWP_Completed", false);
player.SetVar("zJWP_Started", true);
});
jwplayer().on('complete', function(e) {

var player = window.parent.GetPlayer();
player.SetVar("zJWP_Completed", true);
player.SetVar("zJWP_Started", false);
});
function playVideo(){
playerInstance.play(true);
}

With inverted commas, Storyline sees a string. Without, it sees a True/False variable. So now you know.

No, don't ask me what a string is. I think there's a theory about that.