Skip to content

Ping6666/My-Media-Control

Repository files navigation

Media Control

Media Control is a Chrome extension for per-tab media control.

It is built for a simple use case: keep media playing while controlling a tab's volume, playback speed, and transport actions from the extension.

The main motivation is that muting a tab in Chrome can sometimes pause or disrupt playback. Instead of relying on Chrome's built-in tab mute, this extension captures the tab audio and lets you turn the sound down inside the extension, so the media can keep playing while the tab is effectively muted for the user.

Why This Exists

Chrome tab mute is not always enough. Some sites behave badly when the tab is muted, and Chrome does not provide fine control for per-tab volume, speed, and hotkeys.

This extension solves that by:

  • capturing the tab audio instead of using Chrome mute
  • applying volume control inside the extension
  • controlling playback speed in the page
  • showing a small overlay with current volume and speed
  • supporting hotkeys for quick control

Features

  • Per-tab volume control with configurable limits
  • Per-tab mute
  • Playback speed control with configurable limits
  • Speed reset toggle between current speed, 1.0x, and the previous non-default speed
  • Popup controls for play/pause, seek, previous, next, speed, and volume
  • Floating overlay that shows current volume and speed
  • Custom hotkeys
  • Settings for volume/speed limits, step sizes, popup size, overlay visibility, and hotkeys
  • Recovery handling for interrupted capture sessions

Default settings:

  • volume max: 250%
  • speed range: 0.1x to 2.0x

Fullscreen Behavior

When a tab is captured, some sites do not handle the player's own fullscreen button properly.

  • The player may only become a large in-window view
  • Chrome's top bar can still remain visible
  • Other desktop windows may still be visible

If the user wants real fullscreen, they should press F11 to put Chrome itself into fullscreen mode.

The overlay can still remain visible on top of the media in F11 fullscreen.

How It Works

The extension uses Chrome's tabCapture API to capture tab audio. The audio stream is sent to an offscreen document, where the Web Audio API applies volume changes. Playback speed and media controls are handled by the content script inside the page.

Main files:

  • manifest.json: extension manifest
  • background.js: captured tab state, messaging, and hotkey routing
  • offscreen.js: audio processing
  • content.js: overlay, hotkeys, and in-page media control
  • popup.html + popup.js: popup UI
  • options.html + options.js: settings UI

Limitations

  • Capture must be started from the active tab because of Chrome security restrictions
  • Some Chrome pages and protected pages cannot be controlled
  • Some custom players do not expose standard media elements or buttons
  • Volume boost above 100% can cause clipping or distortion
  • Some sites rebuild media elements, which may require recapture
  • On some sites, the player's fullscreen button is not true fullscreen while the tab is captured, so F11 may be needed

Installation

  1. Open chrome://extensions/
  2. Turn on Developer mode
  3. Click Load unpacked
  4. Select this project folder

Basic Usage

  1. Open a tab with playable media
  2. Open the extension popup
  3. Start capture on the active tab
  4. Adjust volume, speed, and playback controls from the popup or hotkeys
  5. Open the settings page if you want to change limits, steps, overlay visibility, or key bindings

Permissions

  • tabCapture: capture tab audio
  • tabs: identify and manage tabs
  • activeTab: interact with the current tab
  • offscreen: run the audio-processing document
  • storage: save settings and tab state
  • scripting: control media inside pages
  • <all_urls>: allow supported sites to be controlled

Tested

Tested on Chrome v146.

Verified on:

  • YouTube
  • Bilibili
  • Spotify
  • Twitch
  • Kick
  • DLive

Disclaimer: All features and code for this extension were AI-generated. (Created using Antigravity Gemini 3.1 Pro (High), Claude Opus 4.6 (Thinking) and Codex GPT-5.4 with medium reasoning.)

About

My Media Control: Chrome extension for per-tab media control that keeps playback running while managing volume, speed, hotkeys, and overlay display without relying on Chrome tab mute.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors