YouTube Theater Fill and volume control

Auto-enable Theater mode and resize the YouTube player to fill the viewport height. While in Fullscreen, temporarily "cover" the header to prevent stray bars; revert on exit. Excludes embeds and YouTube Music. Global Arrow keys control volume with a clean OSD.

作者
Left234
日安装量
0
总安装量
8
评分
0 0 0
版本
1.4.1
创建于
2025-11-02
更新于
2025-11-02
大小
13.6 KB
许可证
MIT
适用于


YouTube Theater Fill in action

Theater mode fully expanded.

⚠️ Firefox and Edge are not supported. Use Brave or Chrome.

On YouTube:

  • Automatically enables Theater mode
  • Resizes Theater mode to use the full available height
  • Scrolls to top just in case
  • ArrowUp/ArrowDown keys adjust volume from anywhere on the page
  • Shift + Arrow = 10% steps, M toggles mute
  • On-screen volume overlay when changing volume or muting

No extra buttons. No bloat. Just a better video layout, now with seamless volume control.

To exit Theater mode, just press T or the Theater button as normal.


More info:

  • Automatic Theater mode:
    As soon as you're on a watch page, the script enables Theater mode, even before YouTube's frontend finishes loading.
    It also sets YouTube’s built-in Theater preference keys in localStorage, so your view stays wide even across reloads.
  • Viewport-aware smart scaling:
    The player is resized to use the full available vertical space, subtracting the masthead’s height.
    It uses dvh or svh units if supported (for mobile-resilience and modern viewport logic),
    then falls back to 100vh if needed. This keeps sizing accurate even in responsive or dynamic-layout environments.
  • Global volume control:
    No need to click the player first - and always adjust volume on video pages.
    Shift boosts the step size for quicker control. Press M to mute or unmute at any time.
    A minimal on-screen overlay confirms volume changes visually.
  • Header offset calculation:
    The script dynamically measures the header height and subtracts it from the video container’s height.
    This ensures that the video never gets overlapped or cut off by sticky UI elements, even if YouTube changes the masthead height mid-session.
  • Automatic scroll-to-top:
    Upon entering a video, the script scrolls the page to the top just in case. This ensures the video starts fully visible with no dead space above it,
    even if you're coming from another tab with prior scroll state.
  • Fullscreen header suppression:
    In rare cases, YouTube's sticky header or layout containers introduce stray black bars when you go fullscreen in Theater mode.
    This script detects fullscreen state changes and temporarily repositions the header to avoid any layout collision.
    It restores the original layout as soon as fullscreen is exited.
  • Stable behavior across YouTube’s single-page app (SPA):
    The script listens for internal navigation events (yt-navigate and others),
    re-checking the layout and applying itself whenever the route changes.
    No need to refresh manually or rely on brittle intervals.
  • No effect on non-video pages:
    The script only activates on /watch pages and ignores Shorts, YouTube Music, and embeds.
    These are either excluded in metadata or bypassed via DOM checks.