Skip to content

Instantly share code, notes, and snippets.

@dzeez
Last active June 12, 2022 18:29
Show Gist options
  • Save dzeez/89a57ca1e379d77399a4008fcdacfb95 to your computer and use it in GitHub Desktop.
Save dzeez/89a57ca1e379d77399a4008fcdacfb95 to your computer and use it in GitHub Desktop.
html5 video/media playback speedup bookmarklet source (set to 1.8x; easily changeable)

Browser media playback speedup bookmarklet

Tihs javascript snippet, when used as a bookmarklet, will attempt to speed up playback of all media elements (video, audio) by changing the playbackRate property to 1.8. This rate can easily be modified to suit your preference (if you've already "installed" the bookmarklet, right click it and select edit; look for the 1.8 and change it). The easiest way to "install" it is to drag the link below to your browser's bookmarks bar.

Drag this to your bookmarks bar to create bookmarklet

Actually, this won't work here from a gist. Have to setup GH page. In the meantime, copy the code from the code block below, bookmark this page, then edit the bookmark and paste in the code you copied to replace the destination URL.

[Video++](javascript:void function(){try{document.querySelectorAll("video, audio").forEach(e => e.playbackRate=1.8);console.log("media playbackRate modified, hopefully")}catch(a){console.error("Error changing playbackRate. Is there media on this page%3F","("+a+")")}}();)

Code

javascript:void function () { 
    try { 
        document.querySelectorAll("video, audio").forEach(e => e.playbackRate = 1.8); 
        console.log("media playbackRate modified, hopefully") 
    } catch (a) { 
        console.error("Error changing playbackRate. Is there media on this page%3F", "(" + a + ")") 
    }
}();

Other bookmarklets

javascript:
void function () {
try {
document.querySelectorAll("video, audio").forEach(e => e.playbackRate = 1.8);
console.log("media playbackRate set to 1.8, hopefully")
} catch (a) {
console.error("Error changing playbackRate. Is there media on this page%3F", "(" + a + ")")
}
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment