This page provides a detailed description of the functionality, usage, and precautions for WebUI invoking a local video player, offering users a complete operation guide.
WebUI supports launching a locally installed video player on the user's device (such as VLC or PotPlayer) via custom protocols (e.g., vlc://, potplayer://) to directly play the HTTP links of specified video files in download tasks. This feature bypasses browser playback format limitations and fully utilises the advanced functions of the local player.
- Strong format compatibility: Supports playback of special video formats not natively supported by the browser (e.g., MKV, FLV in high definition).
- Richer features: Can invoke advanced decoding, multiple audio track switching, subtitle adjustment, speed control and other exclusive functions of the local player.
- Performance enhancement: The local player can utilise hardware acceleration to improve playback smoothness of high-bitrate videos.
All of the following conditions must be met, otherwise the local player cannot be launched properly.
- A supported video player must be installed on the local device (official recommendation: VLC Media Player, PotPlayer).
- The player must complete custom protocol registration (e.g., the vlc:// protocol must be associated with VLC Player). Registration method is provided in the next section.
- The browser has not blocked custom protocol calls (on first use, the browser may prompt a message, requiring selection of “Allow” or “Always Allow”).
After installing the VLC player normally, the following batch file must be used to register the custom protocol:
@echo off
setlocal enabledelayedexpansion
:: Check if the script is running with Administrator privileges
fltmc >nul 2>&1 || (
echo ERROR: This script requires Administrator privileges!
echo Please right-click and select "Run as administrator".
pause
exit /b 1
)
:: Find VLC installation directory
for /f "tokens=1,2* delims=:" %%a in (
'reg query "HKLM\SOFTWARE\VideoLAN\VLC" /v "" 2^>nul ^| findstr "(Default)"'
) do (
for /f "tokens=1,2,3" %%l in ("%%a") do (
set "player_disk=%%n"
)
set "player_exe=!player_disk!:%%b"
)
:: Verify vlc.exe exists
if not exist "!player_exe!" (
echo VLC executable not found: !player_exe!
pause
exit /b 1
) else (
echo Found VLC executable path: !player_exe!
)
:: Start registering registry entries
:: Create vlc root key with default value
reg add "HKCR\vlc" /ve /t REG_SZ /d "URL:VLC Protocol" /f >nul
:: Create URL Protocol entry (empty value)
reg add "HKCR\vlc" /v "URL Protocol" /t REG_SZ /d "" /f >nul
:: Create shell\open\command entry with properly quoted executable path
:: powershell -Command "$url = '%1' -replace '^vlc://(http|https)//', '$1://' ; & \"C:\Program Files\VideoLAN\VLC\vlc.exe\" \"$url\""
reg add "HKCR\vlc\shell\open\command" /ve /t REG_SZ /d "powershell -Command \"$url = '%%1' -replace '^vlc://(http^|https)//', '$1://' ; ^& \\\"!player_exe!\\\" \\\"$url\\\"\"" /f >nul
:: Verify registration result
if %errorlevel% equ 0 (
echo VLC protocol registered successfully!
) else (
echo Failed to write to registry. Please run this script as Administrator.
pause
exit /b 1
)
endlocal
pause
After saving this .bat file locally, right-click and select 'Run as administrator' to register the VLC custom protocol.
After installing the PotPlayer player (64-bit version) normally, the PotPlayer custom protocol is configured by default. If the custom protocol fails, you can use the following batch file to repair it.
@echo off
setlocal enabledelayedexpansion
:: Check if the script is running with Administrator privileges
fltmc >nul 2>&1 || (
echo ERROR: This script requires Administrator privileges!
echo Please right-click and select "Run as administrator".
pause
exit /b 1
)
:: Find PotPlayer installation directory
for /f "tokens=1,2* delims=:" %%a in (
'reg query "HKLM\SOFTWARE\DAUM\PotPlayer64" /v "ProgramPath" 2^>nul ^| findstr "ProgramPath"'
) do (
for /f "tokens=1,2,3" %%l in ("%%a") do (
set "player_disk=%%n"
)
set "player_exe=!player_disk!:%%b"
)
:: Verify PotPlayerMini64.exe exists
if not exist "!player_exe!" (
echo PotPlayer executable not found: !player_exe!
pause
exit /b 1
) else (
echo Found PotPlayer executable path: !player_exe!
)
:: Start registering registry entries
:: Create potplayer root key with default value
reg add "HKCR\potplayer" /ve /t REG_SZ /d "URL:PotPlayer Protocol" /f >nul
:: Create URL Protocol entry (empty value)
reg add "HKCR\potplayer" /v "URL Protocol" /t REG_SZ /d "" /f >nul
:: Create shell\open\command entry with properly quoted executable path
reg add "HKCR\potplayer\shell\open\command" /ve /t REG_SZ /d "\"!player_exe!\" \"%%1\"" /f >nul
:: Verify registration result
if %errorlevel% equ 0 (
echo PotPlayer protocol registered successfully!
) else (
echo Failed to write to registry. Please run this script as Administrator.
pause
exit /b 1
)
endlocal
pause
After saving this .bat file locally, right-click and select 'Run as administrator' to register the VLC custom protocol.