Created A Custom Protocol For VLC, but VLC doesn't like it?

All we need is an easy explanation of the problem, so here it is.

enter image description here

Trying to add a custom protocol vlc:/// to my Windows 8 system so that hyperlinks using it will open the file in VLC instead of my browser. It does try to open the file, but then VLC says it’s unable to open the MRL. I’ve checked the messages area, but I don’t see any logs. How can I get VLC to accept the protocol?

What I Did:

  1. Open regedit, and navigate to HKEY_CLASSES_ROOT.
  2. Right click on HKEY_CLASSES_ROOT, and create a new key called vlc.
  3. Click on vlc, and then open the (Default) entry in it.
  4. In (Default) type "URL:VLC Protocol".
  5. Right click on HKEY_CLASSES_ROOT/vlc, and create a new key called Url Protocol.
  6. Right click on HKEY_CLASSES_ROOT/vlc, and create a new key called Default Icon.
  7. In HKEY_CLASSES_ROOT/vlc/Default Icon, open (Default), and enter in it "vlc.exe,1".
  8. In HKEY_CLASSES_ROOT/vlc create a new key called shell, in it create a key called open, in it create a key called command, and open the (Default) entry.
  9. In the entry type "C:\Program Files (x86)\Video LAN\VLC Media Player\vlc.exe" "%1".
  10. Create a folder called website on the c: drive, and add in a file called example.mp4, and an HTML file called example.html.
  11. In the html file type: <a href="vlc:///C:/website/example.mp4" rel="nofollow noreferrer noopener">Example Link</a>.
  12. Associate the protocol with VLC by opening a link using it, browsing for VLC, and setting it to always be used.

enter image description here

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

As Daniel B says in the comments, the problem isn’t how I’ve setup the protocol, it’s that VLC doesn’t know how to use it. The solution is to direct the output to a batch script instead of VLC. The batch script converts the output into something usable, and launches VLC.

I also decided not to use “vlc” as the protocol name, because the command line interface for vlc uses that for some things, instead I’m using “cvlc”.

Steps:

  1. Open regedit, and navigate to HKEY_CLASSES_ROOT.
  2. Right click on HKEY_CLASSES_ROOT, and create a new key called cvlc.
  3. Click on cvlc, and then open the (Default) entry in it.
  4. In (Default) type "URL:CVLC Protocol".
  5. Right click on HKEY_CLASSES_ROOT/cvlc, and create a new key called Url Protocol.
  6. Right click on HKEY_CLASSES_ROOT/cvlc, and create a new key called Default Icon.
  7. In HKEY_CLASSES_ROOT/cvlc/Default Icon, open (Default), and enter in it "vlc.exe,1".
  8. In HKEY_CLASSES_ROOT/cvlc create a new key called shell, in it create a key called open, in it create a key called command, and open the (Default) entry.
  9. In the entry type "C:\convert.bat" "%1".
  10. Open Notepad, and create a text file that reads:
:: This batch script takes the input and removes 8 characters from the front, and then launches VLC with that altered
:: input set as the file path
set vlcdata=%1
"C:\Program Files (x86)\Video LAN\VLC Media Player\vlc.exe" "%vlcdata:~8%"
  1. Save it as all files type with the name convert.bat at C:\.
  2. The first time you open a link in Firefox you will need to associate that protocol with the bat file by browsing for it, and choosing to remember in the future.
  3. Create a folder called website on the c: drive, add in a file called example.mp4, and an HTML file called example.html.
  4. In the HTML file type: <a href="cvlc:///C:\website\example.mp4" rel="nofollow noreferrer noopener">Example Link</a>.

Notes:

  • Because this uses a batch script, there will be a command prompt window opened, and it will not close until VLC does.
  • When using local files in hyperlinks you must use a \ not /.
  • This works in Firefox, but doesn’t in Internet Explorer because the protocol isn’t in the Windows list of protocols, and file types. Therefore Internet Explorer doesn’t know what program to use for it. I did find a thread about adding a custom protocol to the Windows filetype and protocol association list, but it isn’t yet solved. https://stackoverflow.com/questions/186723/how-to-add-custom-protocol-to-vista-set-associations-list

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply