Forum Discussion
BenjaminBaris
2 years agoCommunity Member
Trying to change storyline variable from Web Object
I currently have a video web object embedded into my storyline slide. I have a javascript code in the web object's HTML that detects when the video is finished. I have tested this in the browser out...
SamHill
2 years agoSuper Hero
Hi Benjamin, you can use the Storyline player API to set a variable.
Firstly, define your boolean variable in Storyline that will change to TRUE once the video is complete, for example "videoComplete"
Within your WebObject you would do something like this.
player.on('ended', function () {
// Get a reference to the Storyline player
const slPlayer = window.parent.GetPlayer();
// User the SetVar method to set the Storyline defined
// variable. Note: You can also use GetVar to get the
// value of a variable from Storyline
slPlayer.SetVar("videoComplete", true);
});
Related Content
- 10 months ago
- 10 months ago
- 10 months ago
- 10 months ago