Created
April 10, 2018 00:27
-
-
Save hackmods/a929685294fc976eef94aee1a9f5191b to your computer and use it in GitHub Desktop.
Control HTML5 Video playback speed and volume by VIDEO element
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<video width="444" controls> | |
<source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4"> | |
<source src="https://www.w3schools.com/html/mov_bbb.ogg" type="video/ogg"> | |
Your browser does not support HTML5 video. | |
</video> | |
<script> | |
//Iterate through all elements to find video tags, then speed up the play rate and lower the volume. | |
Array.prototype.slice.call(document.all).forEach(element => element.tagName === "VIDEO" && (element.playbackRate = 2.5) && (element.volume = 0.5)) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inspired from here: https://www.reddit.com/r/programming/comments/8astog/berkeley_offers_its_fastestgrowing_course_data/dx2bedl/. I plan to work this into a chrome extension (on GitHub) in the near future.