Skip to content

Sets default video controls like speed on youtube and other videos

License

Notifications You must be signed in to change notification settings

mduppes/VideoSpeedController

Repository files navigation

VideoSpeedController

A Chrome extension that automatically sets YouTube playback speed to 1.5x on every video — including SPA navigation between videos — and updates YouTube's own speed UI so the gear menu always reflects the correct rate.

Features

  • Automatically applies your preferred speed (default 1.5x) to every YouTube video
  • Works with YouTube's single-page navigation — switching videos keeps the speed
  • Updates YouTube's built-in speed indicator (gear menu shows the correct rate)
  • Remembers the last speed you set via YouTube's own controls
  • Configurable default speed via the extension popup (0.1x – 4.0x)
  • Changes sync across devices via chrome.storage.sync

Installation

This extension is not on the Chrome Web Store — install it as an unpacked extension:

  1. Clone or download this repository
  2. Open Chrome and navigate to chrome://extensions
  3. Enable Developer mode (toggle in the top-right corner)
  4. Click Load unpacked
  5. Select the VideoSpeedController folder
  6. Open YouTube and play any video — it will start at 1.5x automatically

To update after pulling new changes, go back to chrome://extensions and click the ↺ refresh icon on the extension card.

Usage

  • Videos play at 1.5x automatically. No action needed.
  • Change your default speed: Click the extension icon in the toolbar, enter a speed between 0.1 and 4.0, and click Save. The change applies immediately to any open YouTube tabs.
  • Override per-video: Use YouTube's own gear menu (⚙ → Playback speed) as normal. Changes you make more than 10 seconds after a video loads are saved as your new default.

How it works

YouTube is a single-page application that resets video.playbackRate to 1x during its internal player initialization on every navigation. Two content scripts work together to reliably override this:

Script World Role
content-youtube-storage.js Isolated Reads/writes chrome.storage.sync, relays speed via DOM events
content-youtube-player.js Main Calls movie_player.setPlaybackRate() — YouTube's own API — so the gear menu UI updates correctly

Running the player script in the Main world is necessary because YouTube's setPlaybackRate method is added by YouTube's own JavaScript, which is not visible from Chrome's isolated content script context. It also bypasses YouTube's Trusted Types policy, which blocks inline script injection.

The extension enforces the desired speed for 10 seconds after each navigation to outlast YouTube's own async player initialization resets.

File structure

manifest.json                 # Extension manifest (Manifest V3)
background.js                 # Service worker — sets default speed on install
content-youtube-storage.js    # Isolated world — chrome.storage bridge
content-youtube-player.js     # Main world — YouTube player API calls
popup.html                    # Settings popup UI
popup.js                      # Settings popup logic
icons/                        # Extension icons (16, 48, 128px)

Requirements

  • Chrome 111 or later (for world: "MAIN" content script support)

License

MIT

About

Sets default video controls like speed on youtube and other videos

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published