Greasy Fork is available in English.
Adds a float input box to adjust playback speed on YouTube after 2 seconds of user input
This userscript is designed to enhance the YouTube user experience by adding a float input box near the like button, allowing users to adjust the video playback speed easily. It waits 2 seconds after user input to apply the playback speed change to avoid unintended rapid adjustments.
https://www.youtube.com/*).1.064 when the page loads.0.1 to 2 in steps of 0.1.0.1 to 2.MutationObserver to ensure the float input box is added dynamically, even when navigating between different videos on YouTube.let playbackTimer;
const defaultSpeed = 1.064;
playbackTimer: A variable to manage the delay timer for setting the playback speed.defaultSpeed: The initial playback speed value, set to 1.064.function addFloatInputBox() {
const likeButtonContainer = document.querySelector('#top-level-buttons-computed');
// Logic for creating and styling the input box
}
likeButtonContainer exists. This container is where the float input box will be inserted.input element is created with type number, step size 0.1, and a default value of 1.064.0.1 and 2, adjusting the value if it falls outside this range.const video = document.querySelector('video');
if (video) {
video.playbackRate = defaultSpeed;
}
1.064 when the page loads.const observer = new MutationObserver((mutations) => {
mutations.forEach(() => {
addFloatInputBox();
});
});
observer.observe(document.body, { childList: true, subtree: true });
addFloatInputBox();
This script significantly improves the way users interact with YouTube's playback speed settings, offering a more intuitive and responsive control directly within the video player interface.