Combines a floating button, thumbnail clicks, and a Shift+Click fallback context menu to play videos in MPV.
This is a powerful UserScript that integrates website videos with the MPV media player. It combines the best features of two original scripts and adds new functionalities for a seamless experience, allowing you to play web videos in your native player with customized settings.
For this UserScript to work, you need three key components installed on your system.
Note: This userscript is not compatible with Greasemonkey v4.0+. Please use a manager like Violentmonkey or Tampermonkey.
mpv-handler (queue mod) for full compatibility and enhanced queueing features. Follow the installation instructions on its GitHub page.Install the "Play with MPV (Enhanced)" UserScript in Violentmonkey or Tampermonkey.
Shift + Right-Click any link to open it with MPV.mpv-handler mod):
When used with the mpv-handler (queue mod), the userscript leverages the handler's ability to:
This script is a synergistic merger of two excellent original scripts, enhancing their features and creating a unified, more powerful tool.
"Play with MPV" by Akatsuki Rui
GM_config) to customize MPV launch options. This formed the foundation for our script's configuration and on-page button."Click on video thumbnail to play in MPV" by nSinister
This version isn't just a simple combination; it's a complete refactor that improves upon the originals:
Shift + Right-Click on a link on any site to get a "Play with MPV" option.MutationObserver to reliably detect new content.Shift key and right-click the link.Shift) will show the browser's default context menu.You can access the settings panel to customize the script's behavior.
Here are the available options:
low-latency, default).1080p, 720p).av01, vp9).mpv-handler runs with a console window (for debugging).on: Forces the video to be enqueued to an existing mpv instance. If no instance is running, it will fail.off: Forces a new mpv instance to be opened, even if one is already running.default (recommended): The mpv-handler (queue mod) will automatically detect if an mpv instance is running and enqueue if possible, otherwise it will open a new instance. This is the default behavior of the mpv-handler mod.This userscript works with both the original mpv-handler and the mpv-handler (queue mod).
mpv-handler, the userscript provides basic video playback functionality.enqueue option), you must use the mpv-handler (queue mod).mpv-handler (queue mod): Follow the instructions in the mpv-handler (queue mod) GitHub repository to install and configure the handler, especially setting up the MPV IPC socket.This project stands on the shoulders of giants.
Original Script Repositories:
Special Thanks:
Enjoy a more seamless and powerful video playback experience!