Forum Discussion
TerenceEnglish
8 years agoCommunity Member
Video Rewind Button
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 ...
MathNotermans-9
4 years agoCommunity Member
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.
- ScottDalpias-cc3 years agoCommunity Member
This is working great. Is there any way to make this work for the timeline and not the video itself?
- MathNotermans-93 years agoCommunity Member
No :-) The by Laura Middlesworth mentioned solution might work on the timeline.
Jump-to-Time-article
Related Content
- 10 months ago