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(':');
@ -969,6 +971,22 @@
}); });
//> //>
//<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(){
addPolyfill('canvas', { addPolyfill('canvas', {
@ -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);
@ -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){
@ -718,6 +718,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, test: !hasYt,
d: ['dom-support'] d: ['dom-support']
@ -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){ if(!src.src){
$('source', mediaElem).each(function(){ $('source', mediaElem).each(function(){
src = getSrcObj(this, nodeName); src = getSrcObj(this, nodeName);
if(src.src){srces.push(src);} 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
@ -477,7 +475,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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(':');
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { val = val.split(':');
fVal = 0; if(curCfg.meridian){
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else {
fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ 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;
}, },
@ -2362,9 +2394,12 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
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(':');
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { val = val.split(':');
fVal = 0; if(curCfg.meridian){
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else {
fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ 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;
}, },
@ -1149,9 +1163,12 @@
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){
@ -393,6 +393,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, test: !hasYt,
d: ['dom-support'] d: ['dom-support']
@ -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){ if(!src.src){
$('source', mediaElem).each(function(){ $('source', mediaElem).each(function(){
src = getSrcObj(this, nodeName); src = getSrcObj(this, nodeName);
if(src.src){srces.push(src);} 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){
@ -170,6 +170,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, test: !hasYt,
d: ['dom-support'] d: ['dom-support']
@ -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){ if(!src.src){
$('source', mediaElem).each(function(){ $('source', mediaElem).each(function(){
src = getSrcObj(this, nodeName); src = getSrcObj(this, nodeName);
if(src.src){srces.push(src);} 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
@ -477,7 +475,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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
@ -700,7 +698,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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){
@ -3347,6 +3365,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, test: !hasYt,
d: ['dom-support'] d: ['dom-support']
@ -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){ if(!src.src){
$('source', mediaElem).each(function(){ $('source', mediaElem).each(function(){
src = getSrcObj(this, nodeName); src = getSrcObj(this, nodeName);
if(src.src){srces.push(src);} 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(':');
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { val = val.split(':');
fVal = 0; if(curCfg.meridian){
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else {
fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ 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;
}, },
@ -1765,9 +1779,12 @@ webshims.register('form-number-date-api', function($, webshims, window, document
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
@ -700,7 +698,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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){
@ -2228,6 +2246,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, test: !hasYt,
d: ['dom-support'] d: ['dom-support']
@ -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){ if(!src.src){
$('source', mediaElem).each(function(){ $('source', mediaElem).each(function(){
src = getSrcObj(this, nodeName); src = getSrcObj(this, nodeName);
if(src.src){srces.push(src);} 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;
} }

View File

@ -340,7 +340,7 @@
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 = {
@ -385,6 +385,7 @@
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,
@ -427,6 +428,7 @@
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){
@ -676,7 +678,7 @@
}; };
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;
@ -787,7 +789,7 @@
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){
@ -865,7 +867,7 @@
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',
@ -953,14 +955,14 @@
})(); })();
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;
@ -978,11 +980,12 @@
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(){
@ -1006,42 +1009,27 @@
$(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);
@ -1078,7 +1066,7 @@
value: elem value: elem
}, },
currentSrc: { currentSrc: {
value: canPlaySrc.srcProp value: streamRequest ? '' : canPlaySrc.srcProp
}, },
swfCreated: { swfCreated: {
value: true value: true
@ -1126,6 +1114,7 @@
setElementDimension(data, hasControls); setElementDimension(data, hasControls);
$(elem) $(elem)
.on({ .on({
'updatemediaelementdimensions loadedmetadata emptied': setDimension, 'updatemediaelementdimensions loadedmetadata emptied': setDimension,
'remove': function(e){ 'remove': function(e){
@ -1146,7 +1135,6 @@
} 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){
@ -1186,11 +1174,31 @@
mediaelement.jarisEvent[data.id].elem = elem; mediaelement.jarisEvent[data.id].elem = elem;
} }
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, $.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
}, },
@ -1199,12 +1207,31 @@
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);
@ -1239,10 +1266,11 @@
flash = null; flash = null;
}, 8000); }, 8000);
} }
if(isUserStream){
webshim.usermedia.request(elem, canPlaySrc, data);
}
} }
}); });
trigger(data._elem, 'loadstart');
}; };
@ -1268,6 +1296,7 @@
} }
return false; return false;
}; };
mediaelement.queueSwfMethod = queueSwfMethod;
['audio', 'video'].forEach(function(nodeName){ ['audio', 'video'].forEach(function(nodeName){
var descs = {}; var descs = {};
@ -1428,6 +1457,66 @@
} }
}); });
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;
@ -1547,7 +1636,7 @@
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(){
@ -2038,11 +2127,29 @@
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:
@ -2293,7 +2400,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

@ -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){
@ -393,6 +393,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, test: !hasYt,
d: ['dom-support'] d: ['dom-support']
@ -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){ if(!src.src){
$('source', mediaElem).each(function(){ $('source', mediaElem).each(function(){
src = getSrcObj(this, nodeName); src = getSrcObj(this, nodeName);
if(src.src){srces.push(src);} 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;
} }

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
@ -477,7 +475,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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', {});
@ -1659,26 +1677,31 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} 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);
}
}); });
;webshims.register('mediaelement-jaris', function($, webshims, window, document, undefined, options){ ;webshims.register('mediaelement-jaris', function($, webshims, window, document, undefined, options){
"use strict"; "use strict";
@ -1687,7 +1710,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
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 = {
@ -1732,6 +1755,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
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,
@ -1774,6 +1798,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
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){
@ -2023,7 +2048,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
}; };
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;
@ -2134,7 +2159,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
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){
@ -2212,7 +2237,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
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',
@ -2300,14 +2325,14 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
})(); })();
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;
@ -2325,11 +2350,12 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
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(){
@ -2353,42 +2379,27 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
$(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);
@ -2425,7 +2436,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
value: elem value: elem
}, },
currentSrc: { currentSrc: {
value: canPlaySrc.srcProp value: streamRequest ? '' : canPlaySrc.srcProp
}, },
swfCreated: { swfCreated: {
value: true value: true
@ -2473,6 +2484,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
setElementDimension(data, hasControls); setElementDimension(data, hasControls);
$(elem) $(elem)
.on({ .on({
'updatemediaelementdimensions loadedmetadata emptied': setDimension, 'updatemediaelementdimensions loadedmetadata emptied': setDimension,
'remove': function(e){ 'remove': function(e){
@ -2493,7 +2505,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} 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){
@ -2533,11 +2544,31 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
mediaelement.jarisEvent[data.id].elem = elem; mediaelement.jarisEvent[data.id].elem = elem;
} }
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, $.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
}, },
@ -2546,12 +2577,31 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
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);
@ -2586,10 +2636,11 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
flash = null; flash = null;
}, 8000); }, 8000);
} }
if(isUserStream){
webshim.usermedia.request(elem, canPlaySrc, data);
}
} }
}); });
trigger(data._elem, 'loadstart');
}; };
@ -2615,6 +2666,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
return false; return false;
}; };
mediaelement.queueSwfMethod = queueSwfMethod;
['audio', 'video'].forEach(function(nodeName){ ['audio', 'video'].forEach(function(nodeName){
var descs = {}; var descs = {};
@ -2775,6 +2827,66 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}); });
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;
@ -2894,7 +3006,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
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

