Created
February 16, 2021 21:58
-
-
Save aykxt/1aff15ba794061b8b4dc47e5aa1175e6 to your computer and use it in GitHub Desktop.
VLC URL protocol handler for "vlc://" links on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\vlc] | |
@="URL:VLC Protocol" | |
"URL Protocol"="" | |
[HKEY_CLASSES_ROOT\vlc\DefaultIcon] | |
@="C:\\Program Files\\VideoLAN\\VLC\\vlc.exe,0" | |
[HKEY_CLASSES_ROOT\vlc\shell] | |
[HKEY_CLASSES_ROOT\vlc\shell\open] | |
[HKEY_CLASSES_ROOT\vlc\shell\open\command] | |
@="cmd /V:ON /c set url=%1 && call set url=%%url:~6%% && start \"\" \"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\" --open !url!" |
So recently this wasn't working on both firefox and chrome. For some reason vlc got the url of the form http//...
, no :
. After some fiddling around with the example at mpv-player/mpv#14506 (comment). I got this to work:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\vlc]
@="URL:VLC Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\vlc\DefaultIcon]
@="C:\\Program Files\\VideoLAN\\VLC\\vlc.exe,0"
[HKEY_CLASSES_ROOT\vlc\shell]
[HKEY_CLASSES_ROOT\vlc\shell\open]
[HKEY_CLASSES_ROOT\vlc\shell\open\command]
@="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -WindowStyle Hidden -Command \"& {Add-Type -AssemblyName System.Web;$PARAMS=('--open', '%1' -replace '^vlc://' -replace '^http//', 'http://' -replace '^https//', 'https://'); Start-Process -FilePath \\\"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\\\" -ArgumentList $PARAMS}\""
other people are also facing this bug:
- https://support.google.com/chrome/thread/303855629/url-redirect-is-removing-colon-after-https?hl=en
- https://www.reddit.com/r/chrome/comments/1g6gn3x/issue_with_custom_protocol_url_since_chrome/
There is this bug tracker in chromium:
I reset my laptop and this time vlc ended up in the C:\Program Files (x86)
directory instead of C:\Program Files
🤷 . So here's another version which works for C:\Program Files (x86)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\vlc]
@="URL:VLC Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\vlc\DefaultIcon]
@="C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe,0"
[HKEY_CLASSES_ROOT\vlc\shell]
[HKEY_CLASSES_ROOT\vlc\shell\open]
[HKEY_CLASSES_ROOT\vlc\shell\open\command]
@="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -WindowStyle Hidden -Command \"& {Add-Type -AssemblyName System.Web;$PARAMS=('--open', '%1' -replace '^vlc://' -replace '^http//', 'http://' -replace '^https//', 'https://'); Start-Process -FilePath \\\"C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe\\\" -ArgumentList $PARAMS}\""
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works!! Why can't vlc player add this automatically for us on setup?