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)) ){
|
||||
ret = src;
|
||||
return false;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -604,11 +604,29 @@ webshims.register('details', function($, webshims, window, doc, undefined, optio
|
||||
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:
|
||||
@ -859,7 +877,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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -7679,24 +7679,29 @@ Globally exposed namespace with the most frequently used public classes and hand
|
||||
} catch(e){}
|
||||
printMessage();
|
||||
if(hasXDomain == null){
|
||||
$.ajax({
|
||||
url: 'crossdomain.xml',
|
||||
type: 'HEAD',
|
||||
dataType: 'xml',
|
||||
success: function(){
|
||||
hasXDomain = 'yes';
|
||||
},
|
||||
error: function(){
|
||||
hasXDomain = 'no';
|
||||
},
|
||||
complete: function(){
|
||||
try {
|
||||
sessionStorage.setItem('wsXdomain.xml', hasXDomain);
|
||||
} catch(e){}
|
||||
printMessage();
|
||||
}
|
||||
});
|
||||
try {
|
||||
$.ajax({
|
||||
url: 'crossdomain.xml',
|
||||
type: 'HEAD',
|
||||
dataType: 'xml',
|
||||
success: function(){
|
||||
hasXDomain = 'yes';
|
||||
},
|
||||
error: function(){
|
||||
hasXDomain = 'no';
|
||||
},
|
||||
complete: function(){
|
||||
try {
|
||||
sessionStorage.setItem('wsXdomain.xml', hasXDomain);
|
||||
} catch(e){}
|
||||
printMessage();
|
||||
}
|
||||
});
|
||||
} catch(e){}
|
||||
}
|
||||
});
|
||||
}
|
||||
if(document.readyState == 'complete'){
|
||||
webshims.isReady('WINDOWLOAD', true);
|
||||
}
|
||||
});
|
||||
|
@ -1698,24 +1698,29 @@ webshims.register('form-shim-extend2', function($, webshims, window, document, u
|
||||
} catch(e){}
|
||||
printMessage();
|
||||
if(hasXDomain == null){
|
||||
$.ajax({
|
||||
url: 'crossdomain.xml',
|
||||
type: 'HEAD',
|
||||
dataType: 'xml',
|
||||
success: function(){
|
||||
hasXDomain = 'yes';
|
||||
},
|
||||
error: function(){
|
||||
hasXDomain = 'no';
|
||||
},
|
||||
complete: function(){
|
||||
try {
|
||||
sessionStorage.setItem('wsXdomain.xml', hasXDomain);
|
||||
} catch(e){}
|
||||
printMessage();
|
||||
}
|
||||
});
|
||||
try {
|
||||
$.ajax({
|
||||
url: 'crossdomain.xml',
|
||||
type: 'HEAD',
|
||||
dataType: 'xml',
|
||||
success: function(){
|
||||
hasXDomain = 'yes';
|
||||
},
|
||||
error: function(){
|
||||
hasXDomain = 'no';
|
||||
},
|
||||
complete: function(){
|
||||
try {
|
||||
sessionStorage.setItem('wsXdomain.xml', hasXDomain);
|
||||
} catch(e){}
|
||||
printMessage();
|
||||
}
|
||||
});
|
||||
} catch(e){}
|
||||
}
|
||||
});
|
||||
}
|
||||
if(document.readyState == 'complete'){
|
||||
webshims.isReady('WINDOWLOAD', true);
|
||||
}
|
||||
});
|
||||
|
@ -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', {});
|
||||
|
@ -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', {});
|
||||
|
@ -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', {});
|
||||
|
@ -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', {});
|
||||
@ -1669,11 +1687,29 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
|
||||
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:
|
||||
@ -1924,7 +1960,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', {});
|
||||
|
@ -1869,22 +1869,36 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
||||
}
|
||||
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;
|
||||
},
|
||||
@ -1973,12 +1987,15 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
||||
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;
|
||||
}
|
||||
|
@ -1869,22 +1869,36 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
||||
}
|
||||
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;
|
||||
},
|
||||
@ -1973,12 +1987,15 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
|
||||
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;
|
||||
}
|
||||
|
@ -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', {});
|
||||
@ -2429,7 +2447,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){
|
||||
@ -2539,6 +2557,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
loadYt();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
webshims.addPolyfill('mediaelement-yt', {
|
||||
test: !hasYt,
|
||||
@ -2583,7 +2602,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('.');
|
||||
@ -2600,28 +2628,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 = '';
|
||||
@ -2651,7 +2675,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;
|
||||
}
|
||||
|
@ -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', {});
|
||||
@ -2132,7 +2150,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){
|
||||
@ -2242,6 +2260,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
|
||||
loadYt();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
webshims.addPolyfill('mediaelement-yt', {
|
||||
test: !hasYt,
|
||||
@ -2286,7 +2305,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('.');
|
||||
@ -2303,28 +2331,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 = '';
|
||||
@ -2354,7 +2378,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;
|
||||
}
|
||||
|
@ -473,7 +473,9 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
return cache[template] || '';
|
||||
};
|
||||
})();
|
||||
var ios6 = /iP(hone|od|ad)/i.test(navigator.platform) && parseInt(((navigator.appVersion).match(/OS (\d+)_\d+/) || ['','8'])[1], 10) < 7;
|
||||
var ios = /iP(hone|od|ad)/i.test(navigator.platform);
|
||||
var ios6 = ios && parseInt(((navigator.appVersion).match(/OS (\d+)_\d+/) || ['','8'])[1], 10) < 7;
|
||||
var hasYtBug = (!window.Modernizr || !Modernizr.videoautoplay) && (ios || /android/i.test(navigator.userAgent));
|
||||
var loadLazy = function(){
|
||||
if(!loadLazy.loaded){
|
||||
loadLazy.loaded = true;
|
||||
@ -500,7 +502,8 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
};
|
||||
|
||||
webshims.loader.addModule('mediacontrols-lazy', {
|
||||
src: 'jme/mediacontrols-lazy'
|
||||
src: 'jme/mediacontrols-lazy',
|
||||
d: ['dom-support']
|
||||
});
|
||||
|
||||
var userActivity = {
|
||||
@ -523,6 +526,11 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
data.media.removeAttr('controls');
|
||||
data.media.mediaLoad();
|
||||
}
|
||||
|
||||
if(hasYtBug){
|
||||
data.player.addClass('has-yt-bug');
|
||||
}
|
||||
|
||||
data.media.prop('controls', false);
|
||||
structure = getBarHtml();
|
||||
data._controlbar = $( options.barStructure );
|
||||
@ -569,7 +577,7 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
})();
|
||||
var $poster = $('<div class="ws-poster" />').insertAfter(data.media);
|
||||
var posterState = (function(){
|
||||
var lastPosterState, lastYoutubeState, lastPoster;
|
||||
var lastPosterState, lastYoutubeState, lastPoster, isYt;
|
||||
var hasFlash = window.swfmini && swfmini.hasFlashPlayerVersion('10.0.3');
|
||||
var regYt = /youtube\.com\/[watch\?|v\/]+/i;
|
||||
|
||||
@ -585,8 +593,10 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
data.player.addClass('no-backgroundsize');
|
||||
}
|
||||
data.media.on('play playing waiting seeked seeking', function(e){
|
||||
|
||||
if(isInitial){
|
||||
if(!e){
|
||||
e.type = 'playing';
|
||||
}
|
||||
if(isInitial && (!isYt || !hasYtBug || e.type == 'playing' || data.media.prop('readyState') > 1)){
|
||||
isInitial = false;
|
||||
data.player.removeClass('initial-state');
|
||||
}
|
||||
@ -602,12 +612,16 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
data.player.addClass('ended-state');
|
||||
}
|
||||
});
|
||||
|
||||
return function(){
|
||||
var hasYt;
|
||||
var poster = data.media.attr('poster');
|
||||
var hasPoster = !!poster;
|
||||
var currentSrc = data.media.prop('currentSrc') || '';
|
||||
var isYt = regYt.test(currentSrc);
|
||||
var hasYt = (hasFlash && hasPoster) ? false : isYt;
|
||||
|
||||
isYt = regYt.test(currentSrc);
|
||||
|
||||
hasYt = (hasFlash && hasPoster) ? false : isYt;
|
||||
|
||||
if(!hasPoster && isYt){
|
||||
poster = currentSrc.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i) || '';
|
||||
@ -637,6 +651,9 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
data.player.removeClass('ended-state');
|
||||
}
|
||||
|
||||
//https://code.google.com/p/gdata-issues/issues/detail?id=5415
|
||||
data.player[isYt ? 'addClass' : 'removeClass']('yt-video');
|
||||
|
||||
if(lastYoutubeState !== hasYt){
|
||||
lastYoutubeState = hasYt;
|
||||
data.player[hasYt ? 'addClass' : 'removeClass']('has-ytposter');
|
||||
|
@ -473,7 +473,9 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
return cache[template] || '';
|
||||
};
|
||||
})();
|
||||
var ios6 = /iP(hone|od|ad)/i.test(navigator.platform) && parseInt(((navigator.appVersion).match(/OS (\d+)_\d+/) || ['','8'])[1], 10) < 7;
|
||||
var ios = /iP(hone|od|ad)/i.test(navigator.platform);
|
||||
var ios6 = ios && parseInt(((navigator.appVersion).match(/OS (\d+)_\d+/) || ['','8'])[1], 10) < 7;
|
||||
var hasYtBug = (!window.Modernizr || !Modernizr.videoautoplay) && (ios || /android/i.test(navigator.userAgent));
|
||||
var loadLazy = function(){
|
||||
if(!loadLazy.loaded){
|
||||
loadLazy.loaded = true;
|
||||
@ -500,7 +502,8 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
};
|
||||
|
||||
webshims.loader.addModule('mediacontrols-lazy', {
|
||||
src: 'jme/mediacontrols-lazy'
|
||||
src: 'jme/mediacontrols-lazy',
|
||||
d: ['dom-support']
|
||||
});
|
||||
|
||||
var userActivity = {
|
||||
@ -523,6 +526,11 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
data.media.removeAttr('controls');
|
||||
data.media.mediaLoad();
|
||||
}
|
||||
|
||||
if(hasYtBug){
|
||||
data.player.addClass('has-yt-bug');
|
||||
}
|
||||
|
||||
data.media.prop('controls', false);
|
||||
structure = getBarHtml();
|
||||
data._controlbar = $( options.barStructure );
|
||||
@ -569,7 +577,7 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
})();
|
||||
var $poster = $('<div class="ws-poster" />').insertAfter(data.media);
|
||||
var posterState = (function(){
|
||||
var lastPosterState, lastYoutubeState, lastPoster;
|
||||
var lastPosterState, lastYoutubeState, lastPoster, isYt;
|
||||
var hasFlash = window.swfmini && swfmini.hasFlashPlayerVersion('10.0.3');
|
||||
var regYt = /youtube\.com\/[watch\?|v\/]+/i;
|
||||
|
||||
@ -585,8 +593,10 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
data.player.addClass('no-backgroundsize');
|
||||
}
|
||||
data.media.on('play playing waiting seeked seeking', function(e){
|
||||
|
||||
if(isInitial){
|
||||
if(!e){
|
||||
e.type = 'playing';
|
||||
}
|
||||
if(isInitial && (!isYt || !hasYtBug || e.type == 'playing' || data.media.prop('readyState') > 1)){
|
||||
isInitial = false;
|
||||
data.player.removeClass('initial-state');
|
||||
}
|
||||
@ -602,12 +612,16 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
data.player.addClass('ended-state');
|
||||
}
|
||||
});
|
||||
|
||||
return function(){
|
||||
var hasYt;
|
||||
var poster = data.media.attr('poster');
|
||||
var hasPoster = !!poster;
|
||||
var currentSrc = data.media.prop('currentSrc') || '';
|
||||
var isYt = regYt.test(currentSrc);
|
||||
var hasYt = (hasFlash && hasPoster) ? false : isYt;
|
||||
|
||||
isYt = regYt.test(currentSrc);
|
||||
|
||||
hasYt = (hasFlash && hasPoster) ? false : isYt;
|
||||
|
||||
if(!hasPoster && isYt){
|
||||
poster = currentSrc.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i) || '';
|
||||
@ -637,6 +651,9 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
|
||||
data.player.removeClass('ended-state');
|
||||
}
|
||||
|
||||
//https://code.google.com/p/gdata-issues/issues/detail?id=5415
|
||||
data.player[isYt ? 'addClass' : 'removeClass']('yt-video');
|
||||
|
||||
if(lastYoutubeState !== hasYt){
|
||||
lastYoutubeState = hasYt;
|
||||
data.player[hasYt ? 'addClass' : 'removeClass']('has-ytposter');
|
||||
|
@ -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', {});
|
||||
|
@ -1455,7 +1455,9 @@ if((!advancedObjectProperties || !Object.create || !Object.defineProperties || !
|
||||
var descProps = ['configurable', 'enumerable', 'writable'];
|
||||
shims.defineProperty = function(proto, property, descriptor){
|
||||
if(typeof descriptor != "object" || descriptor === null){return proto;}
|
||||
|
||||
if(Object.defineProperty){
|
||||
try { return Object.defineProperty(proto, property, descriptor); } catch (e) {}
|
||||
}
|
||||
if(owns(descriptor, "value")){
|
||||
proto[property] = descriptor.value;
|
||||
return proto;
|
||||
|
@ -1878,10 +1878,6 @@ webshim.register('es6', function($, webshim, window, document, undefined){
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(main); // RequireJS
|
||||
} else {
|
||||
main(); // CommonJS and <script>
|
||||
}
|
||||
main(); // CommonJS and <script>
|
||||
});
|
||||
|
||||
|
@ -446,24 +446,29 @@ webshim.register('filereader', function($, webshim, window, document, undefined,
|
||||
} catch(e){}
|
||||
printMessage();
|
||||
if(hasXDomain == null){
|
||||
$.ajax({
|
||||
url: 'crossdomain.xml',
|
||||
type: 'HEAD',
|
||||
dataType: 'xml',
|
||||
success: function(){
|
||||
hasXDomain = 'yes';
|
||||
},
|
||||
error: function(){
|
||||
hasXDomain = 'no';
|
||||
},
|
||||
complete: function(){
|
||||
try {
|
||||
sessionStorage.setItem('wsXdomain.xml', hasXDomain);
|
||||
} catch(e){}
|
||||
printMessage();
|
||||
}
|
||||
});
|
||||
try {
|
||||
$.ajax({
|
||||
url: 'crossdomain.xml',
|
||||
type: 'HEAD',
|
||||
dataType: 'xml',
|
||||
success: function(){
|
||||
hasXDomain = 'yes';
|
||||
},
|
||||
error: function(){
|
||||
hasXDomain = 'no';
|
||||
},
|
||||
complete: function(){
|
||||
try {
|
||||
sessionStorage.setItem('wsXdomain.xml', hasXDomain);
|
||||
} catch(e){}
|
||||
printMessage();
|
||||
}
|
||||
});
|
||||
} catch(e){}
|
||||
}
|
||||
});
|
||||
}
|
||||
if(document.readyState == 'complete'){
|
||||
webshims.isReady('WINDOWLOAD', true);
|
||||
}
|
||||
});
|
||||
|
@ -422,22 +422,36 @@ webshims.register('form-number-date-ui', 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;
|
||||
},
|
||||
@ -526,12 +540,15 @@ webshims.register('form-number-date-ui', 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;
|
||||
}
|
||||
|
@ -324,10 +324,7 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
||||
e.stopImmediatePropagation();
|
||||
};
|
||||
var steps = options.steps;
|
||||
|
||||
var mousePress = function(e){
|
||||
$(this)[e.type == 'mousepressstart' ? 'addClass' : 'removeClass']('mousepress-ui');
|
||||
};
|
||||
|
||||
var getMonthNameHTML = function(index, year, prefix){
|
||||
var dateCfg = curCfg.date;
|
||||
var str = [];
|
||||
@ -441,7 +438,7 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
||||
}
|
||||
}, 0);
|
||||
})();
|
||||
|
||||
var isDisabled = false;
|
||||
var spinEvents = {};
|
||||
var spinElement = o.splitInput ? this.inputElements.filter('.ws-spin') : this.inputElements.eq(0);
|
||||
var elementEvts = {
|
||||
@ -655,12 +652,25 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
||||
spinElement.on(spinEvents);
|
||||
}
|
||||
$(this.buttonWrapper)
|
||||
.on('mousepressstart mousepressend', '.step-up, .step-down', mousePress)
|
||||
.on('mousepressstart mousepressend', '.step-up, .step-down', function(e){
|
||||
var fn = 'removeClass';
|
||||
if(e.type == 'mousepressstart' && !isDisabled){
|
||||
fn = 'addClass';
|
||||
}
|
||||
$(this)[fn]('mousepress-ui');
|
||||
})
|
||||
.on('mousedown mousepress', '.step-up', function(e){
|
||||
step.stepUp();
|
||||
if(e.type == 'mousedown'){
|
||||
isDisabled = (o.disabled || o.readOnly || $.find.matchesSelector(that.orig, ':disabled'));
|
||||
}
|
||||
if(!isDisabled){
|
||||
step.stepUp();
|
||||
}
|
||||
})
|
||||
.on('mousedown mousepress', '.step-down', function(e){
|
||||
step.stepDown();
|
||||
if(!isDisabled && !o.disabled && !o.readOnly){
|
||||
step.stepDown();
|
||||
}
|
||||
})
|
||||
;
|
||||
initChangeEvents();
|
||||
|
@ -48,7 +48,7 @@ webshims.formcfg.fa = {
|
||||
"timeSigns": ":. ",
|
||||
"dFormat": "/",
|
||||
"patterns": {
|
||||
"d": "yyyy/mm/dd"
|
||||
"d": "yy/mm/dd"
|
||||
},
|
||||
"meridian": [
|
||||
"ب.ظ",
|
||||
|
@ -286,6 +286,17 @@
|
||||
.mediaplayer.ended-state > .jme-media-overlay {
|
||||
background-position: 3px 3px;
|
||||
}
|
||||
.mediaplayer.yt-video.has-yt-bug.initial-state > .jme-media-overlay,
|
||||
.mediaplayer.yt-video.has-yt-bug.initial-state > .ws-poster,
|
||||
.mediaplayer.yt-video.has-yt-bug.initial-state > .jme-controlbar {
|
||||
pointer-events: none;
|
||||
}
|
||||
.mediaplayer.yt-video.has-yt-bug.initial-state .fullscreen-container,
|
||||
.mediaplayer.yt-video.has-yt-bug.initial-state .playlist-container,
|
||||
.mediaplayer.yt-video.has-yt-bug.initial-state .subtitle-container,
|
||||
.mediaplayer.yt-video.has-yt-bug.initial-state .mediaconfig-container {
|
||||
pointer-events: auto;
|
||||
}
|
||||
.mediaplayer[data-state="waiting"] {
|
||||
cursor: default;
|
||||
}
|
||||
|
@ -217,6 +217,22 @@ $browser-context: 16; // Default
|
||||
}
|
||||
}
|
||||
|
||||
//remove as soon as possible: https://code.google.com/p/gdata-issues/issues/detail?id=5415
|
||||
&.yt-video.has-yt-bug.initial-state {
|
||||
> .jme-media-overlay,
|
||||
> .ws-poster,
|
||||
> .jme-controlbar {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.fullscreen-container,
|
||||
.playlist-container,
|
||||
.subtitle-container,
|
||||
.mediaconfig-container {
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
|
||||
&[data-state="waiting"] {
|
||||
cursor: default;
|
||||
> .jme-media-overlay {
|
||||
|
@ -29,6 +29,8 @@ webshims.register('mediacontrols-lazy', function($, webshims, window, doc, undef
|
||||
;
|
||||
return '<div><ul role="presentation">' + items.join('') +'</ul></div>';
|
||||
};
|
||||
var domPrefixes = webshims.domPrefixes;
|
||||
var prefixed = webshims.prefixed;
|
||||
|
||||
|
||||
if(!$.fn.wsTouchClick){
|
||||
@ -976,26 +978,7 @@ webshims.register('mediacontrols-lazy', function($, webshims, window, doc, undef
|
||||
return chapterList;
|
||||
}
|
||||
|
||||
var domPrefixes = ["webkit", "moz", "o", "ms"];
|
||||
|
||||
function prefixed(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 < domPrefixes.length; i++){
|
||||
testProp = domPrefixes[i]+prop;
|
||||
if(testProp in obj){
|
||||
ret = testProp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
$.jme.defineMethod('getChapterTree', getChapterTree);
|
||||
|
||||
@ -1050,7 +1033,7 @@ webshims.register('mediacontrols-lazy', function($, webshims, window, doc, undef
|
||||
data = $.jme.data(this);
|
||||
sec = $.prop(data.media, 'duration');
|
||||
}
|
||||
if(!sec){
|
||||
if(!sec || !isFinite(sec)){
|
||||
sec = 0;
|
||||
}
|
||||
var formated = [];
|
||||
|
@ -50,7 +50,9 @@ webshims.register('mediacontrols', function($, webshims, window){
|
||||
return cache[template] || '';
|
||||
};
|
||||
})();
|
||||
var ios6 = /iP(hone|od|ad)/i.test(navigator.platform) && parseInt(((navigator.appVersion).match(/OS (\d+)_\d+/) || ['','8'])[1], 10) < 7;
|
||||
var ios = /iP(hone|od|ad)/i.test(navigator.platform);
|
||||
var ios6 = ios && parseInt(((navigator.appVersion).match(/OS (\d+)_\d+/) || ['','8'])[1], 10) < 7;
|
||||
var hasYtBug = (!window.Modernizr || !Modernizr.videoautoplay) && (ios || /android/i.test(navigator.userAgent));
|
||||
var loadLazy = function(){
|
||||
if(!loadLazy.loaded){
|
||||
loadLazy.loaded = true;
|
||||
@ -77,7 +79,8 @@ webshims.register('mediacontrols', function($, webshims, window){
|
||||
};
|
||||
|
||||
webshims.loader.addModule('mediacontrols-lazy', {
|
||||
src: 'jme/mediacontrols-lazy'
|
||||
src: 'jme/mediacontrols-lazy',
|
||||
d: ['dom-support']
|
||||
});
|
||||
|
||||
var userActivity = {
|
||||
@ -100,6 +103,11 @@ webshims.register('mediacontrols', function($, webshims, window){
|
||||
data.media.removeAttr('controls');
|
||||
data.media.mediaLoad();
|
||||
}
|
||||
|
||||
if(hasYtBug){
|
||||
data.player.addClass('has-yt-bug');
|
||||
}
|
||||
|
||||
data.media.prop('controls', false);
|
||||
structure = getBarHtml();
|
||||
data._controlbar = $( options.barStructure );
|
||||
@ -146,7 +154,7 @@ webshims.register('mediacontrols', function($, webshims, window){
|
||||
})();
|
||||
var $poster = $('<div class="ws-poster" />').insertAfter(data.media);
|
||||
var posterState = (function(){
|
||||
var lastPosterState, lastYoutubeState, lastPoster;
|
||||
var lastPosterState, lastYoutubeState, lastPoster, isYt;
|
||||
var hasFlash = window.swfmini && swfmini.hasFlashPlayerVersion('10.0.3');
|
||||
var regYt = /youtube\.com\/[watch\?|v\/]+/i;
|
||||
|
||||
@ -162,8 +170,10 @@ webshims.register('mediacontrols', function($, webshims, window){
|
||||
data.player.addClass('no-backgroundsize');
|
||||
}
|
||||
data.media.on('play playing waiting seeked seeking', function(e){
|
||||
|
||||
if(isInitial){
|
||||
if(!e){
|
||||
e.type = 'playing';
|
||||
}
|
||||
if(isInitial && (!isYt || !hasYtBug || e.type == 'playing' || data.media.prop('readyState') > 1)){
|
||||
isInitial = false;
|
||||
data.player.removeClass('initial-state');
|
||||
}
|
||||
@ -179,12 +189,16 @@ webshims.register('mediacontrols', function($, webshims, window){
|
||||
data.player.addClass('ended-state');
|
||||
}
|
||||
});
|
||||
|
||||
return function(){
|
||||
var hasYt;
|
||||
var poster = data.media.attr('poster');
|
||||
var hasPoster = !!poster;
|
||||
var currentSrc = data.media.prop('currentSrc') || '';
|
||||
var isYt = regYt.test(currentSrc);
|
||||
var hasYt = (hasFlash && hasPoster) ? false : isYt;
|
||||
|
||||
isYt = regYt.test(currentSrc);
|
||||
|
||||
hasYt = (hasFlash && hasPoster) ? false : isYt;
|
||||
|
||||
if(!hasPoster && isYt){
|
||||
poster = currentSrc.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i) || '';
|
||||
@ -214,6 +228,9 @@ webshims.register('mediacontrols', function($, webshims, window){
|
||||
data.player.removeClass('ended-state');
|
||||
}
|
||||
|
||||
//https://code.google.com/p/gdata-issues/issues/detail?id=5415
|
||||
data.player[isYt ? 'addClass' : 'removeClass']('yt-video');
|
||||
|
||||
if(lastYoutubeState !== hasYt){
|
||||
lastYoutubeState = hasYt;
|
||||
data.player[hasYt ? 'addClass' : 'removeClass']('has-ytposter');
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -472,7 +472,8 @@
|
||||
.attr({
|
||||
src: src.src,
|
||||
'data-type': container,
|
||||
'controls': 'controls'
|
||||
'controls': 'controls',
|
||||
preload: 'none'
|
||||
})
|
||||
;
|
||||
var resolvePromise = function(){
|
||||
@ -517,6 +518,8 @@
|
||||
duration: $media.prop('duration'),
|
||||
height: $media.prop('videoHeight'),
|
||||
width: $media.prop('videoWidth')
|
||||
//todo at test for seekable
|
||||
//,seekable: ($media.prop('seekable') || []).length
|
||||
};
|
||||
}
|
||||
src.decode[provider].success = true;
|
||||
@ -554,6 +557,11 @@
|
||||
.on('mediaerror loadedmetadata', resolve)
|
||||
.appendTo($element)
|
||||
;
|
||||
|
||||
if(provider == 'native'){
|
||||
$media.on('error', resolve);
|
||||
}
|
||||
|
||||
$element.appendTo($container);
|
||||
timeoutTimer = setTimeout(resolve, 40000);
|
||||
playTimer = setTimeout(function(){
|
||||
|
@ -1,11 +1,11 @@
|
||||
webshims.register('mediaelement-jaris', function($, webshims, window, document, undefined, options){
|
||||
"use strict";
|
||||
|
||||
|
||||
var mediaelement = webshims.mediaelement;
|
||||
var swfmini = window.swfmini;
|
||||
var support = webshims.support;
|
||||
var hasNative = support.mediaelement;
|
||||
var hasFlash = swfmini.hasFlashPlayerVersion('9.0.115');
|
||||
var hasFlash = swfmini.hasFlashPlayerVersion('11.3');
|
||||
var loadedSwf = 0;
|
||||
var needsLoadPreload = 'ActiveXObject' in window && hasNative;
|
||||
var getProps = {
|
||||
@ -38,18 +38,19 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}
|
||||
};
|
||||
var getPropKeys = Object.keys(getProps);
|
||||
|
||||
|
||||
var getSetProps = {
|
||||
currentTime: 0,
|
||||
volume: 1,
|
||||
muted: false
|
||||
};
|
||||
var getSetPropKeys = Object.keys(getSetProps);
|
||||
|
||||
|
||||
var playerStateObj = $.extend({
|
||||
isActive: 'html5',
|
||||
activating: 'html5',
|
||||
activating: 'html5',
|
||||
wasSwfReady: false,
|
||||
_usermedia: null,
|
||||
_bufferedEnd: 0,
|
||||
_bufferedStart: 0,
|
||||
currentTime: 0,
|
||||
@ -59,8 +60,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
lastDuration: 0,
|
||||
_timeDif: 0.3
|
||||
}, getProps, getSetProps);
|
||||
|
||||
|
||||
|
||||
|
||||
var getSwfDataFromElem = function(elem){
|
||||
try {
|
||||
(elem.nodeName);
|
||||
@ -70,15 +71,15 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
var data = webshims.data(elem, 'mediaelement');
|
||||
return (data && data.isActive == 'third') ? data : null;
|
||||
};
|
||||
|
||||
|
||||
var trigger = function(elem, evt){
|
||||
evt = $.Event(evt);
|
||||
evt.preventDefault();
|
||||
$.event.trigger(evt, undefined, elem);
|
||||
};
|
||||
|
||||
|
||||
var playerSwfPath = options.playerPath || webshims.cfg.basePath + "swf/" + (options.playerName || 'JarisFLVPlayer.swf');
|
||||
|
||||
|
||||
webshims.extendUNDEFProp(options.params, {
|
||||
allowscriptaccess: 'always',
|
||||
allowfullscreen: 'true',
|
||||
@ -92,7 +93,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
webshims.extendUNDEFProp(options.attrs, {
|
||||
bgcolor: '#000000'
|
||||
});
|
||||
|
||||
options.playerPath = playerSwfPath;
|
||||
|
||||
var setReadyState = function(readyState, data){
|
||||
if(readyState < 3){
|
||||
clearTimeout(data._canplaythroughTimer);
|
||||
@ -120,8 +122,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
$(data._elem).triggerHandler('seeked');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
mediaelement.jarisEvent = {};
|
||||
var localConnectionTimer;
|
||||
var onEvent = {
|
||||
@ -136,7 +138,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
playing = override;
|
||||
}
|
||||
if(playing == idled || playing == null){
|
||||
|
||||
|
||||
data.paused = !playing;
|
||||
type = data.paused ? 'pause' : 'play';
|
||||
data._ppFlag = true;
|
||||
@ -151,7 +153,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
},
|
||||
onSeek: function(jaris, data){
|
||||
data._lastSeektime = jaris.seekTime;
|
||||
|
||||
|
||||
data.seeking = true;
|
||||
$(data._elem).triggerHandler('seeking');
|
||||
clearTimeout(data._seekedTimer);
|
||||
@ -167,19 +169,19 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
setReadyState(3, data);
|
||||
},
|
||||
onDataInitialized: function(jaris, data){
|
||||
|
||||
|
||||
var oldDur = data.duration;
|
||||
var durDelta;
|
||||
data.duration = jaris.duration;
|
||||
if(oldDur == data.duration || isNaN(data.duration)){return;}
|
||||
|
||||
|
||||
if(data._calledMeta && ((durDelta = Math.abs(data.lastDuration - data.duration)) < 2)){return;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
data.videoHeight = jaris.height;
|
||||
data.videoWidth = jaris.width;
|
||||
|
||||
|
||||
if(!data.networkState){
|
||||
data.networkState = 2;
|
||||
}
|
||||
@ -235,7 +237,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
data.lastCalledTime = data.currentTime;
|
||||
$.event.trigger('timeupdate', undefined, data._elem, true);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
onProgress: function(jaris, data){
|
||||
if(data.ended){
|
||||
@ -245,7 +247,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
return;
|
||||
}
|
||||
var percentage = jaris.loaded / jaris.total;
|
||||
|
||||
|
||||
if(percentage > 0.02 && percentage < 0.2){
|
||||
setReadyState(3, data);
|
||||
} else if(percentage > 0.2){
|
||||
@ -258,10 +260,10 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
if(data._bufferedEnd && (data._bufferedEnd > percentage)){
|
||||
data._bufferedStart = data.currentTime || 0;
|
||||
}
|
||||
|
||||
|
||||
data._bufferedEnd = percentage;
|
||||
data.buffered.length = 1;
|
||||
|
||||
|
||||
$.event.trigger('progress', undefined, data._elem, true);
|
||||
},
|
||||
onPlaybackFinished: function(jaris, data){
|
||||
@ -281,7 +283,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
ready: (function(){
|
||||
var testAPI = function(data){
|
||||
var passed = true;
|
||||
|
||||
|
||||
try {
|
||||
data.api.api_get('volume');
|
||||
} catch(er){
|
||||
@ -289,17 +291,17 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}
|
||||
return passed;
|
||||
};
|
||||
|
||||
|
||||
return function(jaris, data){
|
||||
var i = 0;
|
||||
|
||||
|
||||
var doneFn = function(){
|
||||
if(i > 9){
|
||||
data.tryedReframeing = 0;
|
||||
return;
|
||||
}
|
||||
i++;
|
||||
|
||||
|
||||
data.tryedReframeing++;
|
||||
if(testAPI(data)){
|
||||
data.wasSwfReady = true;
|
||||
@ -329,25 +331,25 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
clearTimeout(localConnectionTimer);
|
||||
clearTimeout(data.reframeTimer);
|
||||
data.shadowElem.removeClass('flashblocker-assumed');
|
||||
|
||||
|
||||
if(!i){
|
||||
doneFn();
|
||||
} else {
|
||||
data.reframeTimer = setTimeout(doneFn, 9);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
})()
|
||||
};
|
||||
|
||||
|
||||
onEvent.onMute = onEvent.onVolumeChange;
|
||||
|
||||
|
||||
mediaelement.onEvent = onEvent;
|
||||
|
||||
var workActionQueue = function(data){
|
||||
var actionLen = data.actionQueue.length;
|
||||
var i = 0;
|
||||
var operation;
|
||||
|
||||
|
||||
if(actionLen && data.isActive == 'third'){
|
||||
while(data.actionQueue.length && actionLen > i){
|
||||
i++;
|
||||
@ -368,7 +370,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
if( (data._ppFlag === undefined && ($.prop(data._elem, 'autoplay')) || !data.paused)){
|
||||
setTimeout(function(){
|
||||
if(data.isActive == 'third' && (data._ppFlag === undefined || !data.paused)){
|
||||
|
||||
|
||||
try {
|
||||
$(data._elem).play();
|
||||
data._ppFlag = true;
|
||||
@ -376,7 +378,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
|
||||
|
||||
if(data.muted){
|
||||
$.prop(data._elem, 'muted', true);
|
||||
}
|
||||
@ -384,8 +386,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
$.prop(data._elem, 'volume', data.volume);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var addMediaToStopEvents = $.noop;
|
||||
if(hasNative){
|
||||
var stopEvents = {
|
||||
@ -396,14 +398,14 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
var hidevents = hideEvtArray.map(function(evt){
|
||||
return evt +'.webshimspolyfill';
|
||||
}).join(' ');
|
||||
|
||||
|
||||
var hidePlayerEvents = function(event){
|
||||
var data = webshims.data(event.target, 'mediaelement');
|
||||
if(!data){return;}
|
||||
var isNativeHTML5 = ( event.originalEvent && event.originalEvent.type === event.type );
|
||||
if( isNativeHTML5 == (data.activating == 'third') ){
|
||||
event.stopImmediatePropagation();
|
||||
|
||||
|
||||
if(stopEvents[event.type]){
|
||||
if(data.isActive != data.activating){
|
||||
$(event.target).pause();
|
||||
@ -413,7 +415,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
addMediaToStopEvents = function(elem){
|
||||
$(elem)
|
||||
.off(hidevents)
|
||||
@ -425,8 +427,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
};
|
||||
addMediaToStopEvents(document);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
mediaelement.setActive = function(elem, type, data){
|
||||
if(!data){
|
||||
data = webshims.data(elem, 'mediaelement');
|
||||
@ -448,14 +450,14 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}
|
||||
$(elem).trigger('mediaelementapichange');
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var resetSwfProps = (function(){
|
||||
var resetProtoProps = ['_calledMeta', 'lastDuration', '_bufferedEnd', 'lastCalledTime', '_bufferedStart', '_ppFlag', 'currentSrc', 'currentTime', 'duration', 'ended', 'networkState', 'paused', 'seeking', 'videoHeight', 'videoWidth'];
|
||||
var resetProtoProps = ['_calledMeta', 'lastDuration', '_bufferedEnd', 'lastCalledTime', '_usermedia', '_bufferedStart', '_ppFlag', 'currentSrc', 'currentTime', 'duration', 'ended', 'networkState', 'paused', 'seeking', 'videoHeight', 'videoWidth'];
|
||||
var len = resetProtoProps.length;
|
||||
return function(data){
|
||||
|
||||
|
||||
if(!data){return;}
|
||||
clearTimeout(data._seekedTimer);
|
||||
var lenI = len;
|
||||
@ -472,8 +474,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
|
||||
|
||||
|
||||
var getComputedDimension = (function(){
|
||||
var dimCache = {};
|
||||
var getVideoDims = function(data){
|
||||
@ -495,7 +497,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
width: this.width,
|
||||
height: this.height
|
||||
};
|
||||
|
||||
|
||||
if(dimCache[poster].height && dimCache[poster].width){
|
||||
setElementDimension(data, $.prop(data._elem, 'controls'));
|
||||
} else {
|
||||
@ -511,12 +513,12 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}
|
||||
return ret || {width: 300, height: data._elemNodeName == 'video' ? 150 : 50};
|
||||
};
|
||||
|
||||
|
||||
var getCssStyle = function(elem, style){
|
||||
return elem.style[style] || (elem.currentStyle && elem.currentStyle[style]) || (window.getComputedStyle && (window.getComputedStyle( elem, null ) || {} )[style]) || '';
|
||||
};
|
||||
var minMaxProps = ['minWidth', 'maxWidth', 'minHeight', 'maxHeight'];
|
||||
|
||||
|
||||
var addMinMax = function(elem, ret){
|
||||
var i, prop;
|
||||
var hasMinMax = false;
|
||||
@ -530,7 +532,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
return hasMinMax;
|
||||
};
|
||||
var retFn = function(data){
|
||||
var videoDims, ratio, hasMinMax;
|
||||
var videoDims, ratio;
|
||||
var elem = data._elem;
|
||||
var autos = {
|
||||
width: getCssStyle(elem, 'width') == 'auto',
|
||||
@ -540,11 +542,11 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
width: !autos.width && $(elem).width(),
|
||||
height: !autos.height && $(elem).height()
|
||||
};
|
||||
|
||||
|
||||
if(autos.width || autos.height){
|
||||
videoDims = getVideoDims(data);
|
||||
ratio = videoDims.width / videoDims.height;
|
||||
|
||||
|
||||
if(autos.width && autos.height){
|
||||
ret.width = videoDims.width;
|
||||
ret.height = videoDims.height;
|
||||
@ -553,12 +555,12 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
} else if(autos.height){
|
||||
ret.height = ret.width / ratio;
|
||||
}
|
||||
|
||||
|
||||
if(addMinMax(elem, ret)){
|
||||
data.shadowElem.css(ret);
|
||||
if(autos.width){
|
||||
ret.width = data.shadowElem.height() * ratio;
|
||||
}
|
||||
}
|
||||
if(autos.height){
|
||||
ret.height = ((autos.width) ? ret.width : data.shadowElem.width()) / ratio;
|
||||
}
|
||||
@ -566,11 +568,11 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
data.shadowElem.css(ret);
|
||||
ret.height = data.shadowElem.width() / ratio;
|
||||
ret.width = ret.height * ratio;
|
||||
|
||||
|
||||
data.shadowElem.css(ret);
|
||||
ret.width = data.shadowElem.height() * ratio;
|
||||
ret.height = ret.width / ratio;
|
||||
|
||||
|
||||
}
|
||||
if(!webshims.support.mediaelement){
|
||||
ret.width = data.shadowElem.width();
|
||||
@ -580,13 +582,13 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
return retFn;
|
||||
})();
|
||||
|
||||
|
||||
var setElementDimension = function(data, hasControls){
|
||||
var dims;
|
||||
|
||||
|
||||
var box = data.shadowElem;
|
||||
$(data._elem)[hasControls ? 'addClass' : 'removeClass']('webshims-controls');
|
||||
|
||||
@ -601,7 +603,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var bufferSrc = (function(){
|
||||
var preloads = {
|
||||
'': 1,
|
||||
@ -616,17 +618,17 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
return !!(preloads[preload] || (preload == 'metadata' && $(elem).is('.preload-in-doubt, video:not([poster])')));
|
||||
};
|
||||
})();
|
||||
|
||||
|
||||
var regs = {
|
||||
A: /&/g,
|
||||
a: /&/g,
|
||||
e: /\=/g,
|
||||
q: /\?/g
|
||||
},
|
||||
replaceVar = function(val){
|
||||
return (val.replace) ? val.replace(regs.A, '%26').replace(regs.a, '%26').replace(regs.e, '%3D').replace(regs.q, '%3F') : val;
|
||||
};
|
||||
|
||||
A: /&/g,
|
||||
a: /&/g,
|
||||
e: /\=/g,
|
||||
q: /\?/g
|
||||
},
|
||||
replaceVar = function(val){
|
||||
return (val.replace) ? val.replace(regs.A, '%26').replace(regs.a, '%26').replace(regs.e, '%3D').replace(regs.q, '%3F') : val;
|
||||
};
|
||||
|
||||
if('matchMedia' in window){
|
||||
var allowMediaSorting = false;
|
||||
try {
|
||||
@ -640,14 +642,15 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
} catch(er){
|
||||
return 0;
|
||||
}
|
||||
return src1 == src2 ?
|
||||
return src1 == src2 ?
|
||||
0 :
|
||||
src1 ? -1
|
||||
: 1;
|
||||
: 1;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
mediaelement.resetSwfProps = resetSwfProps;
|
||||
mediaelement.createSWF = function( elem, canPlaySrc, data ){
|
||||
if(!hasFlash){
|
||||
setTimeout(function(){
|
||||
@ -655,7 +658,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var attrStyle = {};
|
||||
|
||||
if(loadedSwf < 1){
|
||||
@ -666,55 +669,40 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
if(!data){
|
||||
data = webshims.data(elem, 'mediaelement');
|
||||
}
|
||||
|
||||
|
||||
if((attrStyle.height = $.attr(elem, 'height') || '') || (attrStyle.width = $.attr(elem, 'width') || '')){
|
||||
$(elem).css(attrStyle);
|
||||
webshims.warn("width or height content attributes used. Webshims prefers the usage of CSS (computed styles or inline styles) to detect size of a video/audio. It's really more powerfull.");
|
||||
}
|
||||
|
||||
var isRtmp = canPlaySrc.type == 'audio/rtmp' || canPlaySrc.type == 'video/rtmp';
|
||||
var vars = $.extend({}, options.vars, {
|
||||
poster: replaceVar($.attr(elem, 'poster') && $.prop(elem, 'poster') || ''),
|
||||
source: replaceVar(canPlaySrc.streamId || canPlaySrc.srcProp),
|
||||
server: replaceVar(canPlaySrc.server || '')
|
||||
});
|
||||
var elemVars = $(elem).data('vars') || {};
|
||||
|
||||
|
||||
|
||||
var box;
|
||||
var streamRequest = canPlaySrc.streamrequest;
|
||||
var isStream = canPlaySrc.type == 'jarisplayer/stream';
|
||||
|
||||
|
||||
var hasControls = $.prop(elem, 'controls');
|
||||
var elemId = 'jarisplayer-'+ webshims.getID(elem);
|
||||
|
||||
var params = $.extend(
|
||||
{},
|
||||
options.params,
|
||||
$(elem).data('params')
|
||||
);
|
||||
|
||||
|
||||
var elemNodeName = elem.nodeName.toLowerCase();
|
||||
var attrs = $.extend(
|
||||
{},
|
||||
options.attrs,
|
||||
{
|
||||
name: elemId,
|
||||
id: elemId
|
||||
},
|
||||
$(elem).data('attrs')
|
||||
);
|
||||
|
||||
var setDimension = function(){
|
||||
if(data.isActive == 'third'){
|
||||
setElementDimension(data, $.prop(elem, 'controls'));
|
||||
}
|
||||
};
|
||||
|
||||
var box;
|
||||
|
||||
|
||||
if(isStream && !streamRequest){
|
||||
webshim.usermedia.attach(elem, canPlaySrc, data);
|
||||
return;
|
||||
}
|
||||
|
||||
if(data && data.swfCreated){
|
||||
mediaelement.setActive(elem, 'third', data);
|
||||
|
||||
|
||||
data.currentSrc = '';
|
||||
|
||||
|
||||
data.shadowElem.html('<div id="'+ elemId +'">');
|
||||
|
||||
|
||||
data.api = false;
|
||||
data.actionQueue = [];
|
||||
box = data.shadowElem;
|
||||
@ -743,7 +731,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
value: elem
|
||||
},
|
||||
currentSrc: {
|
||||
value: canPlaySrc.srcProp
|
||||
value: streamRequest ? '' : canPlaySrc.srcProp
|
||||
},
|
||||
swfCreated: {
|
||||
value: true
|
||||
@ -771,26 +759,27 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
box.insertBefore(elem);
|
||||
|
||||
|
||||
if(hasNative){
|
||||
$.extend(data, {volume: $.prop(elem, 'volume'), muted: $.prop(elem, 'muted'), paused: $.prop(elem, 'paused')});
|
||||
}
|
||||
|
||||
|
||||
webshims.addShadowDom(elem, box);
|
||||
if(!webshims.data(elem, 'mediaelement')){
|
||||
webshims.data(elem, 'mediaelement', data);
|
||||
}
|
||||
addMediaToStopEvents(elem);
|
||||
|
||||
|
||||
mediaelement.setActive(elem, 'third', data);
|
||||
|
||||
|
||||
setElementDimension(data, hasControls);
|
||||
|
||||
|
||||
$(elem)
|
||||
|
||||
.on({
|
||||
'updatemediaelementdimensions loadedmetadata emptied': setDimension,
|
||||
'remove': function(e){
|
||||
@ -804,14 +793,13 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
.onWSOff('updateshadowdom', setDimension)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
if(mediaelement.jarisEvent[data.id] && mediaelement.jarisEvent[data.id].elem != elem){
|
||||
webshims.error('something went wrong');
|
||||
return;
|
||||
} else if(!mediaelement.jarisEvent[data.id]){
|
||||
|
||||
|
||||
mediaelement.jarisEvent[data.id] = function(jaris){
|
||||
|
||||
if(jaris.type == 'ready'){
|
||||
var onReady = function(){
|
||||
if(data.api){
|
||||
@ -836,11 +824,11 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
if(!data._calledMeta && isNaN(jaris.duration) && data.duration != jaris.duration && isNaN(data.duration)){
|
||||
onEvent.onDataInitialized(jaris, data);
|
||||
}
|
||||
|
||||
|
||||
if(!data._ppFlag && jaris.type != 'onPlayPause'){
|
||||
onEvent.onPlayPause(jaris, data);
|
||||
}
|
||||
|
||||
|
||||
if(onEvent[jaris.type]){
|
||||
onEvent[jaris.type](jaris, data);
|
||||
}
|
||||
@ -850,29 +838,68 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
};
|
||||
mediaelement.jarisEvent[data.id].elem = elem;
|
||||
}
|
||||
|
||||
$.extend(vars,
|
||||
|
||||
createSwf(elem, canPlaySrc, data, elemId, hasControls, elemNodeName);
|
||||
|
||||
if(!streamRequest){
|
||||
trigger(data._elem, 'loadstart');
|
||||
}
|
||||
};
|
||||
|
||||
var createSwf = function(elem, canPlaySrc, data, elemId, hasControls, elemNodeName){
|
||||
var vars, elemVars, params, attrs;
|
||||
var isRtmp = canPlaySrc.type == 'audio/rtmp' || canPlaySrc.type == 'video/rtmp';
|
||||
var isUserStream = canPlaySrc.type == 'jarisplayer/stream';
|
||||
|
||||
vars = $.extend({}, options.vars, {
|
||||
poster: replaceVar($.attr(elem, 'poster') && $.prop(elem, 'poster') || ''),
|
||||
source: replaceVar(canPlaySrc.streamId || canPlaySrc.srcProp),
|
||||
server: replaceVar(canPlaySrc.server || '')
|
||||
});
|
||||
|
||||
elemVars = $(elem).data('vars') || {};
|
||||
|
||||
$.extend(vars,
|
||||
{
|
||||
id: elemId,
|
||||
evtId: data.id,
|
||||
controls: ''+hasControls,
|
||||
controls: ''+(!isUserStream && hasControls),
|
||||
autostart: 'false',
|
||||
nodename: elemNodeName
|
||||
},
|
||||
elemVars
|
||||
);
|
||||
|
||||
|
||||
if(isRtmp){
|
||||
vars.streamtype = 'rtmp';
|
||||
} else if(isUserStream){
|
||||
vars.streamtype = 'usermedia';
|
||||
} else if(canPlaySrc.type == 'audio/mpeg' || canPlaySrc.type == 'audio/mp3'){
|
||||
vars.type = 'audio';
|
||||
vars.streamtype = 'file';
|
||||
} else if(canPlaySrc.type == 'video/youtube'){
|
||||
vars.streamtype = 'youtube';
|
||||
}
|
||||
|
||||
attrs = $.extend(
|
||||
{},
|
||||
options.attrs,
|
||||
{
|
||||
name: elemId,
|
||||
id: elemId
|
||||
},
|
||||
$(elem).data('attrs')
|
||||
);
|
||||
|
||||
params = $.extend(
|
||||
{},
|
||||
options.params,
|
||||
$(elem).data('params')
|
||||
);
|
||||
|
||||
options.changeSWF(vars, elem, canPlaySrc, data, 'embed');
|
||||
clearTimeout(data.flashBlock);
|
||||
|
||||
|
||||
swfmini.embedSWF(playerSwfPath, elemId, "100%", "100%", "9.0.115", false, vars, params, attrs, function(swfData){
|
||||
if(swfData.success){
|
||||
var fBlocker = function(){
|
||||
@ -884,13 +911,13 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
$(swfData.ref).css({'minHeight': '2px', 'minWidth': '2px', display: 'block'});
|
||||
};
|
||||
data.api = swfData.ref;
|
||||
|
||||
|
||||
if(!hasControls){
|
||||
$(swfData.ref).attr('tabindex', '-1').css('outline', 'none');
|
||||
}
|
||||
|
||||
|
||||
data.flashBlock = setTimeout(fBlocker, 99);
|
||||
|
||||
|
||||
if(!localConnectionTimer){
|
||||
clearTimeout(localConnectionTimer);
|
||||
localConnectionTimer = setTimeout(function(){
|
||||
@ -904,23 +931,24 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
flash = null;
|
||||
}, 8000);
|
||||
}
|
||||
if(isUserStream){
|
||||
webshim.usermedia.request(elem, canPlaySrc, data);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
trigger(data._elem, 'loadstart');
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var queueSwfMethod = function(elem, fn, args, data){
|
||||
data = data || getSwfDataFromElem(elem);
|
||||
|
||||
|
||||
if(data){
|
||||
if(data.api && data.api[fn]){
|
||||
data.api[fn].apply(data.api, args || []);
|
||||
} else {
|
||||
//todo add to queue
|
||||
data.actionQueue.push({fn: fn, args: args});
|
||||
|
||||
|
||||
if(data.actionQueue.length > 10){
|
||||
setTimeout(function(){
|
||||
if(data.actionQueue.length > 5){
|
||||
@ -933,13 +961,14 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
mediaelement.queueSwfMethod = queueSwfMethod;
|
||||
|
||||
['audio', 'video'].forEach(function(nodeName){
|
||||
var descs = {};
|
||||
var mediaSup;
|
||||
var createGetProp = function(key){
|
||||
if(nodeName == 'audio' && (key == 'videoHeight' || key == 'videoWidth')){return;}
|
||||
|
||||
|
||||
descs[key] = {
|
||||
get: function(){
|
||||
var data = getSwfDataFromElem(this);
|
||||
@ -959,33 +988,33 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
delete descs[key].writeable;
|
||||
descs[key].set = setFn;
|
||||
};
|
||||
|
||||
|
||||
createGetSetProp('seeking');
|
||||
|
||||
|
||||
createGetSetProp('volume', function(v){
|
||||
var data = getSwfDataFromElem(this);
|
||||
if(data){
|
||||
v *= 1;
|
||||
if(!isNaN(v)){
|
||||
|
||||
|
||||
if(v < 0 || v > 1){
|
||||
webshims.error('volume greater or less than allowed '+ (v / 100));
|
||||
}
|
||||
|
||||
|
||||
queueSwfMethod(this, 'api_volume', [v], data);
|
||||
|
||||
|
||||
|
||||
|
||||
if(data.volume != v){
|
||||
data.volume = v;
|
||||
trigger(data._elem, 'volumechange');
|
||||
}
|
||||
data = null;
|
||||
}
|
||||
}
|
||||
} else if(mediaSup.volume.prop._supset) {
|
||||
return mediaSup.volume.prop._supset.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
createGetSetProp('muted', function(m){
|
||||
var data = getSwfDataFromElem(this);
|
||||
if(data){
|
||||
@ -1000,8 +1029,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
return mediaSup.muted.prop._supset.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
createGetSetProp('currentTime', function(t){
|
||||
var data = getSwfDataFromElem(this);
|
||||
if(data){
|
||||
@ -1009,23 +1038,23 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
if (!isNaN(t)) {
|
||||
queueSwfMethod(this, 'api_seek', [t], data);
|
||||
}
|
||||
|
||||
|
||||
} else if(mediaSup.currentTime.prop._supset) {
|
||||
return mediaSup.currentTime.prop._supset.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
['play', 'pause'].forEach(function(fn){
|
||||
descs[fn] = {
|
||||
value: function(){
|
||||
var data = getSwfDataFromElem(this);
|
||||
|
||||
|
||||
if(data){
|
||||
if(data.stopPlayPause){
|
||||
clearTimeout(data.stopPlayPause);
|
||||
}
|
||||
queueSwfMethod(this, fn == 'play' ? 'api_play' : 'api_pause', [], data);
|
||||
|
||||
|
||||
data._ppFlag = true;
|
||||
if(data.paused != (fn != 'play')){
|
||||
data.paused = fn != 'play';
|
||||
@ -1037,14 +1066,14 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
getPropKeys.forEach(createGetProp);
|
||||
|
||||
|
||||
webshims.onNodeNamesPropertyModify(nodeName, 'controls', function(val, boolProp){
|
||||
var data = getSwfDataFromElem(this);
|
||||
|
||||
|
||||
$(this)[boolProp ? 'addClass' : 'removeClass']('webshims-controls');
|
||||
|
||||
|
||||
if(data){
|
||||
if(nodeName == 'audio'){
|
||||
setElementDimension(data, boolProp);
|
||||
@ -1052,12 +1081,12 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
queueSwfMethod(this, 'api_controls', [boolProp], data);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
webshims.onNodeNamesPropertyModify(nodeName, 'preload', function(val){
|
||||
var data, baseData, elem;
|
||||
|
||||
|
||||
|
||||
|
||||
if(bufferSrc(this)){
|
||||
data = getSwfDataFromElem(this);
|
||||
if(data){
|
||||
@ -1072,9 +1101,9 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mediaSup = webshims.defineNodeNameProperties(nodeName, descs, 'prop');
|
||||
|
||||
|
||||
if(!support.mediaDefaultMuted){
|
||||
webshims.defineNodeNameProperties(nodeName, {
|
||||
defaultMuted: {
|
||||
@ -1092,8 +1121,68 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
}, 'prop');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
var addCanvasBridge = function(){
|
||||
if(!window.CanvasRenderingContext2D){
|
||||
return false;
|
||||
}
|
||||
var _drawImage = CanvasRenderingContext2D.prototype.drawImage;
|
||||
var slice = Array.prototype.slice;
|
||||
var isVideo = {
|
||||
video: 1,
|
||||
VIDEO: 1
|
||||
};
|
||||
var tested = {};
|
||||
|
||||
if(!_drawImage){
|
||||
webshim.error('canvas.drawImage feature is needed. In IE8 flashvanvas pro can be used');
|
||||
}
|
||||
|
||||
CanvasRenderingContext2D.prototype.drawImage = function(elem){
|
||||
var data, img, args, imgData;
|
||||
var context = this;
|
||||
|
||||
if(isVideo[elem.nodeName] && (data = webshims.data(elem, 'mediaelement')) && data.isActive == 'third' && data.api.api_image){
|
||||
|
||||
try {
|
||||
imgData = data.api.api_image();
|
||||
} catch (er){
|
||||
webshims.error(er);
|
||||
}
|
||||
if(!tested[data.currentSrc]){
|
||||
tested[data.currentSrc] = true;
|
||||
if(imgData == null){
|
||||
webshims.error('video has to be same origin or a crossdomain.xml has to be provided. Video has to be visible for flash API');
|
||||
}
|
||||
}
|
||||
|
||||
args = slice.call(arguments, 1);
|
||||
img = new Image();
|
||||
|
||||
//todo find a performant sync way
|
||||
img.onload = function(){
|
||||
args.unshift(this);
|
||||
_drawImage.apply(context, args);
|
||||
img.onload = null;
|
||||
};
|
||||
|
||||
img.src = 'data:image/jpeg;base64,'+imgData;
|
||||
|
||||
if(img.complete){
|
||||
img.onload();
|
||||
}
|
||||
return;
|
||||
}
|
||||
return _drawImage.apply(this, arguments);
|
||||
};
|
||||
return true;
|
||||
};
|
||||
|
||||
if(!addCanvasBridge()){
|
||||
webshims.ready('canvas', addCanvasBridge);
|
||||
}
|
||||
|
||||
|
||||
if(hasFlash && $.cleanData){
|
||||
var oldClean = $.cleanData;
|
||||
var objElem = document.createElement('object');
|
||||
@ -1107,12 +1196,12 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
object: 1,
|
||||
OBJECT: 1
|
||||
};
|
||||
|
||||
|
||||
$.cleanData = function(elems){
|
||||
var i, len, prop;
|
||||
var ret = oldClean.apply(this, arguments);
|
||||
if(elems && (len = elems.length) && loadedSwf){
|
||||
|
||||
|
||||
for(i = 0; i < len; i++){
|
||||
if(flashNames[elems[i].nodeName] && 'api_destroy' in elems[i]){
|
||||
loadedSwf--;
|
||||
@ -1128,14 +1217,14 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
} catch(er){console.log(er);}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
|
||||
if(!hasNative){
|
||||
|
||||
|
||||
['poster', 'src'].forEach(function(prop){
|
||||
webshims.defineNodeNamesProperty(prop == 'src' ? ['audio', 'video', 'source'] : ['video'], prop, {
|
||||
//attr: {},
|
||||
@ -1143,21 +1232,21 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
propType: 'src'
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
webshims.defineNodeNamesProperty(['audio', 'video'], 'preload', {
|
||||
reflect: true,
|
||||
propType: 'enumarated',
|
||||
defaultValue: '',
|
||||
limitedTo: ['', 'auto', 'metadata', 'none']
|
||||
});
|
||||
|
||||
|
||||
webshims.reflectProperties('source', ['type', 'media']);
|
||||
|
||||
|
||||
|
||||
|
||||
['autoplay', 'controls'].forEach(function(name){
|
||||
webshims.defineNodeNamesBooleanProperty(['audio', 'video'], name);
|
||||
});
|
||||
|
||||
|
||||
webshims.defineNodeNamesProperties(['audio', 'video'], {
|
||||
HAVE_CURRENT_DATA: {
|
||||
value: 2
|
||||
@ -1186,7 +1275,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
NETWORK_NO_SOURCE: {
|
||||
value: 3
|
||||
}
|
||||
|
||||
|
||||
}, 'prop');
|
||||
|
||||
|
||||
@ -1212,7 +1301,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
|
||||
var media, error, parent;
|
||||
if(
|
||||
($(e.target).is('audio, video') || ((parent = e.target.parentNode) && $('source', parent).last()[0] == e.target)) &&
|
||||
(media = $(e.target).closest('audio, video')) && !media.hasClass('nonnative-api-active')
|
||||
(media = $(e.target).closest('audio, video')) && !media.hasClass('nonnative-api-active')
|
||||
){
|
||||
error = media.prop('error');
|
||||
setTimeout(function(){
|
||||
|
@ -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,17 +562,18 @@ 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();
|
||||
}
|
||||
});
|
||||
})();
|
||||
} );
|
||||
|
||||
|
||||
|
@ -9,15 +9,7 @@
|
||||
* http://api.jqueryui.com/position/
|
||||
*/
|
||||
(function( factory ) {
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "jquery" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( window.webshims && window.webshims.$ || jQuery );
|
||||
}
|
||||
factory( window.webshims && window.webshims.$ || jQuery );
|
||||
}(function( $ ) {
|
||||
(function() {
|
||||
|
||||
|
@ -2031,14 +2031,7 @@
|
||||
}
|
||||
|
||||
// EXPOSE
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
define(function() { return Sizzle; });
|
||||
// Sizzle requires that there be a global window in Common-JS like environments
|
||||
} else if ( typeof module !== "undefined" && module.exports ) {
|
||||
module.exports = Sizzle;
|
||||
} else {
|
||||
window.Sizzle = Sizzle;
|
||||
}
|
||||
window.Sizzle = Sizzle;
|
||||
// EXPOSE
|
||||
|
||||
|
||||
|
@ -298,6 +298,10 @@ input[type="color"] {
|
||||
margin-left: 0;
|
||||
margin-right: -24px;
|
||||
}
|
||||
.input-button-size-1.number-input-buttons.ws-is-rtl {
|
||||
margin-left: 0;
|
||||
margin-right: -19px;
|
||||
}
|
||||
|
||||
.input-button-size-2 {
|
||||
margin-left: -39px;
|
||||
|
@ -203,6 +203,11 @@ input[type="color"] {
|
||||
margin-right: -24px;
|
||||
}
|
||||
}
|
||||
|
||||
&.number-input-buttons.ws-is-rtl {
|
||||
margin-left: 0;
|
||||
margin-right: -19px;
|
||||
}
|
||||
}
|
||||
.input-button-size-2 {
|
||||
margin-left: -39px;
|
||||
|
@ -981,6 +981,10 @@ input[type="color"] {
|
||||
margin-left: 0;
|
||||
margin-right: -24px;
|
||||
}
|
||||
.input-button-size-1.number-input-buttons.ws-is-rtl {
|
||||
margin-left: 0;
|
||||
margin-right: -19px;
|
||||
}
|
||||
|
||||
.input-button-size-2 {
|
||||
margin-left: -39px;
|
||||
|
Binary file not shown.
@ -456,11 +456,29 @@ webshims.register('track', function($, webshims, window, document, undefined){
|
||||
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:
|
||||
@ -711,7 +729,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);
|
||||
|
Loading…
Reference in New Issue
Block a user