Video Rewind Button

Feb 02, 2018

I am developing a portal to watch a very long video. Is there a Java script that I can add to a button that will "rewind" the video, say 15 seconds from the point that the button is depressed? I am trying to avoid using cue points to do so because I have cue points set-up for another task.

Another way to go, would be if the seekbar is able to be dragged backwards only. Currently, as I understand it, it is "read only" or draggable forward and back. Is it possible to finagle the seekbar to be draggable backwards only?

Any help is greatly appreciated. Thanks All...

13 Replies
Math Notermans

Basically this should work...
var myvideo = document.getElementsByTagName("video")[0];
myvideo.currentTime = 7;
So these lines of code make your video jump to the specified time.
To make the code jump back a specified duration you first need to get the actual currentTime like this...

var myvideo = document.getElementsByTagName("video")[0];
var currentTime = myvideo.currentTime;
var duration = 2;

myvideo.currentTime = currentTime-duration;

Just tested it and this works.

Math Notermans

This line will get all videos on a slide...

var allVideos = document.getElementsByTagName("video");

So when you have multiple videos on a slide you can either do this...

var firstvideo = document.getElementsByTagName("video")[0];
var secondvideo = document.getElementsByTagName("video")[1];

where the number between the brackets refers to your separate videos..
Do notice its zero-based as is quite normal with arrays and things like that.
... or use a similar notation on your allVideos you already gathered all
videos inthere...

var videotoActUpon = allVideos[3];

This way you can trigger any video on a slide...If the video is on another need to use similar script on that slide to act on it.

Hope this is clear and helps...if not...share a sample.

Kevin Heald

There should be default support in Storyline for rewinding a video to the beginning and/or a set time. It could either be a trigger or an option on the Video Tools Options bar. Currently when a video plays and completes it sits on the last frame, be nice to have an easy way to send it back to the beginning without user intervention.

Laura Middlesworth

Posting a link to the article on Jump-to-Time Trigger for anyone else who also happens to be searching for options to add a "rewind X seconds" button to a slide. Initially, I went down the Javascript path based on search results for adding video rewind capabilities in Storyline 360 BUT playing with variables and triggers unearthed this variation on "Jump to time / cue point" trigger that I had not used before - and then I knew what to search for here on E-Learning Heroes to get more details.

For my project, adding a button to the slide with a trigger of "Jump backwards by 15s on this slide" when the user clicks is a far more simple way of rewinding the slide / video vs. using Javascript, particularly because I have to pass the files along to the client at the end for later use. Sharing in case anyone else is searching for similar functionality and coming across posts that pre-date the release of this trigger option.