vendor/assets/javascripts/webshims/minified/shims/mediaelement-swf.js in webshims-rails-0.4.2 vs vendor/assets/javascripts/webshims/minified/shims/mediaelement-swf.js in webshims-rails-0.4.3

- old
+ new

@@ -18,10 +18,10 @@ var Q=function(){var a="_bufferedEnd,_bufferedStart,_metadata,_ppFlag,currentSrc,currentTime,duration,ended,networkState,paused,videoHeight,videoWidth,_callMeta,_durationCalcs".split(","),b=a.length;return function(d){if(d){var c=b,f=d.networkState;for(k(0,d);--c;)delete d[a[c]];d.actionQueue=[];d.buffered.length=0;f&&g(d._elem,"emptied")}}}(),z=function(a,b){var d=a._elem,e=a.shadowElem;c(d)[b?"addClass":"removeClass"]("webshims-controls");"audio"==a._elemNodeName&&!b?e.css({width:0,height:0}):e.css({width:d.style.width|| c(d).width(),height:d.style.height||c(d).height()})};h.createSWF=function(a,b,d){if(B){1>t?t=1:t++;var e=c.extend({},j.jwVars,{image:c.prop(a,"poster")||"",file:b.srcProp}),g=c(a).data("jwvars")||{};d||(d=f.data(a,"mediaelement"));if(d&&d.swfCreated)h.setActive(a,"third",d),Q(d),d.currentSrc=b.srcProp,c.extend(e,g),j.changeJW(e,a,b,d,"load"),r(a,"sendEvent",["LOAD",e]);else{var o=c.prop(a,"controls"),i="jwplayer-"+f.getID(a),l=c.extend({},j.jwParams,c(a).data("jwparams")),k=a.nodeName.toLowerCase(), n=c.extend({},j.jwAttrs,{name:i,id:i},c(a).data("jwattrs")),m=c('<div class="polyfill-'+k+' polyfill-mediaelement" id="wrapper-'+i+'"><div id="'+i+'"></div>').css({position:"relative",overflow:"hidden"}),d=f.data(a,"mediaelement",f.objectCreate(D,{actionQueue:{value:[]},shadowElem:{value:m},_elemNodeName:{value:k},_elem:{value:a},currentSrc:{value:b.srcProp},swfCreated:{value:!0},buffered:{value:{start:function(a){if(a>=d.buffered.length)f.error("buffered index size error");else return 0},end:function(a){if(a>= d.buffered.length)f.error("buffered index size error");else return(d.duration-d._bufferedStart)*d._bufferedEnd/100+d._bufferedStart},length:0}}}));z(d,o);m.insertBefore(a);v&&c.extend(d,{volume:c.prop(a,"volume"),muted:c.prop(a,"muted")});c.extend(e,{id:i,controlbar:o?j.jwVars.controlbar||("video"==k?"over":"bottom"):"video"==k?"none":"bottom",icons:""+(o&&"video"==k)},g,{playerready:"jQuery.webshims.mediaelement.jwPlayerReady"});e.plugins=e.plugins?e.plugins+(","+F):F;f.addShadowDom(a,m);y(a);h.setActive(a, "third",d);j.changeJW(e,a,b,d,"embed");c(a).bind("updatemediaelementdimensions updateshadowdom",function(){z(d,c.prop(a,"controls"))});N(d);A.embedSWF(K,i,"100%","100%","9.0.0",!1,e,l,n,function(b){if(b.success)d.jwapi=b.ref,o||c(b.ref).attr("tabindex","-1").css("outline","none"),setTimeout(function(){if(!b.ref.parentNode&&m[0].parentNode||"none"==b.ref.style.display)m.addClass("flashblocker-assumed"),c(a).trigger("flashblocker"),f.warn("flashblocker assumed");c(b.ref).css({minHeight:"2px",minWidth:"2px", -display:"block"})},9),w||(clearTimeout(w),w=setTimeout(function(){var a=c(b.ref);1<a[0].offsetWidth&&1<a[0].offsetHeight&&0===location.protocol.indexOf("file:")?f.error("Add your local development-directory to the local-trusted security sandbox: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html"):(2>a[0].offsetWidth||2>a[0].offsetHeight)&&f.info("JS-SWF connection can't be established on hidden or unconnected flash objects")},8E3))})}}else setTimeout(function(){c(a).mediaLoad()}, +display:"block"})},9),w||(clearTimeout(w),w=setTimeout(function(){var a=c(b.ref);1<a[0].offsetWidth&&1<a[0].offsetHeight&&0===location.protocol.indexOf("file:")?f.error("Add your local development-directory to the local-trusted security sandbox: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html"):(2>a[0].offsetWidth||2>a[0].offsetHeight)&&f.warn("JS-SWF connection can't be established on hidden or unconnected flash objects")},8E3))})}}else setTimeout(function(){c(a).mediaLoad()}, 1)};var r=function(a,b,d,c){return(c=c||n(a))?(c.jwapi&&c.jwapi[b]?c.jwapi[b].apply(c.jwapi,d||[]):(c.actionQueue.push({fn:b,args:d}),10<c.actionQueue.length&&setTimeout(function(){5<c.actionQueue.length&&c.actionQueue.shift()},99)),c):!1};["audio","video"].forEach(function(a){var b={},d,e=function(c){"audio"==a&&("videoHeight"==c||"videoWidth"==c)||(b[c]={get:function(){var a=n(this);return a?a[c]:v&&d[c].prop._supget?d[c].prop._supget.apply(this):D[c]},writeable:!1})},h=function(a,c){e(a);delete b[a].writeable; b[a].set=c};h("volume",function(a){var b=n(this);if(b){if(a*=100,!isNaN(a)){var c=b.muted;(0>a||100<a)&&f.error("volume greater or less than allowed "+a/100);r(this,"sendEvent",["VOLUME",a],b);if(c)try{b.jwapi.sendEvent("mute","true")}catch(e){}a/=100;if(!(b.volume==a||"third"!=b.isActive))b.volume=a,g(b._elem,"volumechange")}}else if(d.volume.prop._supset)return d.volume.prop._supset.apply(this,arguments)});h("muted",function(a){var b=n(this);if(b){if(a=!!a,r(this,"sendEvent",["mute",""+a],b),!(b.muted== a||"third"!=b.isActive))b.muted=a,g(b._elem,"volumechange")}else if(d.muted.prop._supset)return d.muted.prop._supset.apply(this,arguments)});h("currentTime",function(a){var b=n(this);if(b){if(a*=1,!isNaN(a)){if(b.paused)clearTimeout(b.stopPlayPause),b.stopPlayPause=setTimeout(function(){b.paused=!0;b.stopPlayPause=!1},50);r(this,"sendEvent",["SEEK",""+a],b);if(b.paused){if(0<b.readyState)b.currentTime=a,g(b._elem,"timeupdate");try{b.jwapi.sendEvent("play","false")}catch(c){}}}}else if(d.currentTime.prop._supset)return d.currentTime.prop._supset.apply(this, arguments)});["play","pause"].forEach(function(a){b[a]={value:function(){var b=n(this);if(b)b.stopPlayPause&&clearTimeout(b.stopPlayPause),r(this,"sendEvent",["play","play"==a],b),setTimeout(function(){if("third"==b.isActive&&(b._ppFlag=!0,b.paused!=("play"!=a)))b.paused="play"!=a,g(b._elem,a)},1);else if(d[a].prop._supvalue)return d[a].prop._supvalue.apply(this,arguments)}}});J.forEach(e);f.onNodeNamesPropertyModify(a,"controls",function(b,d){var e=n(this);c(this)[d?"addClass":"removeClass"]("webshims-controls"); if(e){try{r(this,d?"showControls":"hideControls",[a],e)}catch(g){f.warn("you need to generate a crossdomain.xml")}"audio"==a&&z(e,d);c(e.jwapi).attr("tabindex",d?"0":"-1")}});d=f.defineNodeNameProperties(a,b,"prop")});if(B){var R=c.cleanData,S=c.browser.msie&&9>f.browserVersion,T={object:1,OBJECT:1};c.cleanData=function(a){var b,c,e;if(a&&(c=a.length)&&t)for(b=0;b<c;b++)if(T[a[b].nodeName]){if("sendEvent"in a[b]){t--;try{a[b].sendEvent("play",!1)}catch(f){}}if(S)try{for(e in a[b])"function"==typeof a[b][e]&&