Slide Timeline length

Aug 05, 2019

Is there a way to dynamically "get" the length of the time line for a slide and set it to a variable in storyline 3? Im looking to have a slide countdown timer that dynamically adjusts depending on the length of the slide and counts down as the slide progresses. I know I can use the seekbar within player features to show slide timeline progression to the learner but that's not exactly what I'm looking for.

5 Replies
Snorre Rubin

You can get it by snooping in the DOM structure, with javascript. Here is the script snippet:

var timelineLength = Number(document.querySelectorAll("[data-ref=progressBar]")[0].getAttribute('aria-valuemax'));


You can use 

var player = GetPlayer();
player.SetVar('yourVar', timelineLength); 

to set it to a storyline variable.

You can also access the current location by substituting getAttribute('aria-valuemax')); with getAttribute('aria-value'));