New Platform 12.0.5. Download or Buy on Drive
Over 300 free and legal portable apps including Xonotic (Mar 1, 2015) needs your help: Please donate today

VLC plugin, Firefox add-on and the portable versions of the programs

spchtr - November 4, 2009 - 6:39am
Share on Facebook

Been playing around with this and got it to work, sort of. Still need to figure out how to get the NSIS installer to do the work of adding and removing the registry keys that it needs for me, but here's some base information.

If you have VLCPortable on your stick, and FireFoxPortable.
You will need to get a hold of the NPVLC.DLL and NPVLC.DLL.MANIFEST files.
These files will go in your VLCPortable\App\vlc folder, right along side VLC.EXE.

The files that are used are as follows:


It will also use the plugins folder found in VLCPortable\App\vlc\. Near as I can tell these are the core set of codecs vlc uses.

There will need to be two registry keys set up.

Windows Registry Editor Version 5.00



Windows Registry Editor Version 5.00

"Description"="VLC Multimedia Plugin"
"Product"="VLC media player"

It doesn't actually use the VLC.EXE file at all for this plugin.

The plugin does not currently have any kind of ui in it. No seek bar, no volume control, etc. Not for windows anyway.

If anyone can point me to how NSIS can write/destroy keys in the registry, that would be a big help, though I think I may have some idea where to start. And where in the FirefoxPortable.nsi I'll need to put in those changes. That would be helpful. I'd also like to add a line to the FireFoxPortable.ini, for the relative path to VLCPortable.exe so it might be able to use that to put the path in the registry. Near as I can tell the npvlc.dll will be looking for the InstallDir for vlc.exe to find the libvlc.dll, and other files. The other one is only so firefox can find npvlc.dll.

I tried removing the MozillaPlugins registry key with the npvlc.dll in the firefoxportable plugins directory, This did not work, but the above does.

Initial Post Follows:

So, I was messing around with Ubuntu the other day, and discovered that firefox has an add-on that embeds vlc directly into the web page, similarly to the windows media player in IE.

Anyhow I tried it out in windows, but it does not work. I dug a little deeper and apparently in 'vlcplugin.cpp' it has some references to checking the registry for where the install directory of vlc is.

I was wondering if there were any C++ coders out there who are a little more familiar with it, than my 3 days at it, who might want to take a look at it and see if we might be able to modify this open source code so that it could work with our nifty little portable versions of these two programs.

( categories: )

Environment Variable

And, if there are any, if you can key it to check for an environment variable to VLCPortable.exe or the bits inside, that would let us do it.

Sometimes, the impossible can become possible, if you're awesome!

I would think the best way to

I would think the best way to do it would be to allow the end user to put in the relative path to VLC if it is not automatically detected in PAF format. This would be useful for users who do not have all there apps in the PortableApps folder.

I would like to see it done

I would like to see it done in that way. I am unfamilliar with how the xul interface and plugin would talk to each other to relay this information. I suppose having a setting in the options of the extension would be best to have it choose the relative path to the vlc portable.exe. Then have the npvlc.dll file check the pref.js for the relavant information. Or possibly some other text file in the extension's folder.

Again I am not yet familiar enough with C++ to just pop out code to do this, but it seems like it would be easy enough to do. It is currently looking for the vlc.exe file via the registry.


#elif defined(XP_WIN)
    HKEY h_key;
    DWORD i_type, i_data = MAX_PATH + 1;
    char p_data[MAX_PATH + 1];
    if( RegOpenKeyEx( HKEY_LOCAL_MACHINE, "Software\\VideoLAN\\VLC",
                      0, KEY_READ, &h_key ) == ERROR_SUCCESS )
         if( RegQueryValueEx( h_key, "InstallDir", 0, &i_type,
                              (LPBYTE)p_data, &i_data ) == ERROR_SUCCESS )
             if( i_type == REG_SZ )
                 strcat( p_data, "\\plugins" );
                 ppsz_argv[ppsz_argc++] = "--plugin-path";
                 ppsz_argv[ppsz_argc++] = p_data;
         RegCloseKey( h_key );
    ppsz_argv[ppsz_argc++] = "--no-one-instance";

#endif /* XP_MACOSX */

It appears to be also looking for the plugin's path as well, so it possibly already would be able to accept a relative path. For now I was considering editing thie to use my own absolute path to recompile and test with. Any suggestions would be most welcome. I'm currently using a code blocks that has been made portable to do my compiling. Eye-wink

[Please use the <pre> tag for blocks of code- mod Chris]

I'm wondering. I might be

I'm wondering.

I might be able to use the nsis to put the registry keys in place when firefox portable loads up, then have it remove them when it closes. Do you suppose this would be possible. The npvlc.dll starts up vlc with a --ignore-config flag, so it should not look for the config file at all, though it might end up putting one back in the AppData/Roaming/VLC folder, or wherever the default location for vlc is. I'm not sure I'd be able to point it at the vlc_portable.exe iteself though I'd be willing to try.

A step in the right direction

Ok, I found out what the plugin needs to work.

Turns out with the right files in the FirefoxPortable\Data\plugins directory.
And two registry keys.

The VLC Mozilla plugin doesn't need VLCPortable at all...

Files that need to be in FirefoxPortable\Data\plugins

libvlc.dll.manifest (possibly not - haven't checked yet)
npvlc.dll.manifest (possibly not - haven't checked yet)

Registry keys are as follows:

Windows Registry Editor Version 5.00


Windows Registry Editor Version 5.00

"Description"="VLC Multimedia Plugin"
"Product"="VLC media player"

With these things in place. I am able to watch wmv and quicktime embeded media directly in FirefoxPortable. I'll grant you FirefoxPortable can already watch wmv embeded by itself, but I'm not sure if it's linking to windows media player to do so, so I'd rather have it using the VLC plugin myself.

I just need figure out now, how to go about changing the NSIS installer FirefoxPortable.exe so that it can add those registry keys, then remove them when I close FFP.

Any help with this would be appreciated. I have the NSISPortable, and the source code for FFP. I also have a few NSIS plugins, Registry NewAdvSplash FindProc Dialogs.

Not sure which of these I need. Anyone got a tutorial for NSIS that includes writing and destroying registry keys?


The VLC Mozilla Plugin, does not have a UI for windows as yet. Near as I can tell, no volume control, no seeking, etc.

Grr forgot to use the < pre > tag in there, used code instead, sorry. Can't seem to edit that post for some reason though.

I also left out the plugins folder from VLC also has to be placed in the plugins folder for FireFoxPortable\Data\plugins. These are basically the codecs.

I'm also wondering if I place the npvlc.dll and npvlc.dll.manifest in the VLCPortable\App folder then point the registry keys to this location if it would simply use the files already in the VLCPortable folder anyway. I'll have to check it out.

I was interested to find out that it didn't need the actual vlc.exe at all... I also need to check out vlc's own embedding into web pages. It's possible I could write an html interface for vlc to give the plugin the controls it needs for seeking fast forward volume and such, dunno yet.