Last active
April 7, 2020 16:19
-
-
Save teimur8/57c1dceb32a712253ded5a38900e98e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var player = document.querySelector('video'); | |
| var options = { | |
| start:0, | |
| end: 10000000, | |
| } | |
| player.addEventListener('timeupdate', (e)=>{ | |
| if(player.currentTime > options.end){ | |
| player.currentTime = options.start; | |
| } | |
| if(Math.round(player.currentTime) % 5 === 0){ | |
| console.log(Math.round(player.currentTime)); | |
| } | |
| }); | |
| playerSet = (_start,_end) => { | |
| player.currentTime = _start; | |
| options.end = _end; | |
| options.start = _start; | |
| player.play(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment