Mise à jour webshims
This commit is contained in:
parent
25d6e855a4
commit
68af1d70cb
@ -61,5 +61,5 @@
|
||||
%a#banner(href='http://april.org/campagne')
|
||||
-#%img(src='http://www.april.org/campagne/images/priorite-logiciel-libre-je-soutiens-april.png'
|
||||
width='580' height='76' alt='Priorité au Logiciel Libre! Je soutiens l\'April.')
|
||||
%img(src='http://april.org/campagne/images/priorite-logiciel-libre-je-soutiens-april_2_m.png'
|
||||
%img(src='http://www.april.org/campagne/images/priorite-logiciel-libre-je-soutiens-april_2_m.png'
|
||||
width='374' height='48' alt='Priorité au Logiciel Libre! Je soutiens l\'April.')
|
||||
|
@ -107,7 +107,8 @@
|
||||
var featureAlias = {
|
||||
matchmedia: 'matchMedia',
|
||||
xhr2: 'filereader',
|
||||
promise: 'es6'
|
||||
promise: 'es6',
|
||||
URL: 'url'
|
||||
};
|
||||
|
||||
clearInterval(webshims.timer);
|
||||
@ -126,7 +127,7 @@
|
||||
}
|
||||
|
||||
$.extend(webshims, {
|
||||
version: '1.14.5',
|
||||
version: '1.14.6',
|
||||
|
||||
cfg: {
|
||||
enhanceAuto: window.Audio && (!window.matchMedia || matchMedia('(min-device-width: 721px)').matches),
|
||||
@ -623,6 +624,7 @@
|
||||
error: 1
|
||||
};
|
||||
var $fn = $.fn;
|
||||
var video = create('video');
|
||||
|
||||
webshims.addMethodName = function(name){
|
||||
name = name.split(':');
|
||||
@ -968,6 +970,22 @@
|
||||
c: [21]
|
||||
});
|
||||
//>
|
||||
|
||||
//<usermedia
|
||||
var userMediaTest = ('getUserMedia' in navigator);
|
||||
|
||||
addPolyfill('usermedia-core', {
|
||||
f: 'usermedia',
|
||||
test: userMediaTest,
|
||||
d: [DOMSUPPORT]
|
||||
});
|
||||
|
||||
addPolyfill('usermedia-shim', {
|
||||
f: 'usermedia',
|
||||
test: !!(userMediaTest || navigator.webkitGetUserMedia || navigator.mozGetUserMedia),
|
||||
d: ['url', 'mediaelement', DOMSUPPORT]
|
||||
});
|
||||
//>
|
||||
|
||||
//<canvas
|
||||
(function(){
|
||||
@ -1007,6 +1025,7 @@
|
||||
|
||||
var initialFormTest = function(){
|
||||
var tmp, fieldset;
|
||||
var testValue = '1(';
|
||||
var input = create('input');
|
||||
fieldset = $('<fieldset><textarea required="" /></fieldset>')[0];
|
||||
|
||||
@ -1014,7 +1033,7 @@
|
||||
|
||||
$.each(['range', 'date', 'datetime-local', 'month', 'color', 'number'], function(i, type){
|
||||
input.setAttribute('type', type);
|
||||
inputtypes[type] = (input.type == type && (input.value = '(') && input.value != '(');
|
||||
inputtypes[type] = (input.type == type && (input.value = testValue) && input.value != testValue);
|
||||
});
|
||||
|
||||
support.datalist = !!(('options' in create('datalist')) && window.HTMLDataListElement);
|
||||
@ -1240,10 +1259,23 @@
|
||||
});
|
||||
//>
|
||||
|
||||
//<url
|
||||
addPolyfill('url', {
|
||||
test: function(){
|
||||
var support = false;
|
||||
try {
|
||||
support = new URL('b', 'http://a');
|
||||
support = !!(support.searchParams && support.href == 'http://a/b');
|
||||
} catch(e){}
|
||||
return support;
|
||||
},
|
||||
d: ['es5']
|
||||
});
|
||||
//>
|
||||
|
||||
//<mediaelement
|
||||
(function(){
|
||||
webshims.mediaelement = {};
|
||||
var video = create('video');
|
||||
var track = create('track');
|
||||
support.mediaelement = ('canPlayType' in video);
|
||||
support.texttrackapi = ('addTextTrack' in video);
|
||||
@ -1273,7 +1305,7 @@
|
||||
d: ['swfmini'],
|
||||
c: [16, 7, 2, 8, 1, 12, 13, 23]
|
||||
});
|
||||
|
||||
|
||||
|
||||
addPolyfill('mediaelement-jaris', {
|
||||
f: 'mediaelement',
|
||||
@ -1288,7 +1320,7 @@
|
||||
if(options.preferFlash && !modules.swfmini.test()){
|
||||
options.preferFlash = false;
|
||||
}
|
||||
return !( options.preferFlash && swfmini.hasFlashPlayerVersion('10.0.3') );
|
||||
return !( options.preferFlash && swfmini.hasFlashPlayerVersion('11.3') );
|
||||
},
|
||||
c: [21, 25]
|
||||
});
|
||||
|
@ -607,7 +607,7 @@ webshims.isReady('swfmini', true);
|
||||
}
|
||||
|
||||
webshims.register('mediaelement-core', function($, webshims, window, document, undefined, options){
|
||||
var hasSwf = swfmini.hasFlashPlayerVersion('10.0.3');
|
||||
var hasSwf = swfmini.hasFlashPlayerVersion('11.3');
|
||||
var mediaelement = webshims.mediaelement;
|
||||
|
||||
mediaelement.parseRtmp = function(data){
|
||||
@ -717,6 +717,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
loadYt();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
webshims.addPolyfill('mediaelement-yt', {
|
||||
test: !hasYt,
|
||||
@ -761,7 +762,16 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
|
||||
return 'video/youtube';
|
||||
}
|
||||
if(src.indexOf('rtmp') === 0){
|
||||
|
||||
if(!src.indexOf('mediastream:') || !src.indexOf('blob:http')){
|
||||
return 'usermedia';
|
||||
}
|
||||
|
||||
if(!src.indexOf('webshimstream')){
|
||||
return 'jarisplayer/stream';
|
||||
}
|
||||
|
||||
if(!src.indexOf('rtmp')){
|
||||
return nodeName+'/rtmp';
|
||||
}
|
||||
src = src.split('?')[0].split('#')[0].split('.');
|
||||
@ -778,28 +788,24 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
};
|
||||
|
||||
|
||||
mediaelement.srces = function(mediaElem, srces){
|
||||
mediaelement.srces = function(mediaElem){
|
||||
var srces = [];
|
||||
mediaElem = $(mediaElem);
|
||||
if(!srces){
|
||||
srces = [];
|
||||
var nodeName = mediaElem[0].nodeName.toLowerCase();
|
||||
var src = getSrcObj(mediaElem, nodeName);
|
||||
|
||||
if(!src.src){
|
||||
$('source', mediaElem).each(function(){
|
||||
src = getSrcObj(this, nodeName);
|
||||
if(src.src){srces.push(src);}
|
||||
});
|
||||
} else {
|
||||
srces.push(src);
|
||||
}
|
||||
return srces;
|
||||
var nodeName = mediaElem[0].nodeName.toLowerCase();
|
||||
var src = getSrcObj(mediaElem, nodeName);
|
||||
|
||||
if(!src.src){
|
||||
$('source', mediaElem).each(function(){
|
||||
src = getSrcObj(this, nodeName);
|
||||
if(src.src){srces.push(src);}
|
||||
});
|
||||
} else {
|
||||
webshims.error('setting sources was removed.');
|
||||
srces.push(src);
|
||||
}
|
||||
return srces;
|
||||
};
|
||||
|
||||
mediaelement.swfMimeTypes = ['video/3gpp', 'video/x-msvideo', 'video/quicktime', 'video/x-m4v', 'video/mp4', 'video/m4p', 'video/x-flv', 'video/flv', 'audio/mpeg', 'audio/aac', 'audio/mp4', 'audio/x-m4a', 'audio/m4a', 'audio/mp3', 'audio/x-fla', 'audio/fla', 'youtube/flv', 'video/jarisplayer', 'jarisplayer/jarisplayer', 'video/youtube', 'video/rtmp', 'audio/rtmp'];
|
||||
mediaelement.swfMimeTypes = ['video/3gpp', 'video/x-msvideo', 'video/quicktime', 'video/x-m4v', 'video/mp4', 'video/m4p', 'video/x-flv', 'video/flv', 'audio/mpeg', 'audio/aac', 'audio/mp4', 'audio/x-m4a', 'audio/m4a', 'audio/mp3', 'audio/x-fla', 'audio/fla', 'youtube/flv', 'video/jarisplayer', 'jarisplayer/jarisplayer', 'jarisplayer/stream', 'video/youtube', 'video/rtmp', 'audio/rtmp'];
|
||||
|
||||
mediaelement.canThirdPlaySrces = function(mediaElem, srces){
|
||||
var ret = '';
|
||||
@ -829,7 +835,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
srces = srces || mediaelement.srces(mediaElem);
|
||||
|
||||
$.each(srces, function(i, src){
|
||||
if(src.type && nativeCanPlay.call(mediaElem[0], src.type) ){
|
||||
if(src.type == 'usermedia' || (src.type && nativeCanPlay.call(mediaElem[0], src.type)) ){
|
||||
ret = src;
|
||||
return false;
|
||||
}
|
||||
|
@ -60,7 +60,6 @@
|
||||
webshims.register('dom-extend', function($, webshims, window, document, undefined){
|
||||
"use strict";
|
||||
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
|
||||
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
webshims.assumeARIA = true;
|
||||
|
||||
@ -91,7 +90,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
}
|
||||
|
||||
//shortcus
|
||||
var modules = webshims.modules;
|
||||
var listReg = /\s*,\s*/;
|
||||
|
||||
//proxying attribute
|
||||
@ -476,8 +474,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
|
||||
}
|
||||
};
|
||||
|
||||
var elementExtends = {};
|
||||
|
||||
return {
|
||||
createTmpCache: function(nodeName){
|
||||
if($.isDOMReady){
|
||||
@ -529,6 +526,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
};
|
||||
|
||||
$.extend(webshims, {
|
||||
xProps: havePolyfill,
|
||||
getID: (function(){
|
||||
var ID = new Date().getTime();
|
||||
return function(elem){
|
||||
@ -542,6 +540,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
return id;
|
||||
};
|
||||
})(),
|
||||
domPrefixes: ["ws", "webkit", "moz", "ms", "o"],
|
||||
|
||||
prefixed: function (prop, obj){
|
||||
var i, testProp;
|
||||
var ret = false;
|
||||
if(obj[prop]){
|
||||
ret = prop;
|
||||
}
|
||||
if(!ret){
|
||||
prop = prop.charAt(0).toUpperCase() + prop.slice(1);
|
||||
for(i = 0; i < webshims.domPrefixes.length; i++){
|
||||
testProp = webshims.domPrefixes[i]+prop;
|
||||
if(testProp in obj){
|
||||
ret = testProp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
shadowClass: 'wsshadow-'+(Date.now()),
|
||||
implement: function(elem, type){
|
||||
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});
|
||||
@ -2255,22 +2273,36 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
}
|
||||
return val;
|
||||
},
|
||||
time: function(val){
|
||||
var fVal;
|
||||
if(val && curCfg.meridian){
|
||||
time: function(val, o, noCorrect){
|
||||
var fVal, i;
|
||||
if(val){
|
||||
|
||||
val = val.split(':');
|
||||
fVal = (val[0] * 1);
|
||||
if(fVal && fVal >= 12){
|
||||
val[0] = addZero(fVal - 12+'');
|
||||
fVal = 1;
|
||||
|
||||
} else {
|
||||
fVal = 0;
|
||||
if(curCfg.meridian){
|
||||
fVal = (val[0] * 1);
|
||||
if(fVal && fVal >= 12){
|
||||
val[0] = addZero(fVal - 12+'');
|
||||
fVal = 1;
|
||||
} else {
|
||||
fVal = 0;
|
||||
}
|
||||
if(val[0] === '00'){
|
||||
val[0] = '12';
|
||||
}
|
||||
}
|
||||
if(val[0] === '00'){
|
||||
val[0] = '12';
|
||||
if(!noCorrect){
|
||||
for(i = 0; i < val.length; i++){
|
||||
val[i] = addZero(val[i]);
|
||||
}
|
||||
|
||||
if(!val[1]){
|
||||
val[1] = '00';
|
||||
}
|
||||
}
|
||||
val = $.trim(val.join(':'));
|
||||
if(fVal != null && curCfg.meridian){
|
||||
val += ' '+curCfg.meridian[fVal];
|
||||
}
|
||||
val = $.trim(val.join(':')) + ' '+ curCfg.meridian[fVal];
|
||||
}
|
||||
return val;
|
||||
},
|
||||
@ -2359,12 +2391,15 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
var fVal;
|
||||
if(val && curCfg.meridian){
|
||||
val = val.toUpperCase();
|
||||
if(val.substr(0,2) === "12"){
|
||||
if(val.substr(0,2) === "12"){
|
||||
val = "00" + val.substr(2);
|
||||
}
|
||||
|
||||
if(val.indexOf(curCfg.meridian[1]) != -1){
|
||||
|
||||
val = val.split(':');
|
||||
fVal = (val[0] * 1);
|
||||
fVal = (val[0].replace(curCfg.meridian[1], '') * 1);
|
||||
|
||||
if(!isNaN(fVal)){
|
||||
val[0] = fVal + 12;
|
||||
}
|
||||
|
@ -1042,22 +1042,36 @@
|
||||
}
|
||||
return val;
|
||||
},
|
||||
time: function(val){
|
||||
var fVal;
|
||||
if(val && curCfg.meridian){
|
||||
time: function(val, o, noCorrect){
|
||||
var fVal, i;
|
||||
if(val){
|
||||
|
||||
val = val.split(':');
|
||||
fVal = (val[0] * 1);
|
||||
if(fVal && fVal >= 12){
|
||||
val[0] = addZero(fVal - 12+'');
|
||||
fVal = 1;
|
||||
|
||||
} else {
|
||||
fVal = 0;
|
||||
if(curCfg.meridian){
|
||||
fVal = (val[0] * 1);
|
||||
if(fVal && fVal >= 12){
|
||||
val[0] = addZero(fVal - 12+'');
|
||||
fVal = 1;
|
||||
} else {
|
||||
fVal = 0;
|
||||
}
|
||||
if(val[0] === '00'){
|
||||
val[0] = '12';
|
||||
}
|
||||
}
|
||||
if(val[0] === '00'){
|
||||
val[0] = '12';
|
||||
if(!noCorrect){
|
||||
for(i = 0; i < val.length; i++){
|
||||
val[i] = addZero(val[i]);
|
||||
}
|
||||
|
||||
if(!val[1]){
|
||||
val[1] = '00';
|
||||
}
|
||||
}
|
||||
val = $.trim(val.join(':'));
|
||||
if(fVal != null && curCfg.meridian){
|
||||
val += ' '+curCfg.meridian[fVal];
|
||||
}
|
||||
val = $.trim(val.join(':')) + ' '+ curCfg.meridian[fVal];
|
||||
}
|
||||
return val;
|
||||
},
|
||||
@ -1146,12 +1160,15 @@
|
||||
var fVal;
|
||||
if(val && curCfg.meridian){
|
||||
val = val.toUpperCase();
|
||||
if(val.substr(0,2) === "12"){
|
||||
if(val.substr(0,2) === "12"){
|
||||
val = "00" + val.substr(2);
|
||||
}
|
||||
|
||||
if(val.indexOf(curCfg.meridian[1]) != -1){
|
||||
|
||||
val = val.split(':');
|
||||
fVal = (val[0] * 1);
|
||||
fVal = (val[0].replace(curCfg.meridian[1], '') * 1);
|
||||
|
||||
if(!isNaN(fVal)){
|
||||
val[0] = fVal + 12;
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ webshims.isReady('swfmini', true);
|
||||
}
|
||||
|
||||
webshims.register('mediaelement-core', function($, webshims, window, document, undefined, options){
|
||||
var hasSwf = swfmini.hasFlashPlayerVersion('10.0.3');
|
||||
var hasSwf = swfmini.hasFlashPlayerVersion('11.3');
|
||||
var mediaelement = webshims.mediaelement;
|
||||
|
||||
mediaelement.parseRtmp = function(data){
|
||||
@ -392,6 +392,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
loadYt();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
webshims.addPolyfill('mediaelement-yt', {
|
||||
test: !hasYt,
|
||||
@ -436,7 +437,16 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
|
||||
return 'video/youtube';
|
||||
}
|
||||
if(src.indexOf('rtmp') === 0){
|
||||
|
||||
if(!src.indexOf('mediastream:') || !src.indexOf('blob:http')){
|
||||
return 'usermedia';
|
||||
}
|
||||
|
||||
if(!src.indexOf('webshimstream')){
|
||||
return 'jarisplayer/stream';
|
||||
}
|
||||
|
||||
if(!src.indexOf('rtmp')){
|
||||
return nodeName+'/rtmp';
|
||||
}
|
||||
src = src.split('?')[0].split('#')[0].split('.');
|
||||
@ -453,28 +463,24 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
};
|
||||
|
||||
|
||||
mediaelement.srces = function(mediaElem, srces){
|
||||
mediaelement.srces = function(mediaElem){
|
||||
var srces = [];
|
||||
mediaElem = $(mediaElem);
|
||||
if(!srces){
|
||||
srces = [];
|
||||
var nodeName = mediaElem[0].nodeName.toLowerCase();
|
||||
var src = getSrcObj(mediaElem, nodeName);
|
||||
|
||||
if(!src.src){
|
||||
$('source', mediaElem).each(function(){
|
||||
src = getSrcObj(this, nodeName);
|
||||
if(src.src){srces.push(src);}
|
||||
});
|
||||
} else {
|
||||
srces.push(src);
|
||||
}
|
||||
return srces;
|
||||
var nodeName = mediaElem[0].nodeName.toLowerCase();
|
||||
var src = getSrcObj(mediaElem, nodeName);
|
||||
|
||||
if(!src.src){
|
||||
$('source', mediaElem).each(function(){
|
||||
src = getSrcObj(this, nodeName);
|
||||
if(src.src){srces.push(src);}
|
||||
});
|
||||
} else {
|
||||
webshims.error('setting sources was removed.');
|
||||
srces.push(src);
|
||||
}
|
||||
return srces;
|
||||
};
|
||||
|
||||
mediaelement.swfMimeTypes = ['video/3gpp', 'video/x-msvideo', 'video/quicktime', 'video/x-m4v', 'video/mp4', 'video/m4p', 'video/x-flv', 'video/flv', 'audio/mpeg', 'audio/aac', 'audio/mp4', 'audio/x-m4a', 'audio/m4a', 'audio/mp3', 'audio/x-fla', 'audio/fla', 'youtube/flv', 'video/jarisplayer', 'jarisplayer/jarisplayer', 'video/youtube', 'video/rtmp', 'audio/rtmp'];
|
||||
mediaelement.swfMimeTypes = ['video/3gpp', 'video/x-msvideo', 'video/quicktime', 'video/x-m4v', 'video/mp4', 'video/m4p', 'video/x-flv', 'video/flv', 'audio/mpeg', 'audio/aac', 'audio/mp4', 'audio/x-m4a', 'audio/m4a', 'audio/mp3', 'audio/x-fla', 'audio/fla', 'youtube/flv', 'video/jarisplayer', 'jarisplayer/jarisplayer', 'jarisplayer/stream', 'video/youtube', 'video/rtmp', 'audio/rtmp'];
|
||||
|
||||
mediaelement.canThirdPlaySrces = function(mediaElem, srces){
|
||||
var ret = '';
|
||||
@ -504,7 +510,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
srces = srces || mediaelement.srces(mediaElem);
|
||||
|
||||
$.each(srces, function(i, src){
|
||||
if(src.type && nativeCanPlay.call(mediaElem[0], src.type) ){
|
||||
if(src.type == 'usermedia' || (src.type && nativeCanPlay.call(mediaElem[0], src.type)) ){
|
||||
ret = src;
|
||||
return false;
|
||||
}
|
||||
@ -1219,11 +1225,29 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
webshims.error('you must provide a language for track in subtitles state');
|
||||
}
|
||||
obj.__wsmode = obj.mode;
|
||||
|
||||
webshims.defineProperty(obj, '_wsUpdateMode', {
|
||||
value: function(){
|
||||
$(mediaelem).triggerHandler('updatetrackdisplay');
|
||||
},
|
||||
enumerable: false
|
||||
});
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
if(!$.propHooks.mode){
|
||||
$.propHooks.mode = {
|
||||
set: function(obj, value){
|
||||
obj.mode = value;
|
||||
if(obj._wsUpdateMode && obj._wsUpdateMode.call){
|
||||
obj._wsUpdateMode();
|
||||
}
|
||||
return obj.mode;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
taken from:
|
||||
@ -1474,7 +1498,7 @@ modified for webshims
|
||||
var name = copyName[copyProp] || copyProp;
|
||||
webshims.onNodeNamesPropertyModify('track', copyProp, function(){
|
||||
var trackData = webshims.data(this, 'trackData');
|
||||
var track = this;
|
||||
|
||||
if(trackData){
|
||||
if(copyProp == 'kind'){
|
||||
refreshTrack(this, trackData);
|
||||
|
@ -59,7 +59,7 @@
|
||||
}
|
||||
|
||||
webshims.register('mediaelement-core', function($, webshims, window, document, undefined, options){
|
||||
var hasSwf = swfmini.hasFlashPlayerVersion('10.0.3');
|
||||
var hasSwf = swfmini.hasFlashPlayerVersion('11.3');
|
||||
var mediaelement = webshims.mediaelement;
|
||||
|
||||
mediaelement.parseRtmp = function(data){
|
||||
@ -169,6 +169,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
loadYt();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
webshims.addPolyfill('mediaelement-yt', {
|
||||
test: !hasYt,
|
||||
@ -213,7 +214,16 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
|
||||
return 'video/youtube';
|
||||
}
|
||||
if(src.indexOf('rtmp') === 0){
|
||||
|
||||
if(!src.indexOf('mediastream:') || !src.indexOf('blob:http')){
|
||||
return 'usermedia';
|
||||
}
|
||||
|
||||
if(!src.indexOf('webshimstream')){
|
||||
return 'jarisplayer/stream';
|
||||
}
|
||||
|
||||
if(!src.indexOf('rtmp')){
|
||||
return nodeName+'/rtmp';
|
||||
}
|
||||
src = src.split('?')[0].split('#')[0].split('.');
|
||||
@ -230,28 +240,24 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
};
|
||||
|
||||
|
||||
mediaelement.srces = function(mediaElem, srces){
|
||||
mediaelement.srces = function(mediaElem){
|
||||
var srces = [];
|
||||
mediaElem = $(mediaElem);
|
||||
if(!srces){
|
||||
srces = [];
|
||||
var nodeName = mediaElem[0].nodeName.toLowerCase();
|
||||
var src = getSrcObj(mediaElem, nodeName);
|
||||
|
||||
if(!src.src){
|
||||
$('source', mediaElem).each(function(){
|
||||
src = getSrcObj(this, nodeName);
|
||||
if(src.src){srces.push(src);}
|
||||
});
|
||||
} else {
|
||||
srces.push(src);
|
||||
}
|
||||
return srces;
|
||||
var nodeName = mediaElem[0].nodeName.toLowerCase();
|
||||
var src = getSrcObj(mediaElem, nodeName);
|
||||
|
||||
if(!src.src){
|
||||
$('source', mediaElem).each(function(){
|
||||
src = getSrcObj(this, nodeName);
|
||||
if(src.src){srces.push(src);}
|
||||
});
|
||||
} else {
|
||||
webshims.error('setting sources was removed.');
|
||||
srces.push(src);
|
||||
}
|
||||
return srces;
|
||||
};
|
||||
|
||||
mediaelement.swfMimeTypes = ['video/3gpp', 'video/x-msvideo', 'video/quicktime', 'video/x-m4v', 'video/mp4', 'video/m4p', 'video/x-flv', 'video/flv', 'audio/mpeg', 'audio/aac', 'audio/mp4', 'audio/x-m4a', 'audio/m4a', 'audio/mp3', 'audio/x-fla', 'audio/fla', 'youtube/flv', 'video/jarisplayer', 'jarisplayer/jarisplayer', 'video/youtube', 'video/rtmp', 'audio/rtmp'];
|
||||
mediaelement.swfMimeTypes = ['video/3gpp', 'video/x-msvideo', 'video/quicktime', 'video/x-m4v', 'video/mp4', 'video/m4p', 'video/x-flv', 'video/flv', 'audio/mpeg', 'audio/aac', 'audio/mp4', 'audio/x-m4a', 'audio/m4a', 'audio/mp3', 'audio/x-fla', 'audio/fla', 'youtube/flv', 'video/jarisplayer', 'jarisplayer/jarisplayer', 'jarisplayer/stream', 'video/youtube', 'video/rtmp', 'audio/rtmp'];
|
||||
|
||||
mediaelement.canThirdPlaySrces = function(mediaElem, srces){
|
||||
var ret = '';
|
||||
@ -281,7 +287,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
srces = srces || mediaelement.srces(mediaElem);
|
||||
|
||||
$.each(srces, function(i, src){
|
||||
if(src.type && nativeCanPlay.call(mediaElem[0], src.type) ){
|
||||
if(src.type == 'usermedia' || (src.type && nativeCanPlay.call(mediaElem[0], src.type)) ){
|
||||
ret = src;
|
||||
return false;
|
||||
}
|
||||
@ -996,11 +1002,29 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
webshims.error('you must provide a language for track in subtitles state');
|
||||
}
|
||||
obj.__wsmode = obj.mode;
|
||||
|
||||
webshims.defineProperty(obj, '_wsUpdateMode', {
|
||||
value: function(){
|
||||
$(mediaelem).triggerHandler('updatetrackdisplay');
|
||||
},
|
||||
enumerable: false
|
||||
});
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
if(!$.propHooks.mode){
|
||||
$.propHooks.mode = {
|
||||
set: function(obj, value){
|
||||
obj.mode = value;
|
||||
if(obj._wsUpdateMode && obj._wsUpdateMode.call){
|
||||
obj._wsUpdateMode();
|
||||
}
|
||||
return obj.mode;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
taken from:
|
||||
@ -1251,7 +1275,7 @@ modified for webshims
|
||||
var name = copyName[copyProp] || copyProp;
|
||||
webshims.onNodeNamesPropertyModify('track', copyProp, function(){
|
||||
var trackData = webshims.data(this, 'trackData');
|
||||
var track = this;
|
||||
|
||||
if(trackData){
|
||||
if(copyProp == 'kind'){
|
||||
refreshTrack(this, trackData);
|
||||
|
@ -60,7 +60,6 @@
|
||||
webshims.register('dom-extend', function($, webshims, window, document, undefined){
|
||||
"use strict";
|
||||
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
|
||||
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
webshims.assumeARIA = true;
|
||||
|
||||
@ -91,7 +90,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
}
|
||||
|
||||
//shortcus
|
||||
var modules = webshims.modules;
|
||||
var listReg = /\s*,\s*/;
|
||||
|
||||
//proxying attribute
|
||||
@ -476,8 +474,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
|
||||
}
|
||||
};
|
||||
|
||||
var elementExtends = {};
|
||||
|
||||
return {
|
||||
createTmpCache: function(nodeName){
|
||||
if($.isDOMReady){
|
||||
@ -529,6 +526,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
};
|
||||
|
||||
$.extend(webshims, {
|
||||
xProps: havePolyfill,
|
||||
getID: (function(){
|
||||
var ID = new Date().getTime();
|
||||
return function(elem){
|
||||
@ -542,6 +540,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
return id;
|
||||
};
|
||||
})(),
|
||||
domPrefixes: ["ws", "webkit", "moz", "ms", "o"],
|
||||
|
||||
prefixed: function (prop, obj){
|
||||
var i, testProp;
|
||||
var ret = false;
|
||||
if(obj[prop]){
|
||||
ret = prop;
|
||||
}
|
||||
if(!ret){
|
||||
prop = prop.charAt(0).toUpperCase() + prop.slice(1);
|
||||
for(i = 0; i < webshims.domPrefixes.length; i++){
|
||||
testProp = webshims.domPrefixes[i]+prop;
|
||||
if(testProp in obj){
|
||||
ret = testProp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
shadowClass: 'wsshadow-'+(Date.now()),
|
||||
implement: function(elem, type){
|
||||
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});
|
||||
|
@ -283,7 +283,6 @@ webshims.isReady('swfmini', true);
|
||||
webshims.register('dom-extend', function($, webshims, window, document, undefined){
|
||||
"use strict";
|
||||
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
|
||||
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
webshims.assumeARIA = true;
|
||||
|
||||
@ -314,7 +313,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
}
|
||||
|
||||
//shortcus
|
||||
var modules = webshims.modules;
|
||||
var listReg = /\s*,\s*/;
|
||||
|
||||
//proxying attribute
|
||||
@ -699,8 +697,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
|
||||
}
|
||||
};
|
||||
|
||||
var elementExtends = {};
|
||||
|
||||
return {
|
||||
createTmpCache: function(nodeName){
|
||||
if($.isDOMReady){
|
||||
@ -752,6 +749,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
};
|
||||
|
||||
$.extend(webshims, {
|
||||
xProps: havePolyfill,
|
||||
getID: (function(){
|
||||
var ID = new Date().getTime();
|
||||
return function(elem){
|
||||
@ -765,6 +763,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
return id;
|
||||
};
|
||||
})(),
|
||||
domPrefixes: ["ws", "webkit", "moz", "ms", "o"],
|
||||
|
||||
prefixed: function (prop, obj){
|
||||
var i, testProp;
|
||||
var ret = false;
|
||||
if(obj[prop]){
|
||||
ret = prop;
|
||||
}
|
||||
if(!ret){
|
||||
prop = prop.charAt(0).toUpperCase() + prop.slice(1);
|
||||
for(i = 0; i < webshims.domPrefixes.length; i++){
|
||||
testProp = webshims.domPrefixes[i]+prop;
|
||||
if(testProp in obj){
|
||||
ret = testProp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
shadowClass: 'wsshadow-'+(Date.now()),
|
||||
implement: function(elem, type){
|
||||
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});
|
||||
@ -3236,7 +3254,7 @@ webshims.defineNodeNamesProperties(['input', 'button'], formSubmitterDescriptors
|
||||
}
|
||||
|
||||
webshims.register('mediaelement-core', function($, webshims, window, document, undefined, options){
|
||||
var hasSwf = swfmini.hasFlashPlayerVersion('10.0.3');
|
||||
var hasSwf = swfmini.hasFlashPlayerVersion('11.3');
|
||||
var mediaelement = webshims.mediaelement;
|
||||
|
||||
mediaelement.parseRtmp = function(data){
|
||||
@ -3346,6 +3364,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
loadYt();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
webshims.addPolyfill('mediaelement-yt', {
|
||||
test: !hasYt,
|
||||
@ -3390,7 +3409,16 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
|
||||
return 'video/youtube';
|
||||
}
|
||||
if(src.indexOf('rtmp') === 0){
|
||||
|
||||
if(!src.indexOf('mediastream:') || !src.indexOf('blob:http')){
|
||||
return 'usermedia';
|
||||
}
|
||||
|
||||
if(!src.indexOf('webshimstream')){
|
||||
return 'jarisplayer/stream';
|
||||
}
|
||||
|
||||
if(!src.indexOf('rtmp')){
|
||||
return nodeName+'/rtmp';
|
||||
}
|
||||
src = src.split('?')[0].split('#')[0].split('.');
|
||||
@ -3407,28 +3435,24 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
};
|
||||
|
||||
|
||||
mediaelement.srces = function(mediaElem, srces){
|
||||
mediaelement.srces = function(mediaElem){
|
||||
var srces = [];
|
||||
mediaElem = $(mediaElem);
|
||||
if(!srces){
|
||||
srces = [];
|
||||
var nodeName = mediaElem[0].nodeName.toLowerCase();
|
||||
var src = getSrcObj(mediaElem, nodeName);
|
||||
|
||||
if(!src.src){
|
||||
$('source', mediaElem).each(function(){
|
||||
src = getSrcObj(this, nodeName);
|
||||
if(src.src){srces.push(src);}
|
||||
});
|
||||
} else {
|
||||
srces.push(src);
|
||||
}
|
||||
return srces;
|
||||
var nodeName = mediaElem[0].nodeName.toLowerCase();
|
||||
var src = getSrcObj(mediaElem, nodeName);
|
||||
|
||||
if(!src.src){
|
||||
$('source', mediaElem).each(function(){
|
||||
src = getSrcObj(this, nodeName);
|
||||
if(src.src){srces.push(src);}
|
||||
});
|
||||
} else {
|
||||
webshims.error('setting sources was removed.');
|
||||
srces.push(src);
|
||||
}
|
||||
return srces;
|
||||
};
|
||||
|
||||
mediaelement.swfMimeTypes = ['video/3gpp', 'video/x-msvideo', 'video/quicktime', 'video/x-m4v', 'video/mp4', 'video/m4p', 'video/x-flv', 'video/flv', 'audio/mpeg', 'audio/aac', 'audio/mp4', 'audio/x-m4a', 'audio/m4a', 'audio/mp3', 'audio/x-fla', 'audio/fla', 'youtube/flv', 'video/jarisplayer', 'jarisplayer/jarisplayer', 'video/youtube', 'video/rtmp', 'audio/rtmp'];
|
||||
mediaelement.swfMimeTypes = ['video/3gpp', 'video/x-msvideo', 'video/quicktime', 'video/x-m4v', 'video/mp4', 'video/m4p', 'video/x-flv', 'video/flv', 'audio/mpeg', 'audio/aac', 'audio/mp4', 'audio/x-m4a', 'audio/m4a', 'audio/mp3', 'audio/x-fla', 'audio/fla', 'youtube/flv', 'video/jarisplayer', 'jarisplayer/jarisplayer', 'jarisplayer/stream', 'video/youtube', 'video/rtmp', 'audio/rtmp'];
|
||||
|
||||
mediaelement.canThirdPlaySrces = function(mediaElem, srces){
|
||||
var ret = '';
|
||||
@ -3458,7 +3482,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
srces = srces || mediaelement.srces(mediaElem);
|
||||
|
||||
$.each(srces, function(i, src){
|
||||
if(src.type && nativeCanPlay.call(mediaElem[0], src.type) ){
|
||||
if(src.type == 'usermedia' || (src.type && nativeCanPlay.call(mediaElem[0], src.type)) ){
|
||||
ret = src;
|
||||
return false;
|
||||
}
|
||||
|
@ -1658,22 +1658,36 @@ webshims.register('form-number-date-api', function($, webshims, window, document
|
||||
}
|
||||
return val;
|
||||
},
|
||||
time: function(val){
|
||||
var fVal;
|
||||
if(val && curCfg.meridian){
|
||||
time: function(val, o, noCorrect){
|
||||
var fVal, i;
|
||||
if(val){
|
||||
|
||||
val = val.split(':');
|
||||
fVal = (val[0] * 1);
|
||||
if(fVal && fVal >= 12){
|
||||
val[0] = addZero(fVal - 12+'');
|
||||
fVal = 1;
|
||||
|
||||
} else {
|
||||
fVal = 0;
|
||||
if(curCfg.meridian){
|
||||
fVal = (val[0] * 1);
|
||||
if(fVal && fVal >= 12){
|
||||
val[0] = addZero(fVal - 12+'');
|
||||
fVal = 1;
|
||||
} else {
|
||||
fVal = 0;
|
||||
}
|
||||
if(val[0] === '00'){
|
||||
val[0] = '12';
|
||||
}
|
||||
}
|
||||
if(val[0] === '00'){
|
||||
val[0] = '12';
|
||||
if(!noCorrect){
|
||||
for(i = 0; i < val.length; i++){
|
||||
val[i] = addZero(val[i]);
|
||||
}
|
||||
|
||||
if(!val[1]){
|
||||
val[1] = '00';
|
||||
}
|
||||
}
|
||||
val = $.trim(val.join(':'));
|
||||
if(fVal != null && curCfg.meridian){
|
||||
val += ' '+curCfg.meridian[fVal];
|
||||
}
|
||||
val = $.trim(val.join(':')) + ' '+ curCfg.meridian[fVal];
|
||||
}
|
||||
return val;
|
||||
},
|
||||
@ -1762,12 +1776,15 @@ webshims.register('form-number-date-api', function($, webshims, window, document
|
||||
var fVal;
|
||||
if(val && curCfg.meridian){
|
||||
val = val.toUpperCase();
|
||||
if(val.substr(0,2) === "12"){
|
||||
if(val.substr(0,2) === "12"){
|
||||
val = "00" + val.substr(2);
|
||||
}
|
||||
|
||||
if(val.indexOf(curCfg.meridian[1]) != -1){
|
||||
|
||||
val = val.split(':');
|
||||
fVal = (val[0] * 1);
|
||||
fVal = (val[0].replace(curCfg.meridian[1], '') * 1);
|
||||
|
||||
if(!isNaN(fVal)){
|
||||
val[0] = fVal + 12;
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
(function(){
|
||||
"use strict";
|
||||
webshim.ready('matchMedia', function($, webshim, w, doc, undefined){
|
||||
try {
|
||||
new Image();
|
||||
} catch(e){
|
||||
@ -7,75 +6,8 @@
|
||||
return document.createElement('img');
|
||||
};
|
||||
}
|
||||
|
||||
webshim.isReady('picture', true);
|
||||
setTimeout(function(){
|
||||
if(window.picturefill){
|
||||
var sel = 'picture, img[srcset]';
|
||||
webshim.addReady(function(context){
|
||||
if(context.querySelector(sel)){
|
||||
window.picturefill();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
||||
/*! Picturefill - v2.1.0-beta - 2014-07-15
|
||||
* http://scottjehl.github.io/picturefill
|
||||
* Copyright (c) 2014 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT */
|
||||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
|
||||
|
||||
window.matchMedia || (window.matchMedia = function() {
|
||||
"use strict";
|
||||
|
||||
// For browsers that support matchMedium api such as IE 9 and webkit
|
||||
var styleMedia = (window.styleMedia || window.media);
|
||||
|
||||
// For those that don't support matchMedium
|
||||
if (!styleMedia) {
|
||||
var style = document.createElement('style'),
|
||||
script = document.getElementsByTagName('script')[0],
|
||||
info = null;
|
||||
|
||||
style.type = 'text/css';
|
||||
style.id = 'matchmediajs-test';
|
||||
|
||||
script.parentNode.insertBefore(style, script);
|
||||
|
||||
// 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
|
||||
info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;
|
||||
|
||||
styleMedia = {
|
||||
matchMedium: function(media) {
|
||||
var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
|
||||
|
||||
// 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
|
||||
if (style.styleSheet) {
|
||||
style.styleSheet.cssText = text;
|
||||
} else {
|
||||
style.textContent = text;
|
||||
}
|
||||
|
||||
// Test if media query is true or false
|
||||
return info.width === '1px';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return function(media) {
|
||||
return {
|
||||
matches: styleMedia.matchMedium(media || 'all'),
|
||||
media: media || 'all'
|
||||
};
|
||||
};
|
||||
}());
|
||||
/*! Picturefill - Responsive Images that work today.
|
||||
* Author: Scott Jehl, Filament Group, 2012 ( new proposal implemented by Shawn Jansepar )
|
||||
* License: MIT/GPLv2
|
||||
* Spec: http://picture.responsiveimages.org/
|
||||
*/
|
||||
(function( w, doc ) {
|
||||
// Enable strict mode
|
||||
// Enable strict mode
|
||||
"use strict";
|
||||
|
||||
// If picture is supported, well, that's awesome. Let's get outta here...
|
||||
@ -490,6 +422,10 @@ window.matchMedia || (window.matchMedia = function() {
|
||||
if ( source.nodeName.toUpperCase() !== "SOURCE" ) {
|
||||
continue;
|
||||
}
|
||||
// if it's a source element that has the `src` property set, throw a warning in the console
|
||||
if ( source.getAttribute( "src" ) !== null && typeof console !== undefined ){
|
||||
console.warn("The `src` attribute is invalid on `picture` `source` element; instead, use `srcset`.");
|
||||
}
|
||||
|
||||
var media = source.getAttribute( "media" );
|
||||
|
||||
@ -626,18 +562,19 @@ window.matchMedia || (window.matchMedia = function() {
|
||||
picturefill._ = pf;
|
||||
|
||||
/* expose picturefill */
|
||||
if ( typeof module === "object" && typeof module.exports === "object" ) {
|
||||
// CommonJS, just export
|
||||
module.exports = picturefill;
|
||||
} else if ( typeof define === "function" && define.amd ){
|
||||
// AMD support
|
||||
define( function() { return picturefill; } );
|
||||
} else if ( typeof w === "object" ) {
|
||||
// If no AMD and we are in the browser, attach to window
|
||||
w.picturefill = picturefill;
|
||||
}
|
||||
w.picturefill = picturefill;
|
||||
|
||||
} )( this, this.document );
|
||||
(function(){
|
||||
|
||||
webshim.isReady('picture', true);
|
||||
var sel = 'picture, img[srcset]';
|
||||
webshim.addReady(function(context){
|
||||
if(context.querySelector(sel)){
|
||||
window.picturefill();
|
||||
}
|
||||
});
|
||||
})();
|
||||
} );
|
||||
|
||||
|
||||
;/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
|
||||
|
@ -283,7 +283,6 @@ webshims.isReady('swfmini', true);
|
||||
webshims.register('dom-extend', function($, webshims, window, document, undefined){
|
||||
"use strict";
|
||||
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
|
||||
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
webshims.assumeARIA = true;
|
||||
|
||||
@ -314,7 +313,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
}
|
||||
|
||||
//shortcus
|
||||
var modules = webshims.modules;
|
||||
var listReg = /\s*,\s*/;
|
||||
|
||||
//proxying attribute
|
||||
@ -699,8 +697,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
|
||||
}
|
||||
};
|
||||
|
||||
var elementExtends = {};
|
||||
|
||||
return {
|
||||
createTmpCache: function(nodeName){
|
||||
if($.isDOMReady){
|
||||
@ -752,6 +749,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
};
|
||||
|
||||
$.extend(webshims, {
|
||||
xProps: havePolyfill,
|
||||
getID: (function(){
|
||||
var ID = new Date().getTime();
|
||||
return function(elem){
|
||||
@ -765,6 +763,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
return id;
|
||||
};
|
||||
})(),
|
||||
domPrefixes: ["ws", "webkit", "moz", "ms", "o"],
|
||||
|
||||
prefixed: function (prop, obj){
|
||||
var i, testProp;
|
||||
var ret = false;
|
||||
if(obj[prop]){
|
||||
ret = prop;
|
||||
}
|
||||
if(!ret){
|
||||
prop = prop.charAt(0).toUpperCase() + prop.slice(1);
|
||||
for(i = 0; i < webshims.domPrefixes.length; i++){
|
||||
testProp = webshims.domPrefixes[i]+prop;
|
||||
if(testProp in obj){
|
||||
ret = testProp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
shadowClass: 'wsshadow-'+(Date.now()),
|
||||
implement: function(elem, type){
|
||||
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});
|
||||
@ -2117,7 +2135,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
}
|
||||
|
||||
webshims.register('mediaelement-core', function($, webshims, window, document, undefined, options){
|
||||
var hasSwf = swfmini.hasFlashPlayerVersion('10.0.3');
|
||||
var hasSwf = swfmini.hasFlashPlayerVersion('11.3');
|
||||
var mediaelement = webshims.mediaelement;
|
||||
|
||||
mediaelement.parseRtmp = function(data){
|
||||
@ -2227,6 +2245,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
loadYt();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
webshims.addPolyfill('mediaelement-yt', {
|
||||
test: !hasYt,
|
||||
@ -2271,7 +2290,16 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
|
||||
return 'video/youtube';
|
||||
}
|
||||
if(src.indexOf('rtmp') === 0){
|
||||
|
||||
if(!src.indexOf('mediastream:') || !src.indexOf('blob:http')){
|
||||
return 'usermedia';
|
||||
}
|
||||
|
||||
if(!src.indexOf('webshimstream')){
|
||||
return 'jarisplayer/stream';
|
||||
}
|
||||
|
||||
if(!src.indexOf('rtmp')){
|
||||
return nodeName+'/rtmp';
|
||||
}
|
||||
src = src.split('?')[0].split('#')[0].split('.');
|
||||
@ -2288,28 +2316,24 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
};
|
||||
|
||||
|
||||
mediaelement.srces = function(mediaElem, srces){
|
||||
mediaelement.srces = function(mediaElem){
|
||||
var srces = [];
|
||||
mediaElem = $(mediaElem);
|
||||
if(!srces){
|
||||
srces = [];
|
||||
var nodeName = mediaElem[0].nodeName.toLowerCase();
|
||||
var src = getSrcObj(mediaElem, nodeName);
|
||||
|
||||
if(!src.src){
|
||||
$('source', mediaElem).each(function(){
|
||||
src = getSrcObj(this, nodeName);
|
||||
if(src.src){srces.push(src);}
|
||||
});
|
||||
} else {
|
||||
srces.push(src);
|
||||
}
|
||||
return srces;
|
||||
var nodeName = mediaElem[0].nodeName.toLowerCase();
|
||||
var src = getSrcObj(mediaElem, nodeName);
|
||||
|
||||
if(!src.src){
|
||||
$('source', mediaElem).each(function(){
|
||||
src = getSrcObj(this, nodeName);
|
||||
if(src.src){srces.push(src);}
|
||||
});
|
||||
} else {
|
||||
webshims.error('setting sources was removed.');
|
||||
srces.push(src);
|
||||
}
|
||||
return srces;
|
||||
};
|
||||
|
||||
mediaelement.swfMimeTypes = ['video/3gpp', 'video/x-msvideo', 'video/quicktime', 'video/x-m4v', 'video/mp4', 'video/m4p', 'video/x-flv', 'video/flv', 'audio/mpeg', 'audio/aac', 'audio/mp4', 'audio/x-m4a', 'audio/m4a', 'audio/mp3', 'audio/x-fla', 'audio/fla', 'youtube/flv', 'video/jarisplayer', 'jarisplayer/jarisplayer', 'video/youtube', 'video/rtmp', 'audio/rtmp'];
|
||||
mediaelement.swfMimeTypes = ['video/3gpp', 'video/x-msvideo', 'video/quicktime', 'video/x-m4v', 'video/mp4', 'video/m4p', 'video/x-flv', 'video/flv', 'audio/mpeg', 'audio/aac', 'audio/mp4', 'audio/x-m4a', 'audio/m4a', 'audio/mp3', 'audio/x-fla', 'audio/fla', 'youtube/flv', 'video/jarisplayer', 'jarisplayer/jarisplayer', 'jarisplayer/stream', 'video/youtube', 'video/rtmp', 'audio/rtmp'];
|
||||
|
||||
mediaelement.canThirdPlaySrces = function(mediaElem, srces){
|
||||
var ret = '';
|
||||
@ -2339,7 +2363,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
srces = srces || mediaelement.srces(mediaElem);
|
||||
|
||||
$.each(srces, function(i, src){
|
||||
if(src.type && nativeCanPlay.call(mediaElem[0], src.type) ){
|
||||
if(src.type == 'usermedia' || (src.type && nativeCanPlay.call(mediaElem[0], src.type)) ){
|
||||
|