How to include plugins for Mozilla and IE on WebPage?

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
pwozrak
Blank Cone
Blank Cone
Posts: 41
Joined: 22 Jun 2006 00:26

How to include plugins for Mozilla and IE on WebPage?

Postby pwozrak » 01 Jul 2006 19:02

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?

Quovodis
Cone that earned his stripes
Cone that earned his stripes
Posts: 271
Joined: 16 Jun 2004 11:13
Location: Cork, Ireland

Postby Quovodis » 05 Jul 2006 18:28

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

jaimono

The Firefox plugin name has changed!

Postby jaimono » 07 Jul 2006 20:56

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 )

alec_robertson

Postby alec_robertson » 07 Jul 2006 21:27

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.

jaimono
New Cone
New Cone
Posts: 7
Joined: 07 Jul 2006 20:57
Operating System: Linux
Location: Pereira - Risaralda, Colombia

The IE detection script doesn't works

Postby jaimono » 13 Jul 2006 22:48

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?

karlar
Blank Cone
Blank Cone
Posts: 73
Joined: 12 Jun 2006 12:25

Postby karlar » 19 Jul 2006 13:52

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
}


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 10 guests