Twitch - Toggle Video Quality

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

Autor
Vikindor
Denně instalací
0
Celkem instalací
3
Hodnocení
0 0 0
Verze
1.0.0
Vytvořeno
14. 02. 2026
Aktualizováno
14. 02. 2026
Size
7,5 KB
Licence
MIT
Spustit na

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.