Before going into this let’s first understand about HTML5 video element.
To show a video on your webpage you need to use the <video> element in the HTML.
Using <video> element in HTML you can show any video on your webpage which supports the following formats.
- WebM- an audiovisual file format
- Ogg- Open source file format for multimedia
In HTML you have two attributes that come with Video elements controls and autoplay.
Using attribute controls you can add video controls like play, pause, and volume.
And with attribute autoplay you can start your video automatically.
But if you want to add other functionality like rewind, pause, and set the duration then you can do it using DOM(Document Object Model) in HTML.
The HTML DOM elements defines methods, properties and events for the <video> element.
Rewind comes into play when you want to go back to a specific time while watching or playing your video. According to your video length, you can change this time value.
In order to do that you need to pass a parameter like param as name and then setting its value according to the length of your video.
For example, let’s suppose I give param as -7 it means when the user clicks on the rewind button he goes -7 to back to the video, or if the user gives param value as +7 he goes +7 forward to the video.
So, using this method we can rewind as well as go forward in our video.
Successfully Rewind the Video.