Mise à jour webshims

This commit is contained in:
echarp 2014-08-01 01:38:33 +02:00
parent 25d6e855a4
commit 68af1d70cb
52 changed files with 1993 additions and 1192 deletions

View File

@ -61,5 +61,5 @@
%a#banner(href='http://april.org/campagne') %a#banner(href='http://april.org/campagne')
-#%img(src='http://www.april.org/campagne/images/priorite-logiciel-libre-je-soutiens-april.png' -#%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.') 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.') width='374' height='48' alt='Priorité au Logiciel Libre! Je soutiens l\'April.')

View File

@ -107,7 +107,8 @@
var featureAlias = { var featureAlias = {
matchmedia: 'matchMedia', matchmedia: 'matchMedia',
xhr2: 'filereader', xhr2: 'filereader',
promise: 'es6' promise: 'es6',
URL: 'url'
}; };
clearInterval(webshims.timer); clearInterval(webshims.timer);
@ -126,7 +127,7 @@
} }
$.extend(webshims, { $.extend(webshims, {
version: '1.14.5', version: '1.14.6',
cfg: { cfg: {
enhanceAuto: window.Audio && (!window.matchMedia || matchMedia('(min-device-width: 721px)').matches), enhanceAuto: window.Audio && (!window.matchMedia || matchMedia('(min-device-width: 721px)').matches),
@ -623,6 +624,7 @@
error: 1 error: 1
}; };
var $fn = $.fn; var $fn = $.fn;
var video = create('video');
webshims.addMethodName = function(name){ webshims.addMethodName = function(name){
name = name.split(':'); name = name.split(':');
@ -968,6 +970,22 @@
c: [21] 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 //<canvas
(function(){ (function(){
@ -1007,6 +1025,7 @@
var initialFormTest = function(){ var initialFormTest = function(){
var tmp, fieldset; var tmp, fieldset;
var testValue = '1(';
var input = create('input'); var input = create('input');
fieldset = $('<fieldset><textarea required="" /></fieldset>')[0]; fieldset = $('<fieldset><textarea required="" /></fieldset>')[0];
@ -1014,7 +1033,7 @@
$.each(['range', 'date', 'datetime-local', 'month', 'color', 'number'], function(i, type){ $.each(['range', 'date', 'datetime-local', 'month', 'color', 'number'], function(i, type){
input.setAttribute('type', 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); 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 //<mediaelement
(function(){ (function(){
webshims.mediaelement = {}; webshims.mediaelement = {};
var video = create('video');
var track = create('track'); var track = create('track');
support.mediaelement = ('canPlayType' in video); support.mediaelement = ('canPlayType' in video);
support.texttrackapi = ('addTextTrack' in video); support.texttrackapi = ('addTextTrack' in video);
@ -1273,7 +1305,7 @@
d: ['swfmini'], d: ['swfmini'],
c: [16, 7, 2, 8, 1, 12, 13, 23] c: [16, 7, 2, 8, 1, 12, 13, 23]
}); });
addPolyfill('mediaelement-jaris', { addPolyfill('mediaelement-jaris', {
f: 'mediaelement', f: 'mediaelement',
@ -1288,7 +1320,7 @@
if(options.preferFlash && !modules.swfmini.test()){ if(options.preferFlash && !modules.swfmini.test()){
options.preferFlash = false; options.preferFlash = false;
} }
return !( options.preferFlash && swfmini.hasFlashPlayerVersion('10.0.3') ); return !( options.preferFlash && swfmini.hasFlashPlayerVersion('11.3') );
}, },
c: [21, 25] c: [21, 25]
}); });

View File

@ -607,7 +607,7 @@ webshims.isReady('swfmini', true);
} }
webshims.register('mediaelement-core', function($, webshims, window, document, undefined, options){ 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; var mediaelement = webshims.mediaelement;
mediaelement.parseRtmp = function(data){ mediaelement.parseRtmp = function(data){
@ -717,6 +717,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
loadYt(); loadYt();
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, 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){ if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
return 'video/youtube'; 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'; return nodeName+'/rtmp';
} }
src = src.split('?')[0].split('#')[0].split('.'); 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); mediaElem = $(mediaElem);
if(!srces){ var nodeName = mediaElem[0].nodeName.toLowerCase();
srces = []; var src = getSrcObj(mediaElem, nodeName);
var nodeName = mediaElem[0].nodeName.toLowerCase();
var src = getSrcObj(mediaElem, nodeName); if(!src.src){
$('source', mediaElem).each(function(){
if(!src.src){ src = getSrcObj(this, nodeName);
$('source', mediaElem).each(function(){ if(src.src){srces.push(src);}
src = getSrcObj(this, nodeName); });
if(src.src){srces.push(src);}
});
} else {
srces.push(src);
}
return srces;
} else { } 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){ mediaelement.canThirdPlaySrces = function(mediaElem, srces){
var ret = ''; var ret = '';
@ -829,7 +835,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
srces = srces || mediaelement.srces(mediaElem); srces = srces || mediaelement.srces(mediaElem);
$.each(srces, function(i, src){ $.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; ret = src;
return false; return false;
} }

View File

@ -60,7 +60,6 @@
webshims.register('dom-extend', function($, webshims, window, document, undefined){ webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict"; "use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true; webshims.assumeARIA = true;
@ -91,7 +90,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
//shortcus //shortcus
var modules = webshims.modules;
var listReg = /\s*,\s*/; var listReg = /\s*,\s*/;
//proxying attribute //proxying attribute
@ -476,8 +474,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
} }
}; };
var elementExtends = {};
return { return {
createTmpCache: function(nodeName){ createTmpCache: function(nodeName){
if($.isDOMReady){ if($.isDOMReady){
@ -529,6 +526,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
$.extend(webshims, { $.extend(webshims, {
xProps: havePolyfill,
getID: (function(){ getID: (function(){
var ID = new Date().getTime(); var ID = new Date().getTime();
return function(elem){ return function(elem){
@ -542,6 +540,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
return id; 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()), shadowClass: 'wsshadow-'+(Date.now()),
implement: function(elem, type){ implement: function(elem, type){
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});
@ -2255,22 +2273,36 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
return val; return val;
}, },
time: function(val){ time: function(val, o, noCorrect){
var fVal; var fVal, i;
if(val && curCfg.meridian){ if(val){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); if(curCfg.meridian){
if(fVal && fVal >= 12){ fVal = (val[0] * 1);
val[0] = addZero(fVal - 12+''); if(fVal && fVal >= 12){
fVal = 1; val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { } else {
fVal = 0; fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ if(!noCorrect){
val[0] = '12'; 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; return val;
}, },
@ -2359,12 +2391,15 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
var fVal; var fVal;
if(val && curCfg.meridian){ if(val && curCfg.meridian){
val = val.toUpperCase(); val = val.toUpperCase();
if(val.substr(0,2) === "12"){ if(val.substr(0,2) === "12"){
val = "00" + val.substr(2); val = "00" + val.substr(2);
} }
if(val.indexOf(curCfg.meridian[1]) != -1){ if(val.indexOf(curCfg.meridian[1]) != -1){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); fVal = (val[0].replace(curCfg.meridian[1], '') * 1);
if(!isNaN(fVal)){ if(!isNaN(fVal)){
val[0] = fVal + 12; val[0] = fVal + 12;
} }

View File

@ -1042,22 +1042,36 @@
} }
return val; return val;
}, },
time: function(val){ time: function(val, o, noCorrect){
var fVal; var fVal, i;
if(val && curCfg.meridian){ if(val){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); if(curCfg.meridian){
if(fVal && fVal >= 12){ fVal = (val[0] * 1);
val[0] = addZero(fVal - 12+''); if(fVal && fVal >= 12){
fVal = 1; val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { } else {
fVal = 0; fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ if(!noCorrect){
val[0] = '12'; 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; return val;
}, },
@ -1146,12 +1160,15 @@
var fVal; var fVal;
if(val && curCfg.meridian){ if(val && curCfg.meridian){
val = val.toUpperCase(); val = val.toUpperCase();
if(val.substr(0,2) === "12"){ if(val.substr(0,2) === "12"){
val = "00" + val.substr(2); val = "00" + val.substr(2);
} }
if(val.indexOf(curCfg.meridian[1]) != -1){ if(val.indexOf(curCfg.meridian[1]) != -1){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); fVal = (val[0].replace(curCfg.meridian[1], '') * 1);
if(!isNaN(fVal)){ if(!isNaN(fVal)){
val[0] = fVal + 12; val[0] = fVal + 12;
} }

View File

@ -282,7 +282,7 @@ webshims.isReady('swfmini', true);
} }
webshims.register('mediaelement-core', function($, webshims, window, document, undefined, options){ 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; var mediaelement = webshims.mediaelement;
mediaelement.parseRtmp = function(data){ mediaelement.parseRtmp = function(data){
@ -392,6 +392,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
loadYt(); loadYt();
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, 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){ if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
return 'video/youtube'; 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'; return nodeName+'/rtmp';
} }
src = src.split('?')[0].split('#')[0].split('.'); 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); mediaElem = $(mediaElem);
if(!srces){ var nodeName = mediaElem[0].nodeName.toLowerCase();
srces = []; var src = getSrcObj(mediaElem, nodeName);
var nodeName = mediaElem[0].nodeName.toLowerCase();
var src = getSrcObj(mediaElem, nodeName); if(!src.src){
$('source', mediaElem).each(function(){
if(!src.src){ src = getSrcObj(this, nodeName);
$('source', mediaElem).each(function(){ if(src.src){srces.push(src);}
src = getSrcObj(this, nodeName); });
if(src.src){srces.push(src);}
});
} else {
srces.push(src);
}
return srces;
} else { } 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){ mediaelement.canThirdPlaySrces = function(mediaElem, srces){
var ret = ''; var ret = '';
@ -504,7 +510,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
srces = srces || mediaelement.srces(mediaElem); srces = srces || mediaelement.srces(mediaElem);
$.each(srces, function(i, src){ $.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; ret = src;
return false; 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'); webshims.error('you must provide a language for track in subtitles state');
} }
obj.__wsmode = obj.mode; obj.__wsmode = obj.mode;
webshims.defineProperty(obj, '_wsUpdateMode', {
value: function(){
$(mediaelem).triggerHandler('updatetrackdisplay');
},
enumerable: false
});
} }
return obj; 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: taken from:
@ -1474,7 +1498,7 @@ modified for webshims
var name = copyName[copyProp] || copyProp; var name = copyName[copyProp] || copyProp;
webshims.onNodeNamesPropertyModify('track', copyProp, function(){ webshims.onNodeNamesPropertyModify('track', copyProp, function(){
var trackData = webshims.data(this, 'trackData'); var trackData = webshims.data(this, 'trackData');
var track = this;
if(trackData){ if(trackData){
if(copyProp == 'kind'){ if(copyProp == 'kind'){
refreshTrack(this, trackData); refreshTrack(this, trackData);

View File

@ -59,7 +59,7 @@
} }
webshims.register('mediaelement-core', function($, webshims, window, document, undefined, options){ 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; var mediaelement = webshims.mediaelement;
mediaelement.parseRtmp = function(data){ mediaelement.parseRtmp = function(data){
@ -169,6 +169,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
loadYt(); loadYt();
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, 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){ if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
return 'video/youtube'; 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'; return nodeName+'/rtmp';
} }
src = src.split('?')[0].split('#')[0].split('.'); 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); mediaElem = $(mediaElem);
if(!srces){ var nodeName = mediaElem[0].nodeName.toLowerCase();
srces = []; var src = getSrcObj(mediaElem, nodeName);
var nodeName = mediaElem[0].nodeName.toLowerCase();
var src = getSrcObj(mediaElem, nodeName); if(!src.src){
$('source', mediaElem).each(function(){
if(!src.src){ src = getSrcObj(this, nodeName);
$('source', mediaElem).each(function(){ if(src.src){srces.push(src);}
src = getSrcObj(this, nodeName); });
if(src.src){srces.push(src);}
});
} else {
srces.push(src);
}
return srces;
} else { } 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){ mediaelement.canThirdPlaySrces = function(mediaElem, srces){
var ret = ''; var ret = '';
@ -281,7 +287,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
srces = srces || mediaelement.srces(mediaElem); srces = srces || mediaelement.srces(mediaElem);
$.each(srces, function(i, src){ $.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; ret = src;
return false; 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'); webshims.error('you must provide a language for track in subtitles state');
} }
obj.__wsmode = obj.mode; obj.__wsmode = obj.mode;
webshims.defineProperty(obj, '_wsUpdateMode', {
value: function(){
$(mediaelem).triggerHandler('updatetrackdisplay');
},
enumerable: false
});
} }
return obj; 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: taken from:
@ -1251,7 +1275,7 @@ modified for webshims
var name = copyName[copyProp] || copyProp; var name = copyName[copyProp] || copyProp;
webshims.onNodeNamesPropertyModify('track', copyProp, function(){ webshims.onNodeNamesPropertyModify('track', copyProp, function(){
var trackData = webshims.data(this, 'trackData'); var trackData = webshims.data(this, 'trackData');
var track = this;
if(trackData){ if(trackData){
if(copyProp == 'kind'){ if(copyProp == 'kind'){
refreshTrack(this, trackData); refreshTrack(this, trackData);

View File

@ -60,7 +60,6 @@
webshims.register('dom-extend', function($, webshims, window, document, undefined){ webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict"; "use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true; webshims.assumeARIA = true;
@ -91,7 +90,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
//shortcus //shortcus
var modules = webshims.modules;
var listReg = /\s*,\s*/; var listReg = /\s*,\s*/;
//proxying attribute //proxying attribute
@ -476,8 +474,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
} }
}; };
var elementExtends = {};
return { return {
createTmpCache: function(nodeName){ createTmpCache: function(nodeName){
if($.isDOMReady){ if($.isDOMReady){
@ -529,6 +526,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
$.extend(webshims, { $.extend(webshims, {
xProps: havePolyfill,
getID: (function(){ getID: (function(){
var ID = new Date().getTime(); var ID = new Date().getTime();
return function(elem){ return function(elem){
@ -542,6 +540,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
return id; 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()), shadowClass: 'wsshadow-'+(Date.now()),
implement: function(elem, type){ implement: function(elem, type){
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});

View File

@ -283,7 +283,6 @@ webshims.isReady('swfmini', true);
webshims.register('dom-extend', function($, webshims, window, document, undefined){ webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict"; "use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true; webshims.assumeARIA = true;
@ -314,7 +313,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
//shortcus //shortcus
var modules = webshims.modules;
var listReg = /\s*,\s*/; var listReg = /\s*,\s*/;
//proxying attribute //proxying attribute
@ -699,8 +697,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
} }
}; };
var elementExtends = {};
return { return {
createTmpCache: function(nodeName){ createTmpCache: function(nodeName){
if($.isDOMReady){ if($.isDOMReady){
@ -752,6 +749,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
$.extend(webshims, { $.extend(webshims, {
xProps: havePolyfill,
getID: (function(){ getID: (function(){
var ID = new Date().getTime(); var ID = new Date().getTime();
return function(elem){ return function(elem){
@ -765,6 +763,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
return id; 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()), shadowClass: 'wsshadow-'+(Date.now()),
implement: function(elem, type){ implement: function(elem, type){
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); 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){ 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; var mediaelement = webshims.mediaelement;
mediaelement.parseRtmp = function(data){ mediaelement.parseRtmp = function(data){
@ -3346,6 +3364,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
loadYt(); loadYt();
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, 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){ if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
return 'video/youtube'; 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'; return nodeName+'/rtmp';
} }
src = src.split('?')[0].split('#')[0].split('.'); 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); mediaElem = $(mediaElem);
if(!srces){ var nodeName = mediaElem[0].nodeName.toLowerCase();
srces = []; var src = getSrcObj(mediaElem, nodeName);
var nodeName = mediaElem[0].nodeName.toLowerCase();
var src = getSrcObj(mediaElem, nodeName); if(!src.src){
$('source', mediaElem).each(function(){
if(!src.src){ src = getSrcObj(this, nodeName);
$('source', mediaElem).each(function(){ if(src.src){srces.push(src);}
src = getSrcObj(this, nodeName); });
if(src.src){srces.push(src);}
});
} else {
srces.push(src);
}
return srces;
} else { } 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){ mediaelement.canThirdPlaySrces = function(mediaElem, srces){
var ret = ''; var ret = '';
@ -3458,7 +3482,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
srces = srces || mediaelement.srces(mediaElem); srces = srces || mediaelement.srces(mediaElem);
$.each(srces, function(i, src){ $.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; ret = src;
return false; return false;
} }

View File

@ -1658,22 +1658,36 @@ webshims.register('form-number-date-api', function($, webshims, window, document
} }
return val; return val;
}, },
time: function(val){ time: function(val, o, noCorrect){
var fVal; var fVal, i;
if(val && curCfg.meridian){ if(val){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); if(curCfg.meridian){
if(fVal && fVal >= 12){ fVal = (val[0] * 1);
val[0] = addZero(fVal - 12+''); if(fVal && fVal >= 12){
fVal = 1; val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { } else {
fVal = 0; fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ if(!noCorrect){
val[0] = '12'; 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; return val;
}, },
@ -1762,12 +1776,15 @@ webshims.register('form-number-date-api', function($, webshims, window, document
var fVal; var fVal;
if(val && curCfg.meridian){ if(val && curCfg.meridian){
val = val.toUpperCase(); val = val.toUpperCase();
if(val.substr(0,2) === "12"){ if(val.substr(0,2) === "12"){
val = "00" + val.substr(2); val = "00" + val.substr(2);
} }
if(val.indexOf(curCfg.meridian[1]) != -1){ if(val.indexOf(curCfg.meridian[1]) != -1){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); fVal = (val[0].replace(curCfg.meridian[1], '') * 1);
if(!isNaN(fVal)){ if(!isNaN(fVal)){
val[0] = fVal + 12; val[0] = fVal + 12;
} }

View File

@ -1,5 +1,4 @@
(function(){ webshim.ready('matchMedia', function($, webshim, w, doc, undefined){
"use strict";
try { try {
new Image(); new Image();
} catch(e){ } catch(e){
@ -7,75 +6,8 @@
return document.createElement('img'); return document.createElement('img');
}; };
} }
webshim.isReady('picture', true); webshim.isReady('picture', true);
setTimeout(function(){ // Enable strict mode
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
"use strict"; "use strict";
// If picture is supported, well, that's awesome. Let's get outta here... // 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" ) { if ( source.nodeName.toUpperCase() !== "SOURCE" ) {
continue; 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" ); var media = source.getAttribute( "media" );
@ -626,18 +562,19 @@ window.matchMedia || (window.matchMedia = function() {
picturefill._ = pf; picturefill._ = pf;
/* expose picturefill */ /* expose picturefill */
if ( typeof module === "object" && typeof module.exports === "object" ) { w.picturefill = picturefill;
// 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;
}
} )( 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 */ ;/*! 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 */

View File

@ -283,7 +283,6 @@ webshims.isReady('swfmini', true);
webshims.register('dom-extend', function($, webshims, window, document, undefined){ webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict"; "use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true; webshims.assumeARIA = true;
@ -314,7 +313,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
//shortcus //shortcus
var modules = webshims.modules;
var listReg = /\s*,\s*/; var listReg = /\s*,\s*/;
//proxying attribute //proxying attribute
@ -699,8 +697,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
} }
}; };
var elementExtends = {};
return { return {
createTmpCache: function(nodeName){ createTmpCache: function(nodeName){
if($.isDOMReady){ if($.isDOMReady){
@ -752,6 +749,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
$.extend(webshims, { $.extend(webshims, {
xProps: havePolyfill,
getID: (function(){ getID: (function(){
var ID = new Date().getTime(); var ID = new Date().getTime();
return function(elem){ return function(elem){
@ -765,6 +763,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
return id; 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()), shadowClass: 'wsshadow-'+(Date.now()),
implement: function(elem, type){ implement: function(elem, type){
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); 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){ 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; var mediaelement = webshims.mediaelement;
mediaelement.parseRtmp = function(data){ mediaelement.parseRtmp = function(data){
@ -2227,6 +2245,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
loadYt(); loadYt();
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, 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){ if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
return 'video/youtube'; 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'; return nodeName+'/rtmp';
} }
src = src.split('?')[0].split('#')[0].split('.'); 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); mediaElem = $(mediaElem);
if(!srces){ var nodeName = mediaElem[0].nodeName.toLowerCase();
srces = []; var src = getSrcObj(mediaElem, nodeName);
var nodeName = mediaElem[0].nodeName.toLowerCase();
var src = getSrcObj(mediaElem, nodeName); if(!src.src){
$('source', mediaElem).each(function(){
if(!src.src){ src = getSrcObj(this, nodeName);
$('source', mediaElem).each(function(){ if(src.src){srces.push(src);}
src = getSrcObj(this, nodeName); });
if(src.src){srces.push(src);}
});
} else {
srces.push(src);
}
return srces;
} else { } 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){ mediaelement.canThirdPlaySrces = function(mediaElem, srces){
var ret = ''; var ret = '';
@ -2339,7 +2363,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
srces = srces || mediaelement.srces(mediaElem); srces = srces || mediaelement.srces(mediaElem);
$.each(srces, function(i, src){ $.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; ret = src;
return false; return false;
} }

File diff suppressed because it is too large Load Diff

View File

@ -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'); webshims.error('you must provide a language for track in subtitles state');
} }
obj.__wsmode = obj.mode; obj.__wsmode = obj.mode;
webshims.defineProperty(obj, '_wsUpdateMode', {
value: function(){
$(mediaelem).triggerHandler('updatetrackdisplay');
},
enumerable: false
});
} }
return obj; 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: taken from:
@ -859,7 +877,7 @@ modified for webshims
var name = copyName[copyProp] || copyProp; var name = copyName[copyProp] || copyProp;
webshims.onNodeNamesPropertyModify('track', copyProp, function(){ webshims.onNodeNamesPropertyModify('track', copyProp, function(){
var trackData = webshims.data(this, 'trackData'); var trackData = webshims.data(this, 'trackData');
var track = this;
if(trackData){ if(trackData){
if(copyProp == 'kind'){ if(copyProp == 'kind'){
refreshTrack(this, trackData); refreshTrack(this, trackData);

View File

@ -282,7 +282,7 @@ webshims.isReady('swfmini', true);
} }
webshims.register('mediaelement-core', function($, webshims, window, document, undefined, options){ 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; var mediaelement = webshims.mediaelement;
mediaelement.parseRtmp = function(data){ mediaelement.parseRtmp = function(data){
@ -392,6 +392,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
loadYt(); loadYt();
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, 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){ if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
return 'video/youtube'; 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'; return nodeName+'/rtmp';
} }
src = src.split('?')[0].split('#')[0].split('.'); 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); mediaElem = $(mediaElem);
if(!srces){ var nodeName = mediaElem[0].nodeName.toLowerCase();
srces = []; var src = getSrcObj(mediaElem, nodeName);
var nodeName = mediaElem[0].nodeName.toLowerCase();
var src = getSrcObj(mediaElem, nodeName); if(!src.src){
$('source', mediaElem).each(function(){
if(!src.src){ src = getSrcObj(this, nodeName);
$('source', mediaElem).each(function(){ if(src.src){srces.push(src);}
src = getSrcObj(this, nodeName); });
if(src.src){srces.push(src);}
});
} else {
srces.push(src);
}
return srces;
} else { } 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){ mediaelement.canThirdPlaySrces = function(mediaElem, srces){
var ret = ''; var ret = '';
@ -504,7 +510,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
srces = srces || mediaelement.srces(mediaElem); srces = srces || mediaelement.srces(mediaElem);
$.each(srces, function(i, src){ $.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; ret = src;
return false; return false;
} }

File diff suppressed because it is too large Load Diff

View File

@ -7679,24 +7679,29 @@ Globally exposed namespace with the most frequently used public classes and hand
} catch(e){} } catch(e){}
printMessage(); printMessage();
if(hasXDomain == null){ if(hasXDomain == null){
$.ajax({ try {
url: 'crossdomain.xml', $.ajax({
type: 'HEAD', url: 'crossdomain.xml',
dataType: 'xml', type: 'HEAD',
success: function(){ dataType: 'xml',
hasXDomain = 'yes'; success: function(){
}, hasXDomain = 'yes';
error: function(){ },
hasXDomain = 'no'; error: function(){
}, hasXDomain = 'no';
complete: function(){ },
try { complete: function(){
sessionStorage.setItem('wsXdomain.xml', hasXDomain); try {
} catch(e){} sessionStorage.setItem('wsXdomain.xml', hasXDomain);
printMessage(); } catch(e){}
} printMessage();
}); }
});
} catch(e){}
} }
}); });
} }
if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
}); });

View File

@ -1698,24 +1698,29 @@ webshims.register('form-shim-extend2', function($, webshims, window, document, u
} catch(e){} } catch(e){}
printMessage(); printMessage();
if(hasXDomain == null){ if(hasXDomain == null){
$.ajax({ try {
url: 'crossdomain.xml', $.ajax({
type: 'HEAD', url: 'crossdomain.xml',
dataType: 'xml', type: 'HEAD',
success: function(){ dataType: 'xml',
hasXDomain = 'yes'; success: function(){
}, hasXDomain = 'yes';
error: function(){ },
hasXDomain = 'no'; error: function(){
}, hasXDomain = 'no';
complete: function(){ },
try { complete: function(){
sessionStorage.setItem('wsXdomain.xml', hasXDomain); try {
} catch(e){} sessionStorage.setItem('wsXdomain.xml', hasXDomain);
printMessage(); } catch(e){}
} printMessage();
}); }
});
} catch(e){}
} }
}); });
} }
if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
}); });

View File

@ -60,7 +60,6 @@
webshims.register('dom-extend', function($, webshims, window, document, undefined){ webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict"; "use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true; webshims.assumeARIA = true;
@ -91,7 +90,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
//shortcus //shortcus
var modules = webshims.modules;
var listReg = /\s*,\s*/; var listReg = /\s*,\s*/;
//proxying attribute //proxying attribute
@ -476,8 +474,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
} }
}; };
var elementExtends = {};
return { return {
createTmpCache: function(nodeName){ createTmpCache: function(nodeName){
if($.isDOMReady){ if($.isDOMReady){
@ -529,6 +526,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
$.extend(webshims, { $.extend(webshims, {
xProps: havePolyfill,
getID: (function(){ getID: (function(){
var ID = new Date().getTime(); var ID = new Date().getTime();
return function(elem){ return function(elem){
@ -542,6 +540,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
return id; 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()), shadowClass: 'wsshadow-'+(Date.now()),
implement: function(elem, type){ implement: function(elem, type){
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});

View File

@ -60,7 +60,6 @@
webshims.register('dom-extend', function($, webshims, window, document, undefined){ webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict"; "use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true; webshims.assumeARIA = true;
@ -91,7 +90,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
//shortcus //shortcus
var modules = webshims.modules;
var listReg = /\s*,\s*/; var listReg = /\s*,\s*/;
//proxying attribute //proxying attribute
@ -476,8 +474,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
} }
}; };
var elementExtends = {};
return { return {
createTmpCache: function(nodeName){ createTmpCache: function(nodeName){
if($.isDOMReady){ if($.isDOMReady){
@ -529,6 +526,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
$.extend(webshims, { $.extend(webshims, {
xProps: havePolyfill,
getID: (function(){ getID: (function(){
var ID = new Date().getTime(); var ID = new Date().getTime();
return function(elem){ return function(elem){
@ -542,6 +540,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
return id; 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()), shadowClass: 'wsshadow-'+(Date.now()),
implement: function(elem, type){ implement: function(elem, type){
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});

View File

@ -60,7 +60,6 @@
webshims.register('dom-extend', function($, webshims, window, document, undefined){ webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict"; "use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true; webshims.assumeARIA = true;
@ -91,7 +90,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
//shortcus //shortcus
var modules = webshims.modules;
var listReg = /\s*,\s*/; var listReg = /\s*,\s*/;
//proxying attribute //proxying attribute
@ -476,8 +474,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
} }
}; };
var elementExtends = {};
return { return {
createTmpCache: function(nodeName){ createTmpCache: function(nodeName){
if($.isDOMReady){ if($.isDOMReady){
@ -529,6 +526,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
$.extend(webshims, { $.extend(webshims, {
xProps: havePolyfill,
getID: (function(){ getID: (function(){
var ID = new Date().getTime(); var ID = new Date().getTime();
return function(elem){ return function(elem){
@ -542,6 +540,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
return id; 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()), shadowClass: 'wsshadow-'+(Date.now()),
implement: function(elem, type){ implement: function(elem, type){
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});

View File

@ -60,7 +60,6 @@
webshims.register('dom-extend', function($, webshims, window, document, undefined){ webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict"; "use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true; webshims.assumeARIA = true;
@ -91,7 +90,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
//shortcus //shortcus
var modules = webshims.modules;
var listReg = /\s*,\s*/; var listReg = /\s*,\s*/;
//proxying attribute //proxying attribute
@ -476,8 +474,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
} }
}; };
var elementExtends = {};
return { return {
createTmpCache: function(nodeName){ createTmpCache: function(nodeName){
if($.isDOMReady){ if($.isDOMReady){
@ -529,6 +526,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
$.extend(webshims, { $.extend(webshims, {
xProps: havePolyfill,
getID: (function(){ getID: (function(){
var ID = new Date().getTime(); var ID = new Date().getTime();
return function(elem){ return function(elem){
@ -542,6 +540,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
return id; 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()), shadowClass: 'wsshadow-'+(Date.now()),
implement: function(elem, type){ implement: function(elem, type){
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); 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'); webshims.error('you must provide a language for track in subtitles state');
} }
obj.__wsmode = obj.mode; obj.__wsmode = obj.mode;
webshims.defineProperty(obj, '_wsUpdateMode', {
value: function(){
$(mediaelem).triggerHandler('updatetrackdisplay');
},
enumerable: false
});
} }
return obj; 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: taken from:
@ -1924,7 +1960,7 @@ modified for webshims
var name = copyName[copyProp] || copyProp; var name = copyName[copyProp] || copyProp;
webshims.onNodeNamesPropertyModify('track', copyProp, function(){ webshims.onNodeNamesPropertyModify('track', copyProp, function(){
var trackData = webshims.data(this, 'trackData'); var trackData = webshims.data(this, 'trackData');
var track = this;
if(trackData){ if(trackData){
if(copyProp == 'kind'){ if(copyProp == 'kind'){
refreshTrack(this, trackData); refreshTrack(this, trackData);

View File

@ -60,7 +60,6 @@
webshims.register('dom-extend', function($, webshims, window, document, undefined){ webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict"; "use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true; webshims.assumeARIA = true;
@ -91,7 +90,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
//shortcus //shortcus
var modules = webshims.modules;
var listReg = /\s*,\s*/; var listReg = /\s*,\s*/;
//proxying attribute //proxying attribute
@ -476,8 +474,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
} }
}; };
var elementExtends = {};
return { return {
createTmpCache: function(nodeName){ createTmpCache: function(nodeName){
if($.isDOMReady){ if($.isDOMReady){
@ -529,6 +526,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
$.extend(webshims, { $.extend(webshims, {
xProps: havePolyfill,
getID: (function(){ getID: (function(){
var ID = new Date().getTime(); var ID = new Date().getTime();
return function(elem){ return function(elem){
@ -542,6 +540,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
return id; 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()), shadowClass: 'wsshadow-'+(Date.now()),
implement: function(elem, type){ implement: function(elem, type){
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});

View File

@ -1869,22 +1869,36 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
} }
return val; return val;
}, },
time: function(val){ time: function(val, o, noCorrect){
var fVal; var fVal, i;
if(val && curCfg.meridian){ if(val){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); if(curCfg.meridian){
if(fVal && fVal >= 12){ fVal = (val[0] * 1);
val[0] = addZero(fVal - 12+''); if(fVal && fVal >= 12){
fVal = 1; val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { } else {
fVal = 0; fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ if(!noCorrect){
val[0] = '12'; 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; return val;
}, },
@ -1973,12 +1987,15 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
var fVal; var fVal;
if(val && curCfg.meridian){ if(val && curCfg.meridian){
val = val.toUpperCase(); val = val.toUpperCase();
if(val.substr(0,2) === "12"){ if(val.substr(0,2) === "12"){
val = "00" + val.substr(2); val = "00" + val.substr(2);
} }
if(val.indexOf(curCfg.meridian[1]) != -1){ if(val.indexOf(curCfg.meridian[1]) != -1){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); fVal = (val[0].replace(curCfg.meridian[1], '') * 1);
if(!isNaN(fVal)){ if(!isNaN(fVal)){
val[0] = fVal + 12; val[0] = fVal + 12;
} }

View File

@ -1869,22 +1869,36 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
} }
return val; return val;
}, },
time: function(val){ time: function(val, o, noCorrect){
var fVal; var fVal, i;
if(val && curCfg.meridian){ if(val){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); if(curCfg.meridian){
if(fVal && fVal >= 12){ fVal = (val[0] * 1);
val[0] = addZero(fVal - 12+''); if(fVal && fVal >= 12){
fVal = 1; val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { } else {
fVal = 0; fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ if(!noCorrect){
val[0] = '12'; 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; return val;
}, },
@ -1973,12 +1987,15 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
var fVal; var fVal;
if(val && curCfg.meridian){ if(val && curCfg.meridian){
val = val.toUpperCase(); val = val.toUpperCase();
if(val.substr(0,2) === "12"){ if(val.substr(0,2) === "12"){
val = "00" + val.substr(2); val = "00" + val.substr(2);
} }
if(val.indexOf(curCfg.meridian[1]) != -1){ if(val.indexOf(curCfg.meridian[1]) != -1){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); fVal = (val[0].replace(curCfg.meridian[1], '') * 1);
if(!isNaN(fVal)){ if(!isNaN(fVal)){
val[0] = fVal + 12; val[0] = fVal + 12;
} }

View File

@ -283,7 +283,6 @@ webshims.isReady('swfmini', true);
webshims.register('dom-extend', function($, webshims, window, document, undefined){ webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict"; "use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true; webshims.assumeARIA = true;
@ -314,7 +313,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
//shortcus //shortcus
var modules = webshims.modules;
var listReg = /\s*,\s*/; var listReg = /\s*,\s*/;
//proxying attribute //proxying attribute
@ -699,8 +697,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
} }
}; };
var elementExtends = {};
return { return {
createTmpCache: function(nodeName){ createTmpCache: function(nodeName){
if($.isDOMReady){ if($.isDOMReady){
@ -752,6 +749,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
$.extend(webshims, { $.extend(webshims, {
xProps: havePolyfill,
getID: (function(){ getID: (function(){
var ID = new Date().getTime(); var ID = new Date().getTime();
return function(elem){ return function(elem){
@ -765,6 +763,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
return id; 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()), shadowClass: 'wsshadow-'+(Date.now()),
implement: function(elem, type){ implement: function(elem, type){
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); 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){ 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; var mediaelement = webshims.mediaelement;
mediaelement.parseRtmp = function(data){ mediaelement.parseRtmp = function(data){
@ -2539,6 +2557,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
loadYt(); loadYt();
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, 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){ if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
return 'video/youtube'; 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'; return nodeName+'/rtmp';
} }
src = src.split('?')[0].split('#')[0].split('.'); 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); mediaElem = $(mediaElem);
if(!srces){ var nodeName = mediaElem[0].nodeName.toLowerCase();
srces = []; var src = getSrcObj(mediaElem, nodeName);
var nodeName = mediaElem[0].nodeName.toLowerCase();
var src = getSrcObj(mediaElem, nodeName); if(!src.src){
$('source', mediaElem).each(function(){
if(!src.src){ src = getSrcObj(this, nodeName);
$('source', mediaElem).each(function(){ if(src.src){srces.push(src);}
src = getSrcObj(this, nodeName); });
if(src.src){srces.push(src);}
});
} else {
srces.push(src);
}
return srces;
} else { } 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){ mediaelement.canThirdPlaySrces = function(mediaElem, srces){
var ret = ''; var ret = '';
@ -2651,7 +2675,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
srces = srces || mediaelement.srces(mediaElem); srces = srces || mediaelement.srces(mediaElem);
$.each(srces, function(i, src){ $.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; ret = src;
return false; return false;
} }

View File

@ -283,7 +283,6 @@ webshims.isReady('swfmini', true);
webshims.register('dom-extend', function($, webshims, window, document, undefined){ webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict"; "use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true; webshims.assumeARIA = true;
@ -314,7 +313,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
//shortcus //shortcus
var modules = webshims.modules;
var listReg = /\s*,\s*/; var listReg = /\s*,\s*/;
//proxying attribute //proxying attribute
@ -699,8 +697,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
} }
}; };
var elementExtends = {};
return { return {
createTmpCache: function(nodeName){ createTmpCache: function(nodeName){
if($.isDOMReady){ if($.isDOMReady){
@ -752,6 +749,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
$.extend(webshims, { $.extend(webshims, {
xProps: havePolyfill,
getID: (function(){ getID: (function(){
var ID = new Date().getTime(); var ID = new Date().getTime();
return function(elem){ return function(elem){
@ -765,6 +763,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
return id; 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()), shadowClass: 'wsshadow-'+(Date.now()),
implement: function(elem, type){ implement: function(elem, type){
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); 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){ 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; var mediaelement = webshims.mediaelement;
mediaelement.parseRtmp = function(data){ mediaelement.parseRtmp = function(data){
@ -2242,6 +2260,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
loadYt(); loadYt();
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, 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){ if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
return 'video/youtube'; 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'; return nodeName+'/rtmp';
} }
src = src.split('?')[0].split('#')[0].split('.'); 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); mediaElem = $(mediaElem);
if(!srces){ var nodeName = mediaElem[0].nodeName.toLowerCase();
srces = []; var src = getSrcObj(mediaElem, nodeName);
var nodeName = mediaElem[0].nodeName.toLowerCase();
var src = getSrcObj(mediaElem, nodeName); if(!src.src){
$('source', mediaElem).each(function(){
if(!src.src){ src = getSrcObj(this, nodeName);
$('source', mediaElem).each(function(){ if(src.src){srces.push(src);}
src = getSrcObj(this, nodeName); });
if(src.src){srces.push(src);}
});
} else {
srces.push(src);
}
return srces;
} else { } 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){ mediaelement.canThirdPlaySrces = function(mediaElem, srces){
var ret = ''; var ret = '';
@ -2354,7 +2378,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
srces = srces || mediaelement.srces(mediaElem); srces = srces || mediaelement.srces(mediaElem);
$.each(srces, function(i, src){ $.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; ret = src;
return false; return false;
} }

View File

@ -60,7 +60,6 @@
webshims.register('dom-extend', function($, webshims, window, document, undefined){ webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict"; "use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true; webshims.assumeARIA = true;
@ -91,7 +90,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
//shortcus //shortcus
var modules = webshims.modules;
var listReg = /\s*,\s*/; var listReg = /\s*,\s*/;
//proxying attribute //proxying attribute
@ -476,8 +474,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
} }
}; };
var elementExtends = {};
return { return {
createTmpCache: function(nodeName){ createTmpCache: function(nodeName){
if($.isDOMReady){ if($.isDOMReady){
@ -529,6 +526,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
$.extend(webshims, { $.extend(webshims, {
xProps: havePolyfill,
getID: (function(){ getID: (function(){
var ID = new Date().getTime(); var ID = new Date().getTime();
return function(elem){ return function(elem){
@ -542,6 +540,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
return id; 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()), shadowClass: 'wsshadow-'+(Date.now()),
implement: function(elem, type){ implement: function(elem, type){
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});
@ -2255,22 +2273,36 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
return val; return val;
}, },
time: function(val){ time: function(val, o, noCorrect){
var fVal; var fVal, i;
if(val && curCfg.meridian){ if(val){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); if(curCfg.meridian){
if(fVal && fVal >= 12){ fVal = (val[0] * 1);
val[0] = addZero(fVal - 12+''); if(fVal && fVal >= 12){
fVal = 1; val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { } else {
fVal = 0; fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ if(!noCorrect){
val[0] = '12'; 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; return val;
}, },
@ -2359,12 +2391,15 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
var fVal; var fVal;
if(val && curCfg.meridian){ if(val && curCfg.meridian){
val = val.toUpperCase(); val = val.toUpperCase();
if(val.substr(0,2) === "12"){ if(val.substr(0,2) === "12"){
val = "00" + val.substr(2); val = "00" + val.substr(2);
} }
if(val.indexOf(curCfg.meridian[1]) != -1){ if(val.indexOf(curCfg.meridian[1]) != -1){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); fVal = (val[0].replace(curCfg.meridian[1], '') * 1);
if(!isNaN(fVal)){ if(!isNaN(fVal)){
val[0] = fVal + 12; val[0] = fVal + 12;
} }

View File

@ -473,7 +473,9 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
return cache[template] || ''; 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(){ var loadLazy = function(){
if(!loadLazy.loaded){ if(!loadLazy.loaded){
loadLazy.loaded = true; loadLazy.loaded = true;
@ -500,7 +502,8 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
}; };
webshims.loader.addModule('mediacontrols-lazy', { webshims.loader.addModule('mediacontrols-lazy', {
src: 'jme/mediacontrols-lazy' src: 'jme/mediacontrols-lazy',
d: ['dom-support']
}); });
var userActivity = { var userActivity = {
@ -523,6 +526,11 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
data.media.removeAttr('controls'); data.media.removeAttr('controls');
data.media.mediaLoad(); data.media.mediaLoad();
} }
if(hasYtBug){
data.player.addClass('has-yt-bug');
}
data.media.prop('controls', false); data.media.prop('controls', false);
structure = getBarHtml(); structure = getBarHtml();
data._controlbar = $( options.barStructure ); 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 $poster = $('<div class="ws-poster" />').insertAfter(data.media);
var posterState = (function(){ var posterState = (function(){
var lastPosterState, lastYoutubeState, lastPoster; var lastPosterState, lastYoutubeState, lastPoster, isYt;
var hasFlash = window.swfmini && swfmini.hasFlashPlayerVersion('10.0.3'); var hasFlash = window.swfmini && swfmini.hasFlashPlayerVersion('10.0.3');
var regYt = /youtube\.com\/[watch\?|v\/]+/i; 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.player.addClass('no-backgroundsize');
} }
data.media.on('play playing waiting seeked seeking', function(e){ data.media.on('play playing waiting seeked seeking', function(e){
if(!e){
if(isInitial){ e.type = 'playing';
}
if(isInitial && (!isYt || !hasYtBug || e.type == 'playing' || data.media.prop('readyState') > 1)){
isInitial = false; isInitial = false;
data.player.removeClass('initial-state'); data.player.removeClass('initial-state');
} }
@ -602,12 +612,16 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
data.player.addClass('ended-state'); data.player.addClass('ended-state');
} }
}); });
return function(){ return function(){
var hasYt;
var poster = data.media.attr('poster'); var poster = data.media.attr('poster');
var hasPoster = !!poster; var hasPoster = !!poster;
var currentSrc = data.media.prop('currentSrc') || ''; 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){ if(!hasPoster && isYt){
poster = currentSrc.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i) || ''; 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'); 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){ if(lastYoutubeState !== hasYt){
lastYoutubeState = hasYt; lastYoutubeState = hasYt;
data.player[hasYt ? 'addClass' : 'removeClass']('has-ytposter'); data.player[hasYt ? 'addClass' : 'removeClass']('has-ytposter');

View File

@ -473,7 +473,9 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
return cache[template] || ''; 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(){ var loadLazy = function(){
if(!loadLazy.loaded){ if(!loadLazy.loaded){
loadLazy.loaded = true; loadLazy.loaded = true;
@ -500,7 +502,8 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
}; };
webshims.loader.addModule('mediacontrols-lazy', { webshims.loader.addModule('mediacontrols-lazy', {
src: 'jme/mediacontrols-lazy' src: 'jme/mediacontrols-lazy',
d: ['dom-support']
}); });
var userActivity = { var userActivity = {
@ -523,6 +526,11 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
data.media.removeAttr('controls'); data.media.removeAttr('controls');
data.media.mediaLoad(); data.media.mediaLoad();
} }
if(hasYtBug){
data.player.addClass('has-yt-bug');
}
data.media.prop('controls', false); data.media.prop('controls', false);
structure = getBarHtml(); structure = getBarHtml();
data._controlbar = $( options.barStructure ); 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 $poster = $('<div class="ws-poster" />').insertAfter(data.media);
var posterState = (function(){ var posterState = (function(){
var lastPosterState, lastYoutubeState, lastPoster; var lastPosterState, lastYoutubeState, lastPoster, isYt;
var hasFlash = window.swfmini && swfmini.hasFlashPlayerVersion('10.0.3'); var hasFlash = window.swfmini && swfmini.hasFlashPlayerVersion('10.0.3');
var regYt = /youtube\.com\/[watch\?|v\/]+/i; 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.player.addClass('no-backgroundsize');
} }
data.media.on('play playing waiting seeked seeking', function(e){ data.media.on('play playing waiting seeked seeking', function(e){
if(!e){
if(isInitial){ e.type = 'playing';
}
if(isInitial && (!isYt || !hasYtBug || e.type == 'playing' || data.media.prop('readyState') > 1)){
isInitial = false; isInitial = false;
data.player.removeClass('initial-state'); data.player.removeClass('initial-state');
} }
@ -602,12 +612,16 @@ webshims.register('jmebase', function($, webshims, window, doc, undefined){
data.player.addClass('ended-state'); data.player.addClass('ended-state');
} }
}); });
return function(){ return function(){
var hasYt;
var poster = data.media.attr('poster'); var poster = data.media.attr('poster');
var hasPoster = !!poster; var hasPoster = !!poster;
var currentSrc = data.media.prop('currentSrc') || ''; 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){ if(!hasPoster && isYt){
poster = currentSrc.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i) || ''; 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'); 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){ if(lastYoutubeState !== hasYt){
lastYoutubeState = hasYt; lastYoutubeState = hasYt;
data.player[hasYt ? 'addClass' : 'removeClass']('has-ytposter'); data.player[hasYt ? 'addClass' : 'removeClass']('has-ytposter');

View File

@ -60,7 +60,6 @@
webshims.register('dom-extend', function($, webshims, window, document, undefined){ webshims.register('dom-extend', function($, webshims, window, document, undefined){
"use strict"; "use strict";
var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized; var supportHrefNormalized = !('hrefNormalized' in $.support) || $.support.hrefNormalized;
var supportGetSetAttribute = !('getSetAttribute' in $.support) || $.support.getSetAttribute;
var has = Object.prototype.hasOwnProperty; var has = Object.prototype.hasOwnProperty;
webshims.assumeARIA = true; webshims.assumeARIA = true;
@ -91,7 +90,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
//shortcus //shortcus
var modules = webshims.modules;
var listReg = /\s*,\s*/; var listReg = /\s*,\s*/;
//proxying attribute //proxying attribute
@ -476,8 +474,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
(tempCache || $( document.getElementsByTagName(nodeName) )).each(fn); (tempCache || $( document.getElementsByTagName(nodeName) )).each(fn);
} }
}; };
var elementExtends = {};
return { return {
createTmpCache: function(nodeName){ createTmpCache: function(nodeName){
if($.isDOMReady){ if($.isDOMReady){
@ -529,6 +526,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
$.extend(webshims, { $.extend(webshims, {
xProps: havePolyfill,
getID: (function(){ getID: (function(){
var ID = new Date().getTime(); var ID = new Date().getTime();
return function(elem){ return function(elem){
@ -542,6 +540,26 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
return id; 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()), shadowClass: 'wsshadow-'+(Date.now()),
implement: function(elem, type){ implement: function(elem, type){
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {}); var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});

View File

@ -1455,7 +1455,9 @@ if((!advancedObjectProperties || !Object.create || !Object.defineProperties || !
var descProps = ['configurable', 'enumerable', 'writable']; var descProps = ['configurable', 'enumerable', 'writable'];
shims.defineProperty = function(proto, property, descriptor){ shims.defineProperty = function(proto, property, descriptor){
if(typeof descriptor != "object" || descriptor === null){return proto;} if(typeof descriptor != "object" || descriptor === null){return proto;}
if(Object.defineProperty){
try { return Object.defineProperty(proto, property, descriptor); } catch (e) {}
}
if(owns(descriptor, "value")){ if(owns(descriptor, "value")){
proto[property] = descriptor.value; proto[property] = descriptor.value;
return proto; return proto;

View File

@ -1878,10 +1878,6 @@ webshim.register('es6', function($, webshim, window, document, undefined){
} }
}; };
if (typeof define === 'function' && define.amd) { main(); // CommonJS and <script>
define(main); // RequireJS
} else {
main(); // CommonJS and <script>
}
}); });

View File

@ -446,24 +446,29 @@ webshim.register('filereader', function($, webshim, window, document, undefined,
} catch(e){} } catch(e){}
printMessage(); printMessage();
if(hasXDomain == null){ if(hasXDomain == null){
$.ajax({ try {
url: 'crossdomain.xml', $.ajax({
type: 'HEAD', url: 'crossdomain.xml',
dataType: 'xml', type: 'HEAD',
success: function(){ dataType: 'xml',
hasXDomain = 'yes'; success: function(){
}, hasXDomain = 'yes';
error: function(){ },
hasXDomain = 'no'; error: function(){
}, hasXDomain = 'no';
complete: function(){ },
try { complete: function(){
sessionStorage.setItem('wsXdomain.xml', hasXDomain); try {
} catch(e){} sessionStorage.setItem('wsXdomain.xml', hasXDomain);
printMessage(); } catch(e){}
} printMessage();
}); }
});
} catch(e){}
} }
}); });
} }
if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
}); });

View File

@ -422,22 +422,36 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
} }
return val; return val;
}, },
time: function(val){ time: function(val, o, noCorrect){
var fVal; var fVal, i;
if(val && curCfg.meridian){ if(val){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); if(curCfg.meridian){
if(fVal && fVal >= 12){ fVal = (val[0] * 1);
val[0] = addZero(fVal - 12+''); if(fVal && fVal >= 12){
fVal = 1; val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { } else {
fVal = 0; fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ if(!noCorrect){
val[0] = '12'; 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; return val;
}, },
@ -526,12 +540,15 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
var fVal; var fVal;
if(val && curCfg.meridian){ if(val && curCfg.meridian){
val = val.toUpperCase(); val = val.toUpperCase();
if(val.substr(0,2) === "12"){ if(val.substr(0,2) === "12"){
val = "00" + val.substr(2); val = "00" + val.substr(2);
} }
if(val.indexOf(curCfg.meridian[1]) != -1){ if(val.indexOf(curCfg.meridian[1]) != -1){
val = val.split(':'); val = val.split(':');
fVal = (val[0] * 1); fVal = (val[0].replace(curCfg.meridian[1], '') * 1);
if(!isNaN(fVal)){ if(!isNaN(fVal)){
val[0] = fVal + 12; val[0] = fVal + 12;
} }

View File

@ -324,10 +324,7 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
e.stopImmediatePropagation(); e.stopImmediatePropagation();
}; };
var steps = options.steps; var steps = options.steps;
var mousePress = function(e){
$(this)[e.type == 'mousepressstart' ? 'addClass' : 'removeClass']('mousepress-ui');
};
var getMonthNameHTML = function(index, year, prefix){ var getMonthNameHTML = function(index, year, prefix){
var dateCfg = curCfg.date; var dateCfg = curCfg.date;
var str = []; var str = [];
@ -441,7 +438,7 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
} }
}, 0); }, 0);
})(); })();
var isDisabled = false;
var spinEvents = {}; var spinEvents = {};
var spinElement = o.splitInput ? this.inputElements.filter('.ws-spin') : this.inputElements.eq(0); var spinElement = o.splitInput ? this.inputElements.filter('.ws-spin') : this.inputElements.eq(0);
var elementEvts = { var elementEvts = {
@ -655,12 +652,25 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
spinElement.on(spinEvents); spinElement.on(spinEvents);
} }
$(this.buttonWrapper) $(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){ .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){ .on('mousedown mousepress', '.step-down', function(e){
step.stepDown(); if(!isDisabled && !o.disabled && !o.readOnly){
step.stepDown();
}
}) })
; ;
initChangeEvents(); initChangeEvents();

View File

@ -48,7 +48,7 @@ webshims.formcfg.fa = {
"timeSigns": ":. ", "timeSigns": ":. ",
"dFormat": "/", "dFormat": "/",
"patterns": { "patterns": {
"d": "yyyy/mm/dd" "d": "yy/mm/dd"
}, },
"meridian": [ "meridian": [
"ب.ظ", "ب.ظ",

View File

@ -286,6 +286,17 @@
.mediaplayer.ended-state > .jme-media-overlay { .mediaplayer.ended-state > .jme-media-overlay {
background-position: 3px 3px; 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"] { .mediaplayer[data-state="waiting"] {
cursor: default; cursor: default;
} }

View File

@ -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"] { &[data-state="waiting"] {
cursor: default; cursor: default;
> .jme-media-overlay { > .jme-media-overlay {

View File

@ -29,6 +29,8 @@ webshims.register('mediacontrols-lazy', function($, webshims, window, doc, undef
; ;
return '<div><ul role="presentation">' + items.join('') +'</ul></div>'; return '<div><ul role="presentation">' + items.join('') +'</ul></div>';
}; };
var domPrefixes = webshims.domPrefixes;
var prefixed = webshims.prefixed;
if(!$.fn.wsTouchClick){ if(!$.fn.wsTouchClick){
@ -976,26 +978,7 @@ webshims.register('mediacontrols-lazy', function($, webshims, window, doc, undef
return chapterList; 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); $.jme.defineMethod('getChapterTree', getChapterTree);
@ -1050,7 +1033,7 @@ webshims.register('mediacontrols-lazy', function($, webshims, window, doc, undef
data = $.jme.data(this); data = $.jme.data(this);
sec = $.prop(data.media, 'duration'); sec = $.prop(data.media, 'duration');
} }
if(!sec){ if(!sec || !isFinite(sec)){
sec = 0; sec = 0;
} }
var formated = []; var formated = [];

View File

@ -50,7 +50,9 @@ webshims.register('mediacontrols', function($, webshims, window){
return cache[template] || ''; 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(){ var loadLazy = function(){
if(!loadLazy.loaded){ if(!loadLazy.loaded){
loadLazy.loaded = true; loadLazy.loaded = true;
@ -77,7 +79,8 @@ webshims.register('mediacontrols', function($, webshims, window){
}; };
webshims.loader.addModule('mediacontrols-lazy', { webshims.loader.addModule('mediacontrols-lazy', {
src: 'jme/mediacontrols-lazy' src: 'jme/mediacontrols-lazy',
d: ['dom-support']
}); });
var userActivity = { var userActivity = {
@ -100,6 +103,11 @@ webshims.register('mediacontrols', function($, webshims, window){
data.media.removeAttr('controls'); data.media.removeAttr('controls');
data.media.mediaLoad(); data.media.mediaLoad();
} }
if(hasYtBug){
data.player.addClass('has-yt-bug');
}
data.media.prop('controls', false); data.media.prop('controls', false);
structure = getBarHtml(); structure = getBarHtml();
data._controlbar = $( options.barStructure ); data._controlbar = $( options.barStructure );
@ -146,7 +154,7 @@ webshims.register('mediacontrols', function($, webshims, window){
})(); })();
var $poster = $('<div class="ws-poster" />').insertAfter(data.media); var $poster = $('<div class="ws-poster" />').insertAfter(data.media);
var posterState = (function(){ var posterState = (function(){
var lastPosterState, lastYoutubeState, lastPoster; var lastPosterState, lastYoutubeState, lastPoster, isYt;
var hasFlash = window.swfmini && swfmini.hasFlashPlayerVersion('10.0.3'); var hasFlash = window.swfmini && swfmini.hasFlashPlayerVersion('10.0.3');
var regYt = /youtube\.com\/[watch\?|v\/]+/i; var regYt = /youtube\.com\/[watch\?|v\/]+/i;
@ -162,8 +170,10 @@ webshims.register('mediacontrols', function($, webshims, window){
data.player.addClass('no-backgroundsize'); data.player.addClass('no-backgroundsize');
} }
data.media.on('play playing waiting seeked seeking', function(e){ data.media.on('play playing waiting seeked seeking', function(e){
if(!e){
if(isInitial){ e.type = 'playing';
}
if(isInitial && (!isYt || !hasYtBug || e.type == 'playing' || data.media.prop('readyState') > 1)){
isInitial = false; isInitial = false;
data.player.removeClass('initial-state'); data.player.removeClass('initial-state');
} }
@ -179,12 +189,16 @@ webshims.register('mediacontrols', function($, webshims, window){
data.player.addClass('ended-state'); data.player.addClass('ended-state');
} }
}); });
return function(){ return function(){
var hasYt;
var poster = data.media.attr('poster'); var poster = data.media.attr('poster');
var hasPoster = !!poster; var hasPoster = !!poster;
var currentSrc = data.media.prop('currentSrc') || ''; 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){ if(!hasPoster && isYt){
poster = currentSrc.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i) || ''; 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'); 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){ if(lastYoutubeState !== hasYt){
lastYoutubeState = hasYt; lastYoutubeState = hasYt;
data.player[hasYt ? 'addClass' : 'removeClass']('has-ytposter'); data.player[hasYt ? 'addClass' : 'removeClass']('has-ytposter');

View File

@ -59,7 +59,7 @@
} }
webshims.register('mediaelement-core', function($, webshims, window, document, undefined, options){ 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; var mediaelement = webshims.mediaelement;
mediaelement.parseRtmp = function(data){ mediaelement.parseRtmp = function(data){
@ -169,6 +169,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
loadYt(); loadYt();
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, 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){ if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
return 'video/youtube'; 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'; return nodeName+'/rtmp';
} }
src = src.split('?')[0].split('#')[0].split('.'); 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); mediaElem = $(mediaElem);
if(!srces){ var nodeName = mediaElem[0].nodeName.toLowerCase();
srces = []; var src = getSrcObj(mediaElem, nodeName);
var nodeName = mediaElem[0].nodeName.toLowerCase();
var src = getSrcObj(mediaElem, nodeName); if(!src.src){
$('source', mediaElem).each(function(){
if(!src.src){ src = getSrcObj(this, nodeName);
$('source', mediaElem).each(function(){ if(src.src){srces.push(src);}
src = getSrcObj(this, nodeName); });
if(src.src){srces.push(src);}
});
} else {
srces.push(src);
}
return srces;
} else { } 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){ mediaelement.canThirdPlaySrces = function(mediaElem, srces){
var ret = ''; var ret = '';
@ -281,7 +287,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
srces = srces || mediaelement.srces(mediaElem); srces = srces || mediaelement.srces(mediaElem);
$.each(srces, function(i, src){ $.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; ret = src;
return false; return false;
} }

View File

@ -472,7 +472,8 @@
.attr({ .attr({
src: src.src, src: src.src,
'data-type': container, 'data-type': container,
'controls': 'controls' 'controls': 'controls',
preload: 'none'
}) })
; ;
var resolvePromise = function(){ var resolvePromise = function(){
@ -517,6 +518,8 @@
duration: $media.prop('duration'), duration: $media.prop('duration'),
height: $media.prop('videoHeight'), height: $media.prop('videoHeight'),
width: $media.prop('videoWidth') width: $media.prop('videoWidth')
//todo at test for seekable
//,seekable: ($media.prop('seekable') || []).length
}; };
} }
src.decode[provider].success = true; src.decode[provider].success = true;
@ -554,6 +557,11 @@
.on('mediaerror loadedmetadata', resolve) .on('mediaerror loadedmetadata', resolve)
.appendTo($element) .appendTo($element)
; ;
if(provider == 'native'){
$media.on('error', resolve);
}
$element.appendTo($container); $element.appendTo($container);
timeoutTimer = setTimeout(resolve, 40000); timeoutTimer = setTimeout(resolve, 40000);
playTimer = setTimeout(function(){ playTimer = setTimeout(function(){

View File

@ -1,11 +1,11 @@
webshims.register('mediaelement-jaris', function($, webshims, window, document, undefined, options){ webshims.register('mediaelement-jaris', function($, webshims, window, document, undefined, options){
"use strict"; "use strict";
var mediaelement = webshims.mediaelement; var mediaelement = webshims.mediaelement;
var swfmini = window.swfmini; var swfmini = window.swfmini;
var support = webshims.support; var support = webshims.support;
var hasNative = support.mediaelement; var hasNative = support.mediaelement;
var hasFlash = swfmini.hasFlashPlayerVersion('9.0.115'); var hasFlash = swfmini.hasFlashPlayerVersion('11.3');
var loadedSwf = 0; var loadedSwf = 0;
var needsLoadPreload = 'ActiveXObject' in window && hasNative; var needsLoadPreload = 'ActiveXObject' in window && hasNative;
var getProps = { var getProps = {
@ -38,18 +38,19 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
}; };
var getPropKeys = Object.keys(getProps); var getPropKeys = Object.keys(getProps);
var getSetProps = { var getSetProps = {
currentTime: 0, currentTime: 0,
volume: 1, volume: 1,
muted: false muted: false
}; };
var getSetPropKeys = Object.keys(getSetProps); var getSetPropKeys = Object.keys(getSetProps);
var playerStateObj = $.extend({ var playerStateObj = $.extend({
isActive: 'html5', isActive: 'html5',
activating: 'html5', activating: 'html5',
wasSwfReady: false, wasSwfReady: false,
_usermedia: null,
_bufferedEnd: 0, _bufferedEnd: 0,
_bufferedStart: 0, _bufferedStart: 0,
currentTime: 0, currentTime: 0,
@ -59,8 +60,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
lastDuration: 0, lastDuration: 0,
_timeDif: 0.3 _timeDif: 0.3
}, getProps, getSetProps); }, getProps, getSetProps);
var getSwfDataFromElem = function(elem){ var getSwfDataFromElem = function(elem){
try { try {
(elem.nodeName); (elem.nodeName);
@ -70,15 +71,15 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
var data = webshims.data(elem, 'mediaelement'); var data = webshims.data(elem, 'mediaelement');
return (data && data.isActive == 'third') ? data : null; return (data && data.isActive == 'third') ? data : null;
}; };
var trigger = function(elem, evt){ var trigger = function(elem, evt){
evt = $.Event(evt); evt = $.Event(evt);
evt.preventDefault(); evt.preventDefault();
$.event.trigger(evt, undefined, elem); $.event.trigger(evt, undefined, elem);
}; };
var playerSwfPath = options.playerPath || webshims.cfg.basePath + "swf/" + (options.playerName || 'JarisFLVPlayer.swf'); var playerSwfPath = options.playerPath || webshims.cfg.basePath + "swf/" + (options.playerName || 'JarisFLVPlayer.swf');
webshims.extendUNDEFProp(options.params, { webshims.extendUNDEFProp(options.params, {
allowscriptaccess: 'always', allowscriptaccess: 'always',
allowfullscreen: 'true', allowfullscreen: 'true',
@ -92,7 +93,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
webshims.extendUNDEFProp(options.attrs, { webshims.extendUNDEFProp(options.attrs, {
bgcolor: '#000000' bgcolor: '#000000'
}); });
options.playerPath = playerSwfPath;
var setReadyState = function(readyState, data){ var setReadyState = function(readyState, data){
if(readyState < 3){ if(readyState < 3){
clearTimeout(data._canplaythroughTimer); clearTimeout(data._canplaythroughTimer);
@ -120,8 +122,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
$(data._elem).triggerHandler('seeked'); $(data._elem).triggerHandler('seeked');
} }
}; };
mediaelement.jarisEvent = {}; mediaelement.jarisEvent = {};
var localConnectionTimer; var localConnectionTimer;
var onEvent = { var onEvent = {
@ -136,7 +138,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
playing = override; playing = override;
} }
if(playing == idled || playing == null){ if(playing == idled || playing == null){
data.paused = !playing; data.paused = !playing;
type = data.paused ? 'pause' : 'play'; type = data.paused ? 'pause' : 'play';
data._ppFlag = true; data._ppFlag = true;
@ -151,7 +153,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
}, },
onSeek: function(jaris, data){ onSeek: function(jaris, data){
data._lastSeektime = jaris.seekTime; data._lastSeektime = jaris.seekTime;
data.seeking = true; data.seeking = true;
$(data._elem).triggerHandler('seeking'); $(data._elem).triggerHandler('seeking');
clearTimeout(data._seekedTimer); clearTimeout(data._seekedTimer);
@ -167,19 +169,19 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
setReadyState(3, data); setReadyState(3, data);
}, },
onDataInitialized: function(jaris, data){ onDataInitialized: function(jaris, data){
var oldDur = data.duration; var oldDur = data.duration;
var durDelta; var durDelta;
data.duration = jaris.duration; data.duration = jaris.duration;
if(oldDur == data.duration || isNaN(data.duration)){return;} if(oldDur == data.duration || isNaN(data.duration)){return;}
if(data._calledMeta && ((durDelta = Math.abs(data.lastDuration - data.duration)) < 2)){return;} if(data._calledMeta && ((durDelta = Math.abs(data.lastDuration - data.duration)) < 2)){return;}
data.videoHeight = jaris.height; data.videoHeight = jaris.height;
data.videoWidth = jaris.width; data.videoWidth = jaris.width;
if(!data.networkState){ if(!data.networkState){
data.networkState = 2; data.networkState = 2;
} }
@ -235,7 +237,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
data.lastCalledTime = data.currentTime; data.lastCalledTime = data.currentTime;
$.event.trigger('timeupdate', undefined, data._elem, true); $.event.trigger('timeupdate', undefined, data._elem, true);
} }
}, },
onProgress: function(jaris, data){ onProgress: function(jaris, data){
if(data.ended){ if(data.ended){
@ -245,7 +247,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
return; return;
} }
var percentage = jaris.loaded / jaris.total; var percentage = jaris.loaded / jaris.total;
if(percentage > 0.02 && percentage < 0.2){ if(percentage > 0.02 && percentage < 0.2){
setReadyState(3, data); setReadyState(3, data);
} else if(percentage > 0.2){ } else if(percentage > 0.2){
@ -258,10 +260,10 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
if(data._bufferedEnd && (data._bufferedEnd > percentage)){ if(data._bufferedEnd && (data._bufferedEnd > percentage)){
data._bufferedStart = data.currentTime || 0; data._bufferedStart = data.currentTime || 0;
} }
data._bufferedEnd = percentage; data._bufferedEnd = percentage;
data.buffered.length = 1; data.buffered.length = 1;
$.event.trigger('progress', undefined, data._elem, true); $.event.trigger('progress', undefined, data._elem, true);
}, },
onPlaybackFinished: function(jaris, data){ onPlaybackFinished: function(jaris, data){
@ -281,7 +283,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
ready: (function(){ ready: (function(){
var testAPI = function(data){ var testAPI = function(data){
var passed = true; var passed = true;
try { try {
data.api.api_get('volume'); data.api.api_get('volume');
} catch(er){ } catch(er){
@ -289,17 +291,17 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
return passed; return passed;
}; };
return function(jaris, data){ return function(jaris, data){
var i = 0; var i = 0;
var doneFn = function(){ var doneFn = function(){
if(i > 9){ if(i > 9){
data.tryedReframeing = 0; data.tryedReframeing = 0;
return; return;
} }
i++; i++;
data.tryedReframeing++; data.tryedReframeing++;
if(testAPI(data)){ if(testAPI(data)){
data.wasSwfReady = true; data.wasSwfReady = true;
@ -329,25 +331,25 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
clearTimeout(localConnectionTimer); clearTimeout(localConnectionTimer);
clearTimeout(data.reframeTimer); clearTimeout(data.reframeTimer);
data.shadowElem.removeClass('flashblocker-assumed'); data.shadowElem.removeClass('flashblocker-assumed');
if(!i){ if(!i){
doneFn(); doneFn();
} else { } else {
data.reframeTimer = setTimeout(doneFn, 9); data.reframeTimer = setTimeout(doneFn, 9);
} }
}; };
})() })()
}; };
onEvent.onMute = onEvent.onVolumeChange; onEvent.onMute = onEvent.onVolumeChange;
mediaelement.onEvent = onEvent;
var workActionQueue = function(data){ var workActionQueue = function(data){
var actionLen = data.actionQueue.length; var actionLen = data.actionQueue.length;
var i = 0; var i = 0;
var operation; var operation;
if(actionLen && data.isActive == 'third'){ if(actionLen && data.isActive == 'third'){
while(data.actionQueue.length && actionLen > i){ while(data.actionQueue.length && actionLen > i){
i++; i++;
@ -368,7 +370,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
if( (data._ppFlag === undefined && ($.prop(data._elem, 'autoplay')) || !data.paused)){ if( (data._ppFlag === undefined && ($.prop(data._elem, 'autoplay')) || !data.paused)){
setTimeout(function(){ setTimeout(function(){
if(data.isActive == 'third' && (data._ppFlag === undefined || !data.paused)){ if(data.isActive == 'third' && (data._ppFlag === undefined || !data.paused)){
try { try {
$(data._elem).play(); $(data._elem).play();
data._ppFlag = true; data._ppFlag = true;
@ -376,7 +378,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
}, 1); }, 1);
} }
if(data.muted){ if(data.muted){
$.prop(data._elem, 'muted', true); $.prop(data._elem, 'muted', true);
} }
@ -384,8 +386,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
$.prop(data._elem, 'volume', data.volume); $.prop(data._elem, 'volume', data.volume);
} }
}; };
var addMediaToStopEvents = $.noop; var addMediaToStopEvents = $.noop;
if(hasNative){ if(hasNative){
var stopEvents = { var stopEvents = {
@ -396,14 +398,14 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
var hidevents = hideEvtArray.map(function(evt){ var hidevents = hideEvtArray.map(function(evt){
return evt +'.webshimspolyfill'; return evt +'.webshimspolyfill';
}).join(' '); }).join(' ');
var hidePlayerEvents = function(event){ var hidePlayerEvents = function(event){
var data = webshims.data(event.target, 'mediaelement'); var data = webshims.data(event.target, 'mediaelement');
if(!data){return;} if(!data){return;}
var isNativeHTML5 = ( event.originalEvent && event.originalEvent.type === event.type ); var isNativeHTML5 = ( event.originalEvent && event.originalEvent.type === event.type );
if( isNativeHTML5 == (data.activating == 'third') ){ if( isNativeHTML5 == (data.activating == 'third') ){
event.stopImmediatePropagation(); event.stopImmediatePropagation();
if(stopEvents[event.type]){ if(stopEvents[event.type]){
if(data.isActive != data.activating){ if(data.isActive != data.activating){
$(event.target).pause(); $(event.target).pause();
@ -413,7 +415,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
} }
}; };
addMediaToStopEvents = function(elem){ addMediaToStopEvents = function(elem){
$(elem) $(elem)
.off(hidevents) .off(hidevents)
@ -425,8 +427,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
}; };
addMediaToStopEvents(document); addMediaToStopEvents(document);
} }
mediaelement.setActive = function(elem, type, data){ mediaelement.setActive = function(elem, type, data){
if(!data){ if(!data){
data = webshims.data(elem, 'mediaelement'); data = webshims.data(elem, 'mediaelement');
@ -448,14 +450,14 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
$(elem).trigger('mediaelementapichange'); $(elem).trigger('mediaelementapichange');
}; };
var resetSwfProps = (function(){ 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; var len = resetProtoProps.length;
return function(data){ return function(data){
if(!data){return;} if(!data){return;}
clearTimeout(data._seekedTimer); clearTimeout(data._seekedTimer);
var lenI = len; var lenI = len;
@ -472,8 +474,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
}; };
})(); })();
var getComputedDimension = (function(){ var getComputedDimension = (function(){
var dimCache = {}; var dimCache = {};
var getVideoDims = function(data){ var getVideoDims = function(data){
@ -495,7 +497,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
width: this.width, width: this.width,
height: this.height height: this.height
}; };
if(dimCache[poster].height && dimCache[poster].width){ if(dimCache[poster].height && dimCache[poster].width){
setElementDimension(data, $.prop(data._elem, 'controls')); setElementDimension(data, $.prop(data._elem, 'controls'));
} else { } else {
@ -511,12 +513,12 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
return ret || {width: 300, height: data._elemNodeName == 'video' ? 150 : 50}; return ret || {width: 300, height: data._elemNodeName == 'video' ? 150 : 50};
}; };
var getCssStyle = function(elem, style){ var getCssStyle = function(elem, style){
return elem.style[style] || (elem.currentStyle && elem.currentStyle[style]) || (window.getComputedStyle && (window.getComputedStyle( elem, null ) || {} )[style]) || ''; return elem.style[style] || (elem.currentStyle && elem.currentStyle[style]) || (window.getComputedStyle && (window.getComputedStyle( elem, null ) || {} )[style]) || '';
}; };
var minMaxProps = ['minWidth', 'maxWidth', 'minHeight', 'maxHeight']; var minMaxProps = ['minWidth', 'maxWidth', 'minHeight', 'maxHeight'];
var addMinMax = function(elem, ret){ var addMinMax = function(elem, ret){
var i, prop; var i, prop;
var hasMinMax = false; var hasMinMax = false;
@ -530,7 +532,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
return hasMinMax; return hasMinMax;
}; };
var retFn = function(data){ var retFn = function(data){
var videoDims, ratio, hasMinMax; var videoDims, ratio;
var elem = data._elem; var elem = data._elem;
var autos = { var autos = {
width: getCssStyle(elem, 'width') == 'auto', width: getCssStyle(elem, 'width') == 'auto',
@ -540,11 +542,11 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
width: !autos.width && $(elem).width(), width: !autos.width && $(elem).width(),
height: !autos.height && $(elem).height() height: !autos.height && $(elem).height()
}; };
if(autos.width || autos.height){ if(autos.width || autos.height){
videoDims = getVideoDims(data); videoDims = getVideoDims(data);
ratio = videoDims.width / videoDims.height; ratio = videoDims.width / videoDims.height;
if(autos.width && autos.height){ if(autos.width && autos.height){
ret.width = videoDims.width; ret.width = videoDims.width;
ret.height = videoDims.height; ret.height = videoDims.height;
@ -553,12 +555,12 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} else if(autos.height){ } else if(autos.height){
ret.height = ret.width / ratio; ret.height = ret.width / ratio;
} }
if(addMinMax(elem, ret)){ if(addMinMax(elem, ret)){
data.shadowElem.css(ret); data.shadowElem.css(ret);
if(autos.width){ if(autos.width){
ret.width = data.shadowElem.height() * ratio; ret.width = data.shadowElem.height() * ratio;
} }
if(autos.height){ if(autos.height){
ret.height = ((autos.width) ? ret.width : data.shadowElem.width()) / ratio; 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); data.shadowElem.css(ret);
ret.height = data.shadowElem.width() / ratio; ret.height = data.shadowElem.width() / ratio;
ret.width = ret.height * ratio; ret.width = ret.height * ratio;
data.shadowElem.css(ret); data.shadowElem.css(ret);
ret.width = data.shadowElem.height() * ratio; ret.width = data.shadowElem.height() * ratio;
ret.height = ret.width / ratio; ret.height = ret.width / ratio;
} }
if(!webshims.support.mediaelement){ if(!webshims.support.mediaelement){
ret.width = data.shadowElem.width(); ret.width = data.shadowElem.width();
@ -580,13 +582,13 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
return ret; return ret;
}; };
return retFn; return retFn;
})(); })();
var setElementDimension = function(data, hasControls){ var setElementDimension = function(data, hasControls){
var dims; var dims;
var box = data.shadowElem; var box = data.shadowElem;
$(data._elem)[hasControls ? 'addClass' : 'removeClass']('webshims-controls'); $(data._elem)[hasControls ? 'addClass' : 'removeClass']('webshims-controls');
@ -601,7 +603,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
} }
}; };
var bufferSrc = (function(){ var bufferSrc = (function(){
var preloads = { var preloads = {
'': 1, '': 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])'))); return !!(preloads[preload] || (preload == 'metadata' && $(elem).is('.preload-in-doubt, video:not([poster])')));
}; };
})(); })();
var regs = { var regs = {
A: /&amp;/g, A: /&amp;/g,
a: /&/g, a: /&/g,
e: /\=/g, e: /\=/g,
q: /\?/g q: /\?/g
}, },
replaceVar = function(val){ replaceVar = function(val){
return (val.replace) ? val.replace(regs.A, '%26').replace(regs.a, '%26').replace(regs.e, '%3D').replace(regs.q, '%3F') : 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){ if('matchMedia' in window){
var allowMediaSorting = false; var allowMediaSorting = false;
try { try {
@ -640,14 +642,15 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} catch(er){ } catch(er){
return 0; return 0;
} }
return src1 == src2 ? return src1 == src2 ?
0 : 0 :
src1 ? -1 src1 ? -1
: 1; : 1;
}; };
} }
} }
mediaelement.resetSwfProps = resetSwfProps;
mediaelement.createSWF = function( elem, canPlaySrc, data ){ mediaelement.createSWF = function( elem, canPlaySrc, data ){
if(!hasFlash){ if(!hasFlash){
setTimeout(function(){ setTimeout(function(){
@ -655,7 +658,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
}, 1); }, 1);
return; return;
} }
var attrStyle = {}; var attrStyle = {};
if(loadedSwf < 1){ if(loadedSwf < 1){
@ -666,55 +669,40 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
if(!data){ if(!data){
data = webshims.data(elem, 'mediaelement'); data = webshims.data(elem, 'mediaelement');
} }
if((attrStyle.height = $.attr(elem, 'height') || '') || (attrStyle.width = $.attr(elem, 'width') || '')){ if((attrStyle.height = $.attr(elem, 'height') || '') || (attrStyle.width = $.attr(elem, 'width') || '')){
$(elem).css(attrStyle); $(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."); 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 box;
var isRtmp = canPlaySrc.type == 'audio/rtmp' || canPlaySrc.type == 'video/rtmp'; var streamRequest = canPlaySrc.streamrequest;
var vars = $.extend({}, options.vars, { var isStream = canPlaySrc.type == 'jarisplayer/stream';
poster: replaceVar($.attr(elem, 'poster') && $.prop(elem, 'poster') || ''),
source: replaceVar(canPlaySrc.streamId || canPlaySrc.srcProp),
server: replaceVar(canPlaySrc.server || '')
});
var elemVars = $(elem).data('vars') || {};
var hasControls = $.prop(elem, 'controls'); var hasControls = $.prop(elem, 'controls');
var elemId = 'jarisplayer-'+ webshims.getID(elem); var elemId = 'jarisplayer-'+ webshims.getID(elem);
var params = $.extend(
{},
options.params,
$(elem).data('params')
);
var elemNodeName = elem.nodeName.toLowerCase(); var elemNodeName = elem.nodeName.toLowerCase();
var attrs = $.extend(
{},
options.attrs,
{
name: elemId,
id: elemId
},
$(elem).data('attrs')
);
var setDimension = function(){ var setDimension = function(){
if(data.isActive == 'third'){ if(data.isActive == 'third'){
setElementDimension(data, $.prop(elem, 'controls')); setElementDimension(data, $.prop(elem, 'controls'));
} }
}; };
var box; if(isStream && !streamRequest){
webshim.usermedia.attach(elem, canPlaySrc, data);
return;
}
if(data && data.swfCreated){ if(data && data.swfCreated){
mediaelement.setActive(elem, 'third', data); mediaelement.setActive(elem, 'third', data);
data.currentSrc = ''; data.currentSrc = '';
data.shadowElem.html('<div id="'+ elemId +'">'); data.shadowElem.html('<div id="'+ elemId +'">');
data.api = false; data.api = false;
data.actionQueue = []; data.actionQueue = [];
box = data.shadowElem; box = data.shadowElem;
@ -743,7 +731,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
value: elem value: elem
}, },
currentSrc: { currentSrc: {
value: canPlaySrc.srcProp value: streamRequest ? '' : canPlaySrc.srcProp
}, },
swfCreated: { swfCreated: {
value: true value: true
@ -771,26 +759,27 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
} }
})); }));
box.insertBefore(elem); box.insertBefore(elem);
if(hasNative){ if(hasNative){
$.extend(data, {volume: $.prop(elem, 'volume'), muted: $.prop(elem, 'muted'), paused: $.prop(elem, 'paused')}); $.extend(data, {volume: $.prop(elem, 'volume'), muted: $.prop(elem, 'muted'), paused: $.prop(elem, 'paused')});
} }
webshims.addShadowDom(elem, box); webshims.addShadowDom(elem, box);
if(!webshims.data(elem, 'mediaelement')){ if(!webshims.data(elem, 'mediaelement')){
webshims.data(elem, 'mediaelement', data); webshims.data(elem, 'mediaelement', data);
} }
addMediaToStopEvents(elem); addMediaToStopEvents(elem);
mediaelement.setActive(elem, 'third', data); mediaelement.setActive(elem, 'third', data);
setElementDimension(data, hasControls); setElementDimension(data, hasControls);
$(elem) $(elem)
.on({ .on({
'updatemediaelementdimensions loadedmetadata emptied': setDimension, 'updatemediaelementdimensions loadedmetadata emptied': setDimension,
'remove': function(e){ 'remove': function(e){
@ -804,14 +793,13 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
.onWSOff('updateshadowdom', setDimension) .onWSOff('updateshadowdom', setDimension)
; ;
} }
if(mediaelement.jarisEvent[data.id] && mediaelement.jarisEvent[data.id].elem != elem){ if(mediaelement.jarisEvent[data.id] && mediaelement.jarisEvent[data.id].elem != elem){
webshims.error('something went wrong'); webshims.error('something went wrong');
return; return;
} else if(!mediaelement.jarisEvent[data.id]){ } else if(!mediaelement.jarisEvent[data.id]){
mediaelement.jarisEvent[data.id] = function(jaris){ mediaelement.jarisEvent[data.id] = function(jaris){
if(jaris.type == 'ready'){ if(jaris.type == 'ready'){
var onReady = function(){ var onReady = function(){
if(data.api){ 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)){ if(!data._calledMeta && isNaN(jaris.duration) && data.duration != jaris.duration && isNaN(data.duration)){
onEvent.onDataInitialized(jaris, data); onEvent.onDataInitialized(jaris, data);
} }
if(!data._ppFlag && jaris.type != 'onPlayPause'){ if(!data._ppFlag && jaris.type != 'onPlayPause'){
onEvent.onPlayPause(jaris, data); onEvent.onPlayPause(jaris, data);
} }
if(onEvent[jaris.type]){ if(onEvent[jaris.type]){
onEvent[jaris.type](jaris, data); onEvent[jaris.type](jaris, data);
} }
@ -850,29 +838,68 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
}; };
mediaelement.jarisEvent[data.id].elem = elem; 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, id: elemId,
evtId: data.id, evtId: data.id,
controls: ''+hasControls, controls: ''+(!isUserStream && hasControls),
autostart: 'false', autostart: 'false',
nodename: elemNodeName nodename: elemNodeName
}, },
elemVars elemVars
); );
if(isRtmp){ if(isRtmp){
vars.streamtype = 'rtmp'; vars.streamtype = 'rtmp';
} else if(isUserStream){
vars.streamtype = 'usermedia';
} else if(canPlaySrc.type == 'audio/mpeg' || canPlaySrc.type == 'audio/mp3'){ } else if(canPlaySrc.type == 'audio/mpeg' || canPlaySrc.type == 'audio/mp3'){
vars.type = 'audio'; vars.type = 'audio';
vars.streamtype = 'file'; vars.streamtype = 'file';
} else if(canPlaySrc.type == 'video/youtube'){ } else if(canPlaySrc.type == 'video/youtube'){
vars.streamtype = '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'); options.changeSWF(vars, elem, canPlaySrc, data, 'embed');
clearTimeout(data.flashBlock); clearTimeout(data.flashBlock);
swfmini.embedSWF(playerSwfPath, elemId, "100%", "100%", "9.0.115", false, vars, params, attrs, function(swfData){ swfmini.embedSWF(playerSwfPath, elemId, "100%", "100%", "9.0.115", false, vars, params, attrs, function(swfData){
if(swfData.success){ if(swfData.success){
var fBlocker = function(){ var fBlocker = function(){
@ -884,13 +911,13 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
$(swfData.ref).css({'minHeight': '2px', 'minWidth': '2px', display: 'block'}); $(swfData.ref).css({'minHeight': '2px', 'minWidth': '2px', display: 'block'});
}; };
data.api = swfData.ref; data.api = swfData.ref;
if(!hasControls){ if(!hasControls){
$(swfData.ref).attr('tabindex', '-1').css('outline', 'none'); $(swfData.ref).attr('tabindex', '-1').css('outline', 'none');
} }
data.flashBlock = setTimeout(fBlocker, 99); data.flashBlock = setTimeout(fBlocker, 99);
if(!localConnectionTimer){ if(!localConnectionTimer){
clearTimeout(localConnectionTimer); clearTimeout(localConnectionTimer);
localConnectionTimer = setTimeout(function(){ localConnectionTimer = setTimeout(function(){
@ -904,23 +931,24 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
flash = null; flash = null;
}, 8000); }, 8000);
} }
if(isUserStream){
webshim.usermedia.request(elem, canPlaySrc, data);
}
} }
}); });
trigger(data._elem, 'loadstart');
}; };
var queueSwfMethod = function(elem, fn, args, data){ var queueSwfMethod = function(elem, fn, args, data){
data = data || getSwfDataFromElem(elem); data = data || getSwfDataFromElem(elem);
if(data){ if(data){
if(data.api && data.api[fn]){ if(data.api && data.api[fn]){
data.api[fn].apply(data.api, args || []); data.api[fn].apply(data.api, args || []);
} else { } else {
//todo add to queue //todo add to queue
data.actionQueue.push({fn: fn, args: args}); data.actionQueue.push({fn: fn, args: args});
if(data.actionQueue.length > 10){ if(data.actionQueue.length > 10){
setTimeout(function(){ setTimeout(function(){
if(data.actionQueue.length > 5){ if(data.actionQueue.length > 5){
@ -933,13 +961,14 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
return false; return false;
}; };
mediaelement.queueSwfMethod = queueSwfMethod;
['audio', 'video'].forEach(function(nodeName){ ['audio', 'video'].forEach(function(nodeName){
var descs = {}; var descs = {};
var mediaSup; var mediaSup;
var createGetProp = function(key){ var createGetProp = function(key){
if(nodeName == 'audio' && (key == 'videoHeight' || key == 'videoWidth')){return;} if(nodeName == 'audio' && (key == 'videoHeight' || key == 'videoWidth')){return;}
descs[key] = { descs[key] = {
get: function(){ get: function(){
var data = getSwfDataFromElem(this); var data = getSwfDataFromElem(this);
@ -959,33 +988,33 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
delete descs[key].writeable; delete descs[key].writeable;
descs[key].set = setFn; descs[key].set = setFn;
}; };
createGetSetProp('seeking'); createGetSetProp('seeking');
createGetSetProp('volume', function(v){ createGetSetProp('volume', function(v){
var data = getSwfDataFromElem(this); var data = getSwfDataFromElem(this);
if(data){ if(data){
v *= 1; v *= 1;
if(!isNaN(v)){ if(!isNaN(v)){
if(v < 0 || v > 1){ if(v < 0 || v > 1){
webshims.error('volume greater or less than allowed '+ (v / 100)); webshims.error('volume greater or less than allowed '+ (v / 100));
} }
queueSwfMethod(this, 'api_volume', [v], data); queueSwfMethod(this, 'api_volume', [v], data);
if(data.volume != v){ if(data.volume != v){
data.volume = v; data.volume = v;
trigger(data._elem, 'volumechange'); trigger(data._elem, 'volumechange');
} }
data = null; data = null;
} }
} else if(mediaSup.volume.prop._supset) { } else if(mediaSup.volume.prop._supset) {
return mediaSup.volume.prop._supset.apply(this, arguments); return mediaSup.volume.prop._supset.apply(this, arguments);
} }
}); });
createGetSetProp('muted', function(m){ createGetSetProp('muted', function(m){
var data = getSwfDataFromElem(this); var data = getSwfDataFromElem(this);
if(data){ if(data){
@ -1000,8 +1029,8 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
return mediaSup.muted.prop._supset.apply(this, arguments); return mediaSup.muted.prop._supset.apply(this, arguments);
} }
}); });
createGetSetProp('currentTime', function(t){ createGetSetProp('currentTime', function(t){
var data = getSwfDataFromElem(this); var data = getSwfDataFromElem(this);
if(data){ if(data){
@ -1009,23 +1038,23 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
if (!isNaN(t)) { if (!isNaN(t)) {
queueSwfMethod(this, 'api_seek', [t], data); queueSwfMethod(this, 'api_seek', [t], data);
} }
} else if(mediaSup.currentTime.prop._supset) { } else if(mediaSup.currentTime.prop._supset) {
return mediaSup.currentTime.prop._supset.apply(this, arguments); return mediaSup.currentTime.prop._supset.apply(this, arguments);
} }
}); });
['play', 'pause'].forEach(function(fn){ ['play', 'pause'].forEach(function(fn){
descs[fn] = { descs[fn] = {
value: function(){ value: function(){
var data = getSwfDataFromElem(this); var data = getSwfDataFromElem(this);
if(data){ if(data){
if(data.stopPlayPause){ if(data.stopPlayPause){
clearTimeout(data.stopPlayPause); clearTimeout(data.stopPlayPause);
} }
queueSwfMethod(this, fn == 'play' ? 'api_play' : 'api_pause', [], data); queueSwfMethod(this, fn == 'play' ? 'api_play' : 'api_pause', [], data);
data._ppFlag = true; data._ppFlag = true;
if(data.paused != (fn != 'play')){ if(data.paused != (fn != 'play')){
data.paused = fn != 'play'; data.paused = fn != 'play';
@ -1037,14 +1066,14 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
}; };
}); });
getPropKeys.forEach(createGetProp); getPropKeys.forEach(createGetProp);
webshims.onNodeNamesPropertyModify(nodeName, 'controls', function(val, boolProp){ webshims.onNodeNamesPropertyModify(nodeName, 'controls', function(val, boolProp){
var data = getSwfDataFromElem(this); var data = getSwfDataFromElem(this);
$(this)[boolProp ? 'addClass' : 'removeClass']('webshims-controls'); $(this)[boolProp ? 'addClass' : 'removeClass']('webshims-controls');
if(data){ if(data){
if(nodeName == 'audio'){ if(nodeName == 'audio'){
setElementDimension(data, boolProp); setElementDimension(data, boolProp);
@ -1052,12 +1081,12 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
queueSwfMethod(this, 'api_controls', [boolProp], data); queueSwfMethod(this, 'api_controls', [boolProp], data);
} }
}); });
webshims.onNodeNamesPropertyModify(nodeName, 'preload', function(val){ webshims.onNodeNamesPropertyModify(nodeName, 'preload', function(val){
var data, baseData, elem; var data, baseData, elem;
if(bufferSrc(this)){ if(bufferSrc(this)){
data = getSwfDataFromElem(this); data = getSwfDataFromElem(this);
if(data){ if(data){
@ -1072,9 +1101,9 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
} }
}); });
mediaSup = webshims.defineNodeNameProperties(nodeName, descs, 'prop'); mediaSup = webshims.defineNodeNameProperties(nodeName, descs, 'prop');
if(!support.mediaDefaultMuted){ if(!support.mediaDefaultMuted){
webshims.defineNodeNameProperties(nodeName, { webshims.defineNodeNameProperties(nodeName, {
defaultMuted: { defaultMuted: {
@ -1092,8 +1121,68 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
}, 'prop'); }, '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){ if(hasFlash && $.cleanData){
var oldClean = $.cleanData; var oldClean = $.cleanData;
var objElem = document.createElement('object'); var objElem = document.createElement('object');
@ -1107,12 +1196,12 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
object: 1, object: 1,
OBJECT: 1 OBJECT: 1
}; };
$.cleanData = function(elems){ $.cleanData = function(elems){
var i, len, prop; var i, len, prop;
var ret = oldClean.apply(this, arguments); var ret = oldClean.apply(this, arguments);
if(elems && (len = elems.length) && loadedSwf){ if(elems && (len = elems.length) && loadedSwf){
for(i = 0; i < len; i++){ for(i = 0; i < len; i++){
if(flashNames[elems[i].nodeName] && 'api_destroy' in elems[i]){ if(flashNames[elems[i].nodeName] && 'api_destroy' in elems[i]){
loadedSwf--; loadedSwf--;
@ -1128,14 +1217,14 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} catch(er){console.log(er);} } catch(er){console.log(er);}
} }
} }
} }
return ret; return ret;
}; };
} }
if(!hasNative){ if(!hasNative){
['poster', 'src'].forEach(function(prop){ ['poster', 'src'].forEach(function(prop){
webshims.defineNodeNamesProperty(prop == 'src' ? ['audio', 'video', 'source'] : ['video'], prop, { webshims.defineNodeNamesProperty(prop == 'src' ? ['audio', 'video', 'source'] : ['video'], prop, {
//attr: {}, //attr: {},
@ -1143,21 +1232,21 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
propType: 'src' propType: 'src'
}); });
}); });
webshims.defineNodeNamesProperty(['audio', 'video'], 'preload', { webshims.defineNodeNamesProperty(['audio', 'video'], 'preload', {
reflect: true, reflect: true,
propType: 'enumarated', propType: 'enumarated',
defaultValue: '', defaultValue: '',
limitedTo: ['', 'auto', 'metadata', 'none'] limitedTo: ['', 'auto', 'metadata', 'none']
}); });
webshims.reflectProperties('source', ['type', 'media']); webshims.reflectProperties('source', ['type', 'media']);
['autoplay', 'controls'].forEach(function(name){ ['autoplay', 'controls'].forEach(function(name){
webshims.defineNodeNamesBooleanProperty(['audio', 'video'], name); webshims.defineNodeNamesBooleanProperty(['audio', 'video'], name);
}); });
webshims.defineNodeNamesProperties(['audio', 'video'], { webshims.defineNodeNamesProperties(['audio', 'video'], {
HAVE_CURRENT_DATA: { HAVE_CURRENT_DATA: {
value: 2 value: 2
@ -1186,7 +1275,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
NETWORK_NO_SOURCE: { NETWORK_NO_SOURCE: {
value: 3 value: 3
} }
}, 'prop'); }, 'prop');
@ -1212,7 +1301,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
var media, error, parent; var media, error, parent;
if( if(
($(e.target).is('audio, video') || ((parent = e.target.parentNode) && $('source', parent).last()[0] == e.target)) && ($(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'); error = media.prop('error');
setTimeout(function(){ setTimeout(function(){

View File

@ -1,5 +1,4 @@
(function(){ webshim.ready('matchMedia', function($, webshim, w, doc, undefined){
"use strict";
try { try {
new Image(); new Image();
} catch(e){ } catch(e){
@ -7,75 +6,8 @@
return document.createElement('img'); return document.createElement('img');
}; };
} }
webshim.isReady('picture', true); webshim.isReady('picture', true);
setTimeout(function(){ // Enable strict mode
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
"use strict"; "use strict";
// If picture is supported, well, that's awesome. Let's get outta here... // 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" ) { if ( source.nodeName.toUpperCase() !== "SOURCE" ) {
continue; 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" ); var media = source.getAttribute( "media" );
@ -626,17 +562,18 @@ window.matchMedia || (window.matchMedia = function() {
picturefill._ = pf; picturefill._ = pf;
/* expose picturefill */ /* expose picturefill */
if ( typeof module === "object" && typeof module.exports === "object" ) { w.picturefill = picturefill;
// 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;
}
} )( this, this.document ); (function(){
webshim.isReady('picture', true);
var sel = 'picture, img[srcset]';
webshim.addReady(function(context){
if(context.querySelector(sel)){
window.picturefill();
}
});
})();
} );

View File

@ -9,15 +9,7 @@
* http://api.jqueryui.com/position/ * http://api.jqueryui.com/position/
*/ */
(function( factory ) { (function( factory ) {
if ( typeof define === "function" && define.amd ) { factory( window.webshims && window.webshims.$ || jQuery );
// AMD. Register as an anonymous module.
define( [ "jquery" ], factory );
} else {
// Browser globals
factory( window.webshims && window.webshims.$ || jQuery );
}
}(function( $ ) { }(function( $ ) {
(function() { (function() {

View File

@ -2031,14 +2031,7 @@
} }
// EXPOSE // EXPOSE
if ( typeof define === "function" && define.amd ) { window.Sizzle = Sizzle;
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;
}
// EXPOSE // EXPOSE

View File

@ -298,6 +298,10 @@ input[type="color"] {
margin-left: 0; margin-left: 0;
margin-right: -24px; margin-right: -24px;
} }
.input-button-size-1.number-input-buttons.ws-is-rtl {
margin-left: 0;
margin-right: -19px;
}
.input-button-size-2 { .input-button-size-2 {
margin-left: -39px; margin-left: -39px;

View File

@ -203,6 +203,11 @@ input[type="color"] {
margin-right: -24px; margin-right: -24px;
} }
} }
&.number-input-buttons.ws-is-rtl {
margin-left: 0;
margin-right: -19px;
}
} }
.input-button-size-2 { .input-button-size-2 {
margin-left: -39px; margin-left: -39px;

View File

@ -981,6 +981,10 @@ input[type="color"] {
margin-left: 0; margin-left: 0;
margin-right: -24px; margin-right: -24px;
} }
.input-button-size-1.number-input-buttons.ws-is-rtl {
margin-left: 0;
margin-right: -19px;
}
.input-button-size-2 { .input-button-size-2 {
margin-left: -39px; margin-left: -39px;

View File

@ -456,11 +456,29 @@ webshims.register('track', function($, webshims, window, document, undefined){
webshims.error('you must provide a language for track in subtitles state'); webshims.error('you must provide a language for track in subtitles state');
} }
obj.__wsmode = obj.mode; obj.__wsmode = obj.mode;
webshims.defineProperty(obj, '_wsUpdateMode', {
value: function(){
$(mediaelem).triggerHandler('updatetrackdisplay');
},
enumerable: false
});
} }
return obj; 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: taken from:
@ -711,7 +729,7 @@ modified for webshims
var name = copyName[copyProp] || copyProp; var name = copyName[copyProp] || copyProp;
webshims.onNodeNamesPropertyModify('track', copyProp, function(){ webshims.onNodeNamesPropertyModify('track', copyProp, function(){
var trackData = webshims.data(this, 'trackData'); var trackData = webshims.data(this, 'trackData');
var track = this;
if(trackData){ if(trackData){
if(copyProp == 'kind'){ if(copyProp == 'kind'){
refreshTrack(this, trackData); refreshTrack(this, trackData);