Created
September 9, 2020 13:29
-
-
Save umkasanki/4de84edb0c69b67a5b2cbc3887ccecb9 to your computer and use it in GitHub Desktop.
change video speed
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 vid = document.getElementById("video1"); | |
function slowPlaySpeed() { | |
vid.playbackRate = 0.5; | |
} | |
function normalPlaySpeed() { | |
vid.playbackRate = 1; | |
} | |
function fastPlaySpeed() { | |
vid.playbackRate = '2'; | |
} | |
document.getElementById('slowPlaySpeed').addEventListener('click', () => { | |
console.log('run slowPlaySpeed'); | |
slowPlaySpeed(); | |
}); | |
document.getElementById('normalPlaySpeed').addEventListener('click', () => { | |
console.log('run normalPlaySpeed'); | |
normalPlaySpeed(); | |
}); | |
document.getElementById('fastPlaySpeed').addEventListener('click', () => { | |
console.log('run fastPlaySpeed'); | |
fastPlaySpeed(); | |
}); | |
// <button id="slowPlaySpeed">slowPlaySpeed</button> | |
// <button id="normalPlaySpeed">normalPlaySpeed</button> | |
// <button id="fastPlaySpeed">fastPlaySpeed</button> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment