Page 1 of 1

How to include plugins for Mozilla and IE on WebPage?

Posted: 01 Jul 2006 19:02
by pwozrak
I would like to include pulugins for Mozilla and IE on my Web page. When user visiting my page click the butto plugin should be installed on client's computer and user will able to see my streaming.

How to do it?

Posted: 05 Jul 2006 18:28
by Quovodis
well, you can't install plugins without the user consent, therefore the best thing to do is to detect that the plugin is missing and redirect the user toward a page explaining the problem and offer to download VLC.

on IE, to detect that VLC ActiveX control you will need to use JavaScript as follow

Code: Select all

var vlcObj = CreateObject("VideoLAN.Vlcplugin.1"); if( null != vlcObj ) vlcInstalled = true
On firefox, you detect the VideoLAN mozilla plugin as follow

Code: Select all

if (navigator.plugins && navigator.plugins.length) { for (var i=0; i < navigator.plugins.length; i++ ) { var plugin = navigator.plugins[i]; if (plugin.name.indexOf("VideoLAN") > -1) { vlcInstalled = true; } } }
I hope this helps

The Firefox plugin name has changed!

Posted: 07 Jul 2006 20:56
by jaimono
The new name is VLC multimedia plugin so you should also check for VLC in addition to VideoLAN in the plugins name. On the other hand, the firefox plugin doesn't work anymore, at least for me, so why botter? (Actually I'm angry about that, I find kind of offensive with the other OSs and Firefox users to focus in the ActiveX plugin and let the Firefox one broken :x )

Posted: 07 Jul 2006 21:27
by alec_robertson
The firefox plugin works fine for me on Debian Sid, Windows XP and Mac OSX for versions 0.8.5 and 0.8.6 svn/nightlies. More details in thread viewtopic.php?t=23371.

The IE detection script doesn't works

Posted: 13 Jul 2006 22:48
by jaimono
I'm using this script in Firefox:

Code: Select all

var vlcInstalled= false; if (navigator.plugins && navigator.plugins.length) { for (var i=0; i < navigator.plugins.length; i++ ) { var plugin = navigator.plugins[i]; if (plugin.name.indexOf("VideoLAN") > -1 || plugin.name.indexOf("VLC") > -1) { vlcInstalled = true; } } }
The Firefox script works fine. And this is the script I'm using in IE:

Code: Select all

var vlcInstalled= false; var vlcObj = null; try { vlcObj= CreateObject("VideoLAN.VLCPlugin.1"); } catch (e) { var msg= "Se produjo una excepción al tratar de crear el objeto VideoLAN.VLCPlugin.1:\n"; for (p in e) msg+= "e."+p+"= " + e[p] + "\n"; window.alert (msg); } if( null != vlcObj ) vlcInstalled = true;
This script fails with the following error: "Se esperaba un objeto" :D Well, that translates something like: "An object was expected".

So how can I detect if the plugin is installed in Internet Explorer?

Posted: 19 Jul 2006 13:52
by karlar
In Ie

var vlcObj = CreateObject("VideoLAN.Vlcplugin.1");
if( null != vlcObj )
vlcInstalled = true

thats did not work for me, instead i used

var vlcObj = new ActiveXObject("VideoLAN.Vlcplugin.1");
if( vlcObj != null )
{
vlcInstalled = true
}