YouTube Playback (XInput)

Xbox controller playback for YouTube with hold-to-repeat

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

Advertisement:

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

Advertisement:

Autor
kidpoleon
Denně instalací
0
Celkem instalací
1
Hodnocení
0 0 0
Verze
1.0
Vytvořeno
16. 06. 2026
Aktualizováno
16. 06. 2026
velikost
9,9 KB
Licence
MIT
Spustit na

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