mpcbe不具备在chrome上点击播放的能力,这里实现一个 potplayer to mpc-be.bat

mpcbe不具备在chrome上点击播放的能力,这里实现一个 potplayer to mpc-be.bat
谷歌chrome浏览器在线视频点击potplayer按钮转换系统本地mpc-be播放的方法,bat命令行批处理添加注册表URL Protocol打开协议

@echo off
setlocal enabledelayedexpansion
title MPC-BE 协议终极修复工具

:: 1. 权限检查
fltmc >nul 2>&1 || (echo 错误:请右键以管理员身份运行! & pause & exit /b 1)

:: 2. 配置路径(基于你的 Pure Codec 路径)
set "MPC_EXE=C:\Program Files\Pure Codec\x64\mpc-be64.exe"
set "BRIDGE_BAT=C:\Program Files\Pure Codec\x64\mpc_bridge.bat"

if not exist "!MPC_EXE!" (
    echo [错误] 找不到播放器:!MPC_EXE!
    pause & exit /b 1
)

echo 正在生成中转过滤程序...
:: 3. 创建中转脚本 (核心:使用 %~1 获取原始参数,并进行字符串替换)
(
echo @echo off
echo set "raw=%%~1"
echo :: 移除 potplayer:// 前缀
echo set "url=%%raw:potplayer://=%%"
echo :: 修复 http// 或 https// 缺少冒号的问题
echo set "url=%%url:http//=http://%%"
echo set "url=%%url:https//=https://%%"
echo :: 解决可能存在的引号嵌套问题并启动播放器
echo start "" "!MPC_EXE!" "%%url%%"
) > "!BRIDGE_BAT!"

echo 正在写入注册表关联...
:: 4. 注册 potplayer 协议指向中转脚本
reg add "HKCR\potplayer" /ve /t REG_SZ /d "URL:PotPlayer Protocol for MPC" /f >nul
reg add "HKCR\potplayer" /v "URL Protocol" /t REG_SZ /d "" /f >nul
reg add "HKCR\potplayer\shell\open\command" /ve /t REG_SZ /d "\"!BRIDGE_BAT!\" \"%%1\"" /f >nul

echo.
echo ======================================================
echo [完成] 修复已生效!
echo ------------------------------------------------------
echo 1. 已创建中转文件:!BRIDGE_BAT!
echo 2. 已重定向协议:potplayer:// -^> MPC-BE
echo 3. 自动修复链接:已开启 (自动补全网址冒号)
echo ======================================================
echo 现在去网页点击 [PotPlayer] 按钮即可直接播放。
pause

现在点击网页上的potplayer按钮,就会拉起mpc-be直接在线播放了

1個讚

早期edge版本能用hevc解码播放,后来chrome内核化了后,,,就黑屏无画面只有声音了,网站要调用本地播放器来播放,然后网站只有potplayer的播放按钮