YouTube Playback (XInput)

Xbox controller playback for YouTube with hold-to-repeat

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!)

Advertisement:

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!)

Advertisement:

Autore
kidpoleon
Installazioni giornaliere
0
Installazioni totali
1
Valutazione
0 0 0
Versione
1.0
Creato il
16/06/2026
Aggiornato il
16/06/2026
Dimensione
9,88 KB
Licenza
MIT
Applica a

YouTube Playback (XInput)

Description

Advanced Xbox controller support for YouTube with hold-to-repeat functionality. Control YouTube playback using your gamepad with precise seek, volume, and navigation controls.

Features

  • Full Controller Support: Maps Xbox controller buttons to YouTube playback controls
  • Hold-to-Repeat: Hold directional buttons and triggers for continuous action
  • Focus Detection: Only responds to input when YouTube tab is active and focused
  • Volume Overlay: D-Pad volume controls show YouTube's native volume overlay
  • Frame-by-Frame: Precise frame stepping using LT/RT triggers
  • Quick Access: Toggle fullscreen, comments sidebar, and stats for nerds

Controller Mapping

Face Buttons

  • A: Play/Pause
  • B: Toggle Subtitles (Closed Captions)
  • X: Mute/Unmute
  • Y: Toggle Fullscreen

D-Pad

  • Up: Volume Up (+5%) - Shows overlay
  • Down: Volume Down (-5%) - Shows overlay
  • Left: Seek Backward 5 seconds
  • Right: Seek Forward 5 seconds

Shoulder Buttons

  • LB: Seek Backward 1 second (hold-to-repeat)
  • RB: Seek Forward 1 second (hold-to-repeat)

Triggers

  • LT: Frame Backward (auto-pauses, hold-to-repeat)
  • RT: Frame Forward (auto-pauses, hold-to-repeat)

Center Buttons

  • Select: Previous Video / Previous in Playlist (Shift+P)
  • Start: Next Video / Next in Playlist (Shift+N)

Thumbsticks

  • L3 (Left Stick Click): Toggle Picture-in-Picture
  • R3 (Right Stick Click): Toggle Comment Sidebar (fullscreen mode)

Technical Details

  • Hold-to-Repeat: 400ms initial delay, 100ms repeat rate (10 actions/second)
  • Focus Protection: Uses document.hasFocus() and visibilityState API
  • No Permissions: Runs entirely within page context
  • Performance: Uses requestAnimationFrame for efficient polling
  • Playlist Support: Works with YouTube playlists and mixes using native keyboard shortcuts

Browser Compatibility

This script has been tested and optimized for Firefox (Gecko). While it may work on other browsers, functionality on Chromium-based or WebKit-based browsers is not guaranteed.

Requirements

  • Modern browser with Gamepad API support
  • Xbox controller (XInput compatible)
  • Userscript manager (Tampermonkey, Greasemonkey, Violentmonkey, etc.)

Installation

  1. Install a userscript manager extension
  2. Click "Install this script" on GreasyFork
  3. Connect your Xbox controller
  4. Navigate to YouTube and start using

Notes

  • Controller input is ignored when YouTube is running in background tabs
  • Frame stepping automatically pauses the video
  • Comment sidebar toggle works in fullscreen mode on modern YouTube layout
  • START button navigates to next video or next in playlist
  • SELECT button navigates to previous video or previous in playlist
  • Fullscreen toggle works without requiring mouse interaction with video area
  • Picture-in-Picture toggle uses HTML5 PiP API for reliable operation

License

MIT License - Free to use, modify, and distribute

Author

kidpoleon