Skip to content

About

Open media from chrome / brave using mpv

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chrome-openwith-mpv

Send browser media to mpv for better playback, controls, and hw acceleration.

demo.mp4

(Recorded at low fps)

Platform

Linux only.

  • Tested with Brave and Google Chrome on Linux desktop.
  • Native messaging install paths use Linux ~/.config/... locations.
  • When available, xdotool lets the host wait for a visible mpv window on X11 or XWayland.
  • Not supported on macOS or Windows.

Install

Requirements:

  • node
  • mpv
  • A current yt-dlp release

Keep yt-dlp updated using the same method you used to install it. YouTube changes frequently, and outdated releases may resolve stream URLs that fail with HTTP 403. This project uses the external yt-dlp executable rather than vendoring or pinning it.

Optional configuration:

  • Install xdotool to let the host wait until the mpv window is visible. Without it, playback still launches, but the host returns immediately.
  • For Twitch and other sites that need browser cookies, add this to ~/.config/mpv/mpv.conf:
ytdl-raw-options=cookies-from-browser=brave

Replace brave with chrome or chromium if that browser holds the cookies you want to use.

From the repository root, run:

./install.sh

This installs the native messaging host for Brave, Google Chrome, and Chromium.

Load the extension once in each browser you use:

  • Open brave://extensions or chrome://extensions.
  • Enable Developer mode.
  • Select Load unpacked.
  • Choose the extension directory in this repo.

Use

  • Click the toolbar button to inspect the current page for playable media and open the best candidate in mpv.
  • Right-click a page and choose Open page in mpv.
  • Right-click a link and choose Open link in mpv.

When the extension finds a direct stream URL, it also sends Referer and User-Agent headers to mpv.

The native host only accepts http:// and https:// URLs.

YouTube and Twitch are supported. DRM-protected sites like Netflix are not supported.

About

Open media from chrome / brave using mpv

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages