Last active
August 30, 2020 01:34
-
-
Save billmei/f283d96ce74a817718d7f816d04fd471 to your computer and use it in GitHub Desktop.
Add extra speed options like 2x playback on EdX videos.
This file contains 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
// 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