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
There is no known method to do what you want.
Adding more cue points to do this wouldn't hurt your current cue points, but there is no trigger that will jump to certain point in the timeline.
As an alternative solution, if you know an html5 player with these capability, maybe you could embed it in a web object.
HI
I wonder if there is in general an option to go back and forth in a video player? so far I can only Play/Pause. But what if I want to go a few seconds back?
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.
Hi Math,
Thanks for your valuable help.
I have one query regarding above Javascript. Its work only for single slide. If in my module there are multiple videos then its not working.
Can you please check. Its helpful for me to solve the issue.
Thanks in advance
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 collection...as 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 slide...you need to use similar script on that slide to act on it.
Hope this is clear and helps...if not...share a sample.
Thank you Math for quick help. it's work.
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.
Hi Kevin,
I replied to a similar post of yours, here!
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.
Hi Laura,
Thank you for sharing what worked for you! I'm sure others in the community will find this helpful.
This is working great. Is there any way to make this work for the timeline and not the video itself?
No :-) The by Laura Middlesworth mentioned solution might work on the timeline.
Jump-to-Time-article