@ -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
@ -477,7 +475,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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
@ -477,7 +475,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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
@ -477,7 +475,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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
@ -477,7 +475,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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
@ -477,7 +475,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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(':');
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { val = val.split(':');
fVal = 0; if(curCfg.meridian){
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else {
fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ 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;
}, },
@ -1976,9 +1990,12 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
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(':');
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { val = val.split(':');
fVal = 0; if(curCfg.meridian){
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else {
fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ 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;
}, },
@ -1976,9 +1990,12 @@ webshims.register('form-native-extend', function($, webshims, window, doc, undef
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
@ -700,7 +698,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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){
@ -2540,6 +2558,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, test: !hasYt,
d: ['dom-support'] d: ['dom-support']
@ -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){ if(!src.src){
$('source', mediaElem).each(function(){ $('source', mediaElem).each(function(){
src = getSrcObj(this, nodeName); src = getSrcObj(this, nodeName);
if(src.src){srces.push(src);} 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
@ -700,7 +698,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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){
@ -2243,6 +2261,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, test: !hasYt,
d: ['dom-support'] d: ['dom-support']
@ -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){ if(!src.src){
$('source', mediaElem).each(function(){ $('source', mediaElem).each(function(){
src = getSrcObj(this, nodeName); src = getSrcObj(this, nodeName);
if(src.src){srces.push(src);} 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
@ -477,7 +475,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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(':');
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { val = val.split(':');
fVal = 0; if(curCfg.meridian){
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else {
fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ 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;
}, },
@ -2362,9 +2394,12 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
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
@ -477,7 +475,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
} }
}; };
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(':');
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else { val = val.split(':');
fVal = 0; if(curCfg.meridian){
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else {
fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
} }
if(val[0] === '00'){ 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;
}, },
@ -529,9 +543,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
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

@ -325,9 +325,6 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
}; };
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){
@ -170,6 +170,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
} }
}; };
webshims.addPolyfill('mediaelement-yt', { webshims.addPolyfill('mediaelement-yt', {
test: !hasYt, test: !hasYt,
d: ['dom-support'] d: ['dom-support']
@ -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){ if(!src.src){
$('source', mediaElem).each(function(){ $('source', mediaElem).each(function(){
src = getSrcObj(this, nodeName); src = getSrcObj(this, nodeName);
if(src.src){srces.push(src);} 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

@ -5,7 +5,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
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 = {
@ -50,6 +50,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
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,
@ -92,6 +93,7 @@ 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){
@ -341,7 +343,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
}; };
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;
@ -452,7 +454,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
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){
@ -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',
@ -618,14 +620,14 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
})(); })();
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;
@ -643,11 +645,12 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
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(){
@ -671,42 +674,27 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
$(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);
@ -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
@ -791,6 +779,7 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
setElementDimension(data, hasControls); setElementDimension(data, hasControls);
$(elem) $(elem)
.on({ .on({
'updatemediaelementdimensions loadedmetadata emptied': setDimension, 'updatemediaelementdimensions loadedmetadata emptied': setDimension,
'remove': function(e){ 'remove': function(e){
@ -811,7 +800,6 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} 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){
@ -851,11 +839,31 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
mediaelement.jarisEvent[data.id].elem = elem; mediaelement.jarisEvent[data.id].elem = elem;
} }
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, $.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
}, },
@ -864,12 +872,31 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
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);
@ -904,10 +931,11 @@ 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');
}; };
@ -933,6 +961,7 @@ 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 = {};
@ -1093,6 +1122,66 @@ webshims.register('mediaelement-jaris', function($, webshims, window, document,
} }
}); });
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;
@ -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);