Skip to content

Instantly share code, notes, and snippets.

@edgabaldi
Last active April 3, 2019 11:44
Show Gist options
  • Save edgabaldi/e09a47e83ad3980286e776d310ee1543 to your computer and use it in GitHub Desktop.
Save edgabaldi/e09a47e83ad3980286e776d310ee1543 to your computer and use it in GitHub Desktop.
change video speed
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