Twitch - Toggle Video Quality

Adds a customizable button to toggle stream quality (lowest <-> preferred) with optional auto-mute

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Skaber
Vikindor
Daglige installationer
1
Installationer i alt
3
Bedømmelser
0 0 0
Version
1.0.0
Oprettet
14.02.2026
Opdateret
14.02.2026
Size
7,54 kB
Licens
MIT
Gælder for

Twitch - Toggle Video Quality

Userscript that adds a configurable button to Twitch for quickly switching stream quality between the lowest available (with optional automatic muting) and a preferred resolution (e.g., 1080p).

Designed for users who want fast quality control without opening the player settings menu.

✨ Features

  • Toggle between lowest available quality and your preferred resolution.
  • Automatically falls back to the highest available resolution if the preferred one is not present.
  • Optional auto-mute when switching to lowest quality.
  • Optional persistent selection (quality and mute status survive page reload).
  • Two UI modes:
    • Minimal -- small Q button inside player controls.
    • Header -- purple "Quality" button in the channel header (next to "Subscribe").
  • Uses Twitch's internal player API (no UI clicking).
  • Fully client-side. No external dependencies.

🖼 Screenshots

Header button

Header button screenshot

Minimal button

Minimal button screenshot

🔧 Configuration

Inside the script:

const PREFERRED_HIGH = 1080;      // Preferred resolution (e.g., 1080). Falls back if unavailable.
const MUTE_ON_LOW = true;         // Automatically mute when switching to lowest quality.
const PERSIST_SELECTION = true;   // Persist quality + mute across page reload.
const VISUAL_MODE = 'header';     // 'minimal' or 'header'

⚙ How it works (High-Level)

  • Accesses Twitch's internal React player instance.
  • Uses native methods:
    • setQuality()
    • getQualities()
    • setMuted()
  • Selects lowest quality by bitrate.
  • Selects preferred resolution by matching height (e.g., 1080).
  • Synchronizes state with Twitch's own localStorage keys:
    • video-quality
    • video-muted
  • Restores mute state after player initialization.

No UI automation. No simulated clicks.