Skip to content

Instantly share code, notes, and snippets.

@billmei
Last active August 30, 2020 01:34
Show Gist options
  • Save billmei/f283d96ce74a817718d7f816d04fd471 to your computer and use it in GitHub Desktop.
Save billmei/f283d96ce74a817718d7f816d04fd471 to your computer and use it in GitHub Desktop.
Add extra speed options like 2x playback on EdX videos.
// In the new EdX, a redirect is required to go inside the iframe before executing custom JavaScript
open(document.getElementById('unit-iframe').src)
// After the new tab is opened, you can run the code below in that tab (not the old tab).
// To use, paste into your DevTools console, create a bookmarklet, or use a browser extension like Tampermonkey.
const addSpeedOption = (speed) =>
$('.video-speeds').prepend(`<li data-speed="${speed}"><button class="control speed-option" tabindex="-1" aria-pressed="false">${speed}x</button></li>`)
addSpeedOption(2);
addSpeedOption(2.5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment