yWeb: fix detection of VLC >= 2.1.0

tested from vlc-0.8.6 to vlc-3.0.0-git


Origin commit data
------------------
Branch: ni/coolstream
Commit: 30090ac06d
Author: GetAway <get-away@t-online.de>
Date: 2015-05-01 (Fri, 01 May 2015)



------------------
This commit was generated by Migit
This commit is contained in:
GetAway
2015-05-01 22:13:02 +02:00
committed by vanhofen
parent 2abe1d3bce
commit 71479aa45c
2 changed files with 26 additions and 34 deletions

View File

@@ -1,6 +1,6 @@
/* VLC abstraction by yjogol@online.de /* VLC abstraction by yjogol
$Date$ $Date: $
$Revision$ $Revision: $
*/ */
/*ie1=ActiveC, moz1=Mozilla<0.8.5.1, moz2>= 0.8.5.1*/ /*ie1=ActiveC, moz1=Mozilla<0.8.5.1, moz2>= 0.8.5.1*/
var CyVLC = function(_id, masterid, width, height) { var CyVLC = function(_id, masterid, width, height) {
@@ -50,49 +50,41 @@ CyVLC.prototype = {
var words = vstr.split(" "); var words = vstr.split(" ");
return words[0]; return words[0];
} }
else else if (navigator.plugins && (navigator.plugins.length > 0)) {
if (navigator.plugins && (navigator.plugins.length > 0)) { var numPlugins = navigator.plugins.length;
var name = "VLC"; for(var i = 0; i < numPlugins; i++) {
for(var i=0;i<navigator.plugins.length;++i) var plugin = navigator.plugins[i];
if (navigator.plugins[i].name.indexOf(name) != -1) var numTypes = plugin.length;
var plug = navigator.plugins[navigator.plugins[i].name]; for (var j = 0; j < numTypes; j++)
{
if(typeof plug != 'undefined') { var mimetype = plugin[j];
var Suche = /(PLUGIN)/gi; if (mimetype) {
var Ergebnis = Suche.test(plug.description); if (mimetype.type.indexOf("application/x-vlc-plugin") != -1) {
if (Ergebnis == true){ return plugin.version;
var ex = /^.*[pP]lugin [\"]*([^ \"]*)[\"]*.*$/; }
var ve = ex.exec(plug.description); }
}else{
var ex = /^.*[vV]ersion [\"]*([^ \"]*)[\"]*.*$/;
var ve = ex.exec(plug.description);
} }
} }
var Suche = /([0-9])/g;
var Ergebnis = Suche.test(ve);
if (Ergebnis == true)
return ve[1];
else
return "0.0.0"; return "0.0.0";
} }
else else
return "0.0.0"; return "0.0.0";
}, },
_generate_sub_versions : function() { _generate_sub_versions : function() {
if(this.version_string == "") if(this.version_string === "")
return return;
var ex = /([^\.]*)[\.]*([^\.]*)[\.]*([^\.-]*)[\.-]*([^\.]*).*$/; var ex = /([^\.]*)[\.]*([^\.]*)[\.]*([^\.-]*)[\.-]*([^\.]*).*$/;
var ve = ex.exec(this.version_string); var ve = ex.exec(this.version_string);
if(ve.length >1) this.version_level1 = ve[1]; if(ve.length >1) this.version_level1 = ve[1];
if(ve.length >2) this.version_level2 = ve[2]; if(ve.length >2) this.version_level2 = ve[2];
if(ve.length >3 && ve[3] != "") this.version_level3 = ve[3]; if(ve.length >3 && ve[3] !== "") this.version_level3 = ve[3];
if(ve.length >4 && ve[4] != "") this.version_level4 = ve[4]; if(ve.length >4 && ve[4] !== "") this.version_level4 = ve[4];
}, },
_determine_plugin_generation : function() { _determine_plugin_generation : function() {
if(is_ie) if(is_ie)
this.plugin = "ie1"; this.plugin = "ie1";
else else
if(this.version_level1 <= "0" && this.version_level2 <= "8" && this.version_level3 <= "5") if(this.version_level1 <= 0 && this.version_level2 <= 8 && this.version_level3 <= 5)
this.plugin = "moz1"; this.plugin = "moz1";
else else
this.plugin = "moz2"; this.plugin = "moz2";

View File

@@ -1,4 +1,4 @@
version=2.9.0.20 version=2.9.0.21
date=16.04.2015 date=01.05.2015
type=Release type=Release
info=Port CST info=Port CST