Created
January 20, 2022 18:05
-
-
Save LinqLover/884c40e6dc8f068048fc266b988fc2b5 to your computer and use it in GitHub Desktop.
Bookmarklet: Custom playback rate for tele-task
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
/** Create a bookmark and enter the contents of this script as target | |
* Click the bookmark to customize the playback rate of the Tele-task video in the current tab */ | |
javascript:(function() { | |
const videoPlayer = $($("video-player")[0].shadowRoot); | |
const videos = videoPlayer.children("#video-player-container").find("video-stream").map((i, s) => $(s.shadowRoot).children().find("video")[0]); | |
const speedControl = $($(videoPlayer.children("#video-player-container").find("#control-bar")[0].shadowRoot).children().find("speed-control")[0].shadowRoot); | |
const speedControlSelect = $(speedControl.children("#container__speed_control").find("select-control")[0].shadowRoot); | |
const speedSelectButton = speedControlSelect.children().find("#button__select"); | |
let speed = videos[0].playbackRate; | |
const response = prompt("Custom tele-task speed", speed); | |
if (!response) { return; } | |
speed = parseFloat(response); | |
videos.map((i, v) => v.playbackRate = speed); | |
speedSelectButton.attr("badge-value", speed.toFixed(1) + "x"); | |
speedControlSelect.children().find("#dropdown__select").children().find("a").removeClass("active selected"); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment