Multiple VLC plugins(0.8.6) is playing Multip-video

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
zhizhongYu
Blank Cone
Blank Cone
Posts: 14
Joined: 03 Nov 2008 03:54

Multiple VLC plugins(0.8.6) is playing Multip-video

Postby zhizhongYu » 03 Nov 2008 04:19

If the Multiple VLC plugins(0.8.6) is playing Multip-video in Firefox or IE and you reload or refresh the page, most of the time Firefox and IE will crash. why? :(

<div id="vlc1"></div>
<div id="vlc2"></div>
<div id="vlc3"></div>
<div id="vlc4"></div>

var vlc1 = new VLCObject("v1", "200", "150", "0.8.6");
vlc1.setAttribute('autostart','false');
vlc1.addParam("MRL","udp:@192.168.110.81:6001");
vlc1.addParam('autostart','false');
var vlc2 = new VLCObject("v2", "200", "150", "0.8.6");
vlc2.addParam("MRL","udp:@192.168.110.81:6002");
vlc2.addParam('autostart','false');
var vlc3 = new VLCObject("v3", "200", "150", "0.8.6");
vlc3.addParam("MRL","udp:@192.168.110.81:6003");
vlc3.addParam('autostart','false');
var vlc4 = new VLCObject("v4", "200", "150", "0.8.6");
vlc4.addParam("MRL","udp:@192.168.110.81:6004");
vlc4.addParam('autostart','false');
vlc1.write("vlc1");
vlc2.write("vlc2");
vlc3.write("vlc3");
vlc4.write("vlc4");

slycharlie
Blank Cone
Blank Cone
Posts: 16
Joined: 22 Oct 2008 17:09
VLC version: 0.9.4
Operating System: Windows xp sp3
Location: Africa
Contact:

Re: Multiple VLC plugins(0.8.6) is playing Multip-video

Postby slycharlie » 03 Nov 2008 09:24

what setup are you running? like vlc version and browser version? .... you could try vlc 0.8.6d its quite stable.

zhizhongYu
Blank Cone
Blank Cone
Posts: 14
Joined: 03 Nov 2008 03:54

Re: Multiple VLC plugins(0.8.6) is playing Multip-video

Postby zhizhongYu » 03 Nov 2008 10:08

Hello and sorry for my lack in english,
I installed vlc0.8.6i.I use Firefox 3.0.3 and IE7,
when I refresh the page,IE will singularly close,FF too.and I enter this page again and again,when the second browser will crash.
just now I installed vlc0.8.6d, this bad thing just the same appear,IE and ff will crash.
at one time I installed vlc0.9.+ ,the Multiple VLC plugins is not playing.
please help me :cry:
thanks!

slycharlie
Blank Cone
Blank Cone
Posts: 16
Joined: 22 Oct 2008 17:09
VLC version: 0.9.4
Operating System: Windows xp sp3
Location: Africa
Contact:

Re: Multiple VLC plugins(0.8.6) is playing Multip-video

Postby slycharlie » 03 Nov 2008 11:19

hey i came across this thread check it out i'm absolutely sure it will solve your problem. post back here if it works viewtopic.php?f=16&t=29977

zhizhongYu
Blank Cone
Blank Cone
Posts: 14
Joined: 03 Nov 2008 03:54

Re: Multiple VLC plugins(0.8.6) is playing Multip-video

Postby zhizhongYu » 04 Nov 2008 02:53

slycharlie --
Thanks, I test you code(viewtopic.php?f=16&t=29977).

Unfortunately, firefox still crashes if I refresh the page a couple of times,I don't know why so.

this is code of VLCObject.js http://code.revolunet.com/VLCobject

Code: Select all

/** * VLCObject v1.0.0: VLC Plugin detection and embed - http://code.revolunet.com/VLCobject/ * * Based on VLCObject by Geoff Stearns * VLCObject is (c) 2008 Julien Bouquillon - revolunet and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * */ if(typeof revolunet == "undefined") var revolunet = {}; if(typeof revolunet.util == "undefined") revolunet.util = {}; if(typeof revolunet.VLCObjectUtil == "undefined") revolunet.VLCObjectUtil = {}; revolunet.VLCObject = function(id, w, h, ver) { if (!document.getElementById) { return; } this.params = {}; this.variables = {}; this.attributes = []; if(id) { this.setAttribute('id', id); } if(w) { this.setAttribute('width', w); } if(h) { this.setAttribute('height', h); } if(ver) { this.setAttribute('version', new revolunet.PlayerVersion(ver.toString().split("."))); } this.installedVer = revolunet.VLCObjectUtil.getPlayerVersion(); if (!window.opera && document.all ) { if (!revolunet.unloadSet) { revolunet.VLCObjectUtil.prepUnload = function() { __vlc_unloadHandler = function(){}; __vlc_savedUnloadHandler = function(){}; window.attachEvent("onunload", revolunet.VLCObjectUtil.cleanupVLCs); } window.attachEvent("onbeforeunload", revolunet.VLCObjectUtil.prepUnload); revolunet.unloadSet = true; } } } revolunet.VLCObject.prototype = { setAttribute: function(name, value){ this.attributes[name] = value; }, getAttribute: function(name){ return this.attributes[name] || ""; }, addParam: function(name, value){ this.params[name] = value; }, getParams: function(){ return this.params; }, addVariable: function(name, value){ this.variables[name] = value; }, getVariable: function(name){ return this.variables[name] || ""; }, getVariables: function(){ return this.variables; }, getVariablePairs: function(){ var variablePairs = []; var key; var variables = this.getVariables(); for(key in variables){ variablePairs[variablePairs.length] = key +"="+ variables[key]; } return variablePairs; }, getVLCHTML: function() { var vlcNode = ""; if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture vlcNode = '<embed type="application/x-vlc-plugin" " pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ (this.getAttribute('style') || "") +'"'; vlcNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" '; var params = this.getParams(); for(var key in params){ vlcNode += [key] +'="'+ params[key] +'" '; } var pairs = this.getVariablePairs().join("&"); vlcNode += '/>'; } else { // PC IE vlcNode = '<object id="'+ this.getAttribute('id') +'" codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ (this.getAttribute('style') || "") +'">'; var params = this.getParams(); for(var key in params) { vlcNode += '<param name="'+ key +'" value="'+ params[key] +'" />'; } vlcNode += "</object>"; } return vlcNode; }, write: function(elementId){ if(this.installedVer.versionIsValid(this.getAttribute('version'))){ var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId; n.innerHTML = this.getVLCHTML(); //trick for IE activex if (document.all) { var vlc = n.firstChild; vlc.style.width = this.attributes["width"]+"px"; vlc.style.height= this.attributes["height"]+"px"; } return true; }else{ var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId; n.innerHTML = "<div style='width:400px;border:2px solid red;padding:10px'>Your VLC plugin has not been detected !<br><br>please go to <a href='http://www.videolan.org' target='_blank'>http://www.videolan.org</a> to download your plugin.</div>"; } return false; } } /* ---- detection functions ---- */ revolunet.VLCObjectUtil.getPlayerVersion = function(){ var PlayerVersion = new revolunet.PlayerVersion([0,0,0]); if(navigator.plugins && navigator.mimeTypes.length){ var x = navigator.plugins["VLC Multimedia Plug-in"]; if(!x) { // test with "old" plugin name x = navigator.plugins["VLC Multimedia Plugin"]; } if(!x) { // 0.8.6a at least x = navigator.plugins["VLC multimedia plugin"]; } if(x && x.description) { PlayerVersion = x.description.substring(0, x.description.indexOf(",")); PlayerVersion = PlayerVersion.replace("Version ", ""); PlayerVersion = new revolunet.PlayerVersion(PlayerVersion.split(".")); } } else { // Win IE try{ var axo = new ActiveXObject("VideoLAN.VLCPlugin.2"); PlayerVersion = new revolunet.PlayerVersion([0,8,6]); }catch(e){ try { var axo = new ActiveXObject("VideoLAN.VLCPlugin.1"); PlayerVersion = new revolunet.PlayerVersion([0,8,5]); } catch(e) { } } if (axo != null) { //PlayerVersion = axo.VersionInfo; } } return PlayerVersion; } revolunet.PlayerVersion = function(arrVersion){ this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0; this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0; this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0; } revolunet.PlayerVersion.prototype.versionIsValid = function(fv){ if(this.major < fv.major) return false; if(this.major > fv.major) return true; if(this.minor < fv.minor) return false; if(this.minor > fv.minor) return true; if(this.rev < fv.rev) return false; return true; } /* ---- get value of query string param ---- */ revolunet.util = { getRequestParameter: function(param) { var q = document.location.search || document.location.hash; if (param == null) { return q; } if(q) { var pairs = q.substring(1).split("&"); for (var i=0; i < pairs.length; i++) { if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { return pairs[i].substring((pairs[i].indexOf("=")+1)); } } } return ""; } } revolunet.VLCObjectUtil.cleanupVLCs = function() { var objects = document.getElementsByTagName("OBJECT"); for (var i = objects.length - 1; i >= 0; i--) { objects[i].style.display = 'none'; for (var x in objects[i]) { if (typeof objects[i][x] == 'function') { objects[i][x] = function(){}; } } } } /* add document.getElementById if needed (mobile IE < 5) */ if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }} /* add some aliases for ease of use/backwards compatibility */ var getQueryParamValue = revolunet.util.getRequestParameter; var VLCObject = revolunet.VLCObject;
By using javascript my code using a function wich dynamicly writes (document.write) the object in the page too.
but I can not have figured that out this problem.

I depressed. :(

please help me,
thanks.

slycharlie
Blank Cone
Blank Cone
Posts: 16
Joined: 22 Oct 2008 17:09
VLC version: 0.9.4
Operating System: Windows xp sp3
Location: Africa
Contact:

Re: Multiple VLC plugins(0.8.6) is playing Multip-video

Postby slycharlie » 04 Nov 2008 16:26

Iam not good in java but i would advise you to try out a page with single vlc plugin. If its stable then the problem will be with using multiple option.

zhizhongYu
Blank Cone
Blank Cone
Posts: 14
Joined: 03 Nov 2008 03:54

Re: Multiple VLC plugins(0.8.6) is playing Multip-video

Postby zhizhongYu » 05 Nov 2008 02:11

I try out a page with single vlc plugin.
result the page refresh or reload no problem.
I use multiple vlc plugin will crash.
now I carry out a page with five vlc plugin,display four video and one audio,but in my system I enter this page then leave,when I enter this page again, browser will crash.
what about figure out this problem?
help me ! :(

zhizhongYu
Blank Cone
Blank Cone
Posts: 14
Joined: 03 Nov 2008 03:54

Re: Multiple VLC plugins(0.8.6) is playing Multip-video

Postby zhizhongYu » 05 Nov 2008 08:27

:D

this problem is resolved.
thanks!

I install vlc(0.9.4) and modify my code MRL udp://@192.168.110.81:6000.
but I don't know why?

I insatall vlc(0.8.6) my code mrl udp:@192.168.110.81:6000


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 29 guests