Last active
April 3, 2019 11:44
-
-
Save edgabaldi/e09a47e83ad3980286e776d310ee1543 to your computer and use it in GitHub Desktop.
change video speed
This file contains 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
class VideoSpeed { | |
constructor(){ | |
this.video = document.getElementsByTagName("video").video | |
} | |
speed = () => { | |
return this.video.playbackRate | |
} | |
set_speed = speed => { | |
this.video.playbackRate = speed | |
} | |
reset_speed = () => { | |
this.video.playbackRate = 1 | |
} | |
} | |
let v = new VideoSpeed("video") | |
v.set_speed(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment