VLC on desktop will not open vlc:// urls
On iOS, you can use a url like vlc://https://...
and it will open VLC and start streaming the https://...
part.
I would like the desktop versions of VLC to do the same thing.
It appears to be possible already, using extra helpers on mac and windows: https://github.com/stefansundin/vlc-protocol
Is there any reason not to build this into VLC directly?
For Mac, it appears we need the following in Info.plist
:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>VLC</string>
<key>CFBundleURLSchemes</key>
<array>
<string>vlc</string>
</array>
</dict>
</array>
On Windows, it appears to be controlled via the registry:
reg add HKCR\vlc /ve /t REG_SZ /d "URL:vlc Protocol" /f
reg add HKCR\vlc /v "URL Protocol" /t REG_SZ /d "" /f
reg add HKCR\vlc\DefaultIcon /ve /t REG_SZ /d "%~dp0vlc.exe,0" /f
reg add HKCR\vlc\shell\open\command /ve /t REG_SZ /d "\"%~dp0vlc-protocol.exe\" \"%%1\"" /f
The vlc.exe binary itself will also need to learn to strip the vlc://
prefix when encountered. Again, vlc-ios does this already in https://code.videolan.org/videolan/vlc-ios/-/blob/master/Sources/URLHandler.swift#L349-358