Store current timeline value

Apr 19, 2016

Hi all,

I need to note when the user pauses a video. To do this, I'd like to store this value (e.g. 45 seconds) in a variable that can be then be read in a JavaScript.

I know how to read the variable in JavaScript, but is it possible get the current timeline value and store it in a variable?



13 Replies
Christie Pollick

Hi, Roger -- Thanks for reaching out with your question! Do you have a file started that you might be able to share to help illustrate what you have in mind? And as you mentioned utilizing JavaScript, I wanted to note that is not something for which we'd be able to provide support, so we'd need to defer to your fellow community members to assist you further. 

Roger J

Sorry I'd have to create a file which I can do - but let me please ask this another way removing JavaScript from the question for simplicity.

If someone clicks on a video that is playing, how can I get the number of seconds the video has been playing for use in say a trigger, or storing in a variable?

The user may pause the video, or rewind it. But anytime they click on the running video, I'd like to know when in the video they clicked. For example, the user clicked 23 seconds into the video and store that in a StoryLine variable.


Roger J

Thanks Richard. I may be asking for something beyond what StoryLine can do. All I really need is a way to get where (timewise) in the video a user is when they click the video. I guess this property is not exposed.

I want to this value because we are trying to create some interactive video with hotspots. Knowing when the user recognizes a change in the video scene is important.

Richard Hill

um you possibly don't need to know the numbers....

The above link was done with video on the base layer and a series of hotspots and drag interactions just stopped at key points in the storyline automatically.  You can adjust the  entry and exit time a hotspot is on your main timeline by just grabbing the ends( ).  If you move the playhead to specific points on the base layer, your video will show you what frame its on.   I imported mine in mp4s to my base layer , and removed the seekbar.  The only trick is that you will have to place and lock a rectangle with formatted color to transparent over your video( or it will alternate play and stop with every click on it- independent of the timeline)  If you want your video to stop, your hotspot could do that, but in principle most scenarios could use this technique (no javascript necessary)

Michael Hinze

If you do need/want a time value, you can use a looped offstage animation with a 1 sec-long motionpath. Whenever the motion path completes, a variable is incremented. The variable value represents the playhead's position on the timeline. See this quick example here .I left the 'offstage' object (blue rectangle) in the viewable screen area so that you can see the animation looping. It only takes a handful of triggers to make this work.