Twitch - Toggle Video Quality

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

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

Autore
Vikindor
Installazioni giornaliere
1
Installazioni totali
3
Valutazione
0 0 0
Versione
1.0.0
Creato il
14/02/2026
Aggiornato il
14/02/2026
Dimensione
7,54 KB
Licenza
MIT
Applica a

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.