vendor/assets/javascripts/webshims/minified/shims/mediaelement-jaris.js in webshims-rails-0.4.4 vs vendor/assets/javascripts/webshims/minified/shims/mediaelement-jaris.js in webshims-rails-0.4.5
- old
+ new
@@ -1,23 +2 @@
-jQuery.webshims.register("mediaelement-jaris",function(d,f,l,D,p,j){var m=f.mediaelement,x=l.swfobject,r=Modernizr.audio&&Modernizr.video,y=x.hasFlashPlayerVersion("9.0.115"),q=0,l={paused:!0,ended:!1,currentSrc:"",duration:l.NaN,readyState:0,networkState:0,videoHeight:0,videoWidth:0,error:null,buffered:{start:function(b){if(b)f.error("buffered index size error");else return 0},end:function(b){if(b)f.error("buffered index size error");else return 0},length:0}},E=Object.keys(l),z={currentTime:0,volume:1,
-muted:!1};Object.keys(z);var A=d.extend({isActive:"html5",activating:"html5",wasSwfReady:!1,_bufferedEnd:0,_bufferedStart:0,currentTime:0,_ppFlag:p,_calledMeta:!1,lastDuration:0},l,z),i=function(b){return(b=f.data(b,"mediaelement"))&&"third"==b.isActive?b:null},g=function(b,a){a=d.Event(a);a.preventDefault();d.event.trigger(a,p,b)},F=j.playerPath||f.cfg.basePath+"swf/"+(j.playerName||"JarisFLVPlayer.swf");f.extendUNDEFProp(j.params,{allowscriptaccess:"always",allowfullscreen:"true",wmode:"transparent",
-allowNetworking:"all"});f.extendUNDEFProp(j.vars,{controltype:"1",jsapi:"1"});f.extendUNDEFProp(j.attrs,{bgcolor:"#000000"});var h=function(b,a){3>b&&clearTimeout(a._canplaythroughTimer);if(3<=b&&3>a.readyState)a.readyState=b,g(a._elem,"canplay"),a.paused||g(a._elem,"playing"),clearTimeout(a._canplaythroughTimer),a._canplaythroughTimer=setTimeout(function(){h(4,a)},4E3);if(4<=b&&4>a.readyState)a.readyState=b,g(a._elem,"canplaythrough");a.readyState=b};d.extend(d.event.customEvent,{updatemediaelementdimensions:!0,
-flashblocker:!0,swfstageresize:!0,mediaelementapichange:!0});m.jarisEvent={};var s,n={onPlayPause:function(b,a,c){var e;if(null==c)try{e=a.api.api_get("isPlaying")}catch(d){}else e=c;if(e==a.paused)a.paused=!e,b=a.paused?"pause":"play",a._ppFlag=!0,g(a._elem,b),3>a.readyState&&h(3,a),a.paused||g(a._elem,"playing")},onNotBuffering:function(b,a){h(3,a)},onDataInitialized:function(b,a){var c=a.duration;a.duration=b.duration;if(!(c==a.duration||isNaN(a.duration)||a._calledMeta&&10>Math.abs(a.lastDuration-
-a.duration))){a.lastDuration=a.duration;a.videoHeight=b.height;a.videoWidth=b.width;if(!a.networkState)a.networkState=2;1>a.readyState&&h(1,a);a.duration&&g(a._elem,"durationchange");a._calledMeta||g(a._elem,"loadedmetadata");a._calledMeta=!0}},onBuffering:function(b,a){if(a.ended)a.ended=!1;h(1,a);g(a._elem,"waiting")},onTimeUpdate:function(b,a){if(a.ended)a.ended=!1;3>a.readyState&&(h(3,a),g(a._elem,"playing"));g(a._elem,"timeupdate")},onProgress:function(b,a){if(a.ended)a.ended=!1;if(a.duration&&
-!isNaN(a.duration)){var c=b.loaded/b.total;if(0.02<c&&0.2>c)h(3,a);else if(0.2<c){if(0.99<c)a.networkState=1;h(4,a)}if(a._bufferedEnd&&a._bufferedEnd>c)a._bufferedStart=a.currentTime||0;a._bufferedEnd=c;a.buffered.length=1;d.event.trigger("progress",p,a._elem,!0)}},onPlaybackFinished:function(b,a){4>a.readyState&&h(4,a);a.ended=!0;g(a._elem,"ended")},onVolumeChange:function(b,a){if(a.volume!=b.volume||a.muted!=b.mute)a.volume=b.volume,a.muted=b.mute,g(a._elem,"volumechange")},ready:function(){var b=
-function(a){var b=!0;try{a.api.api_get("volume")}catch(e){b=!1}return b};return function(a,c){var e=0,g=function(){9<e?c.tryedReframeing=0:(e++,c.tryedReframeing++,b(c)?(c.wasSwfReady=!0,c.tryedReframeing=0,G(c),H(c)):6>c.tryedReframeing?3>c.tryedReframeing?(c.reframeTimer=setTimeout(g,9),c.shadowElem.css({overflow:"visible"}),setTimeout(function(){c.shadowElem.css({overflow:"hidden"})},1)):(c.shadowElem.css({overflow:"hidden"}),d(c._elem).mediaLoad()):(clearTimeout(c.reframeTimer),f.error("reframing error")))};
-if(c&&c.api){if(!c.tryedReframeing)c.tryedReframeing=0;clearTimeout(s);clearTimeout(c.reframeTimer);c.shadowElem.removeClass("flashblocker-assumed");e?c.reframeTimer=setTimeout(g,9):g()}}}()};n.onMute=n.onVolumeChange;var G=function(b){var a=b.actionQueue.length,c=0,e;if(a&&"third"==b.isActive)for(;b.actionQueue.length&&a>c;){c++;e=b.actionQueue.shift();try{b.api[e.fn].apply(b.api,e.args)}catch(d){f.warn(d)}}if(b.actionQueue.length)b.actionQueue=[]},H=function(b){b&&(b._ppFlag===p&&d.prop(b._elem,
-"autoplay")||!b.paused)&&setTimeout(function(){if("third"==b.isActive&&(b._ppFlag===p||!b.paused))try{d(b._elem).play(),b._ppFlag=!0}catch(a){}},1)},u=d.noop;if(r){var I={play:1,playing:1},B="play,pause,playing,canplay,progress,waiting,ended,loadedmetadata,durationchange,emptied".split(","),C=B.map(function(b){return b+".webshimspolyfill"}).join(" "),J=function(b){var a=f.data(b.target,"mediaelement");a&&(b.originalEvent&&b.originalEvent.type===b.type)==("third"==a.activating)&&(b.stopImmediatePropagation(),
-I[b.type]&&a.isActive!=a.activating&&d(b.target).pause())},u=function(b){d(b).off(C).on(C,J);B.forEach(function(a){f.moveToFirstEvent(b,a)})};u(D)}m.setActive=function(b,a,c){c||(c=f.data(b,"mediaelement"));if(c&&c.isActive!=a){"html5"!=a&&"third"!=a&&f.warn("wrong type for mediaelement activating: "+a);var e=f.data(b,"shadowData");c.activating=a;d(b).pause();c.isActive=a;"third"==a?(e.shadowElement=e.shadowFocusElement=c.shadowElem[0],d(b).addClass("swf-api-active nonnative-api-active").hide().getShadowElement().show()):
-(d(b).removeClass("swf-api-active nonnative-api-active").show().getShadowElement().hide(),e.shadowElement=e.shadowFocusElement=!1);d(b).trigger("mediaelementapichange")}};var K=function(){var b="_calledMeta,lastDuration,_bufferedEnd,_bufferedStart,_ppFlag,currentSrc,currentTime,duration,ended,networkState,paused,videoHeight,videoWidth".split(","),a=b.length;return function(c){if(c){var e=a,d=c.networkState;for(h(0,c);-1<--e;)delete c[b[e]];c.actionQueue=[];c.buffered.length=0;d&&g(c._elem,"emptied")}}}(),
-v=function(b,a){var c=b._elem,e=b.shadowElem;d(c)[a?"addClass":"removeClass"]("webshims-controls");"audio"==b._elemNodeName&&!a?e.css({width:0,height:0}):e.css({width:c.style.width||d(c).width(),height:c.style.height||d(c).height()})};m.createSWF=function(b,a,c){if(y){1>q?q=1:q++;var e=d.extend({},j.vars,{poster:d.prop(b,"poster")||"",source:a.srcProp}),g=d(b).data("vars")||{};c||(c=f.data(b,"mediaelement"));var w=d.prop(b,"controls"),k="jarisplayer-"+f.getID(b),h=d.extend({},j.params,d(b).data("params")),
-i=b.nodeName.toLowerCase(),l=d.extend({},j.attrs,{name:k,id:k},d(b).data("attrs")),o;c&&c.swfCreated?(clearInterval(c.readyInterval),m.setActive(b,"third",c),c.currentSrc=a.srcProp,c.shadowElem.html('<div id="'+k+'">'),c.api=!1,c.actionQueue=[],o=c.shadowElem,K(c)):(o=d('<div class="polyfill-'+i+' polyfill-mediaelement" id="wrapper-'+k+'"><div id="'+k+'"></div>').css({position:"relative",overflow:"hidden"}),c=f.data(b,"mediaelement",f.objectCreate(A,{actionQueue:{value:[]},shadowElem:{value:o},_elemNodeName:{value:i},
-_elem:{value:b},currentSrc:{value:a.srcProp},swfCreated:{value:!0},id:{value:k.replace(/-/g,"")},buffered:{value:{start:function(a){if(a>=c.buffered.length)f.error("buffered index size error");else return 0},end:function(a){if(a>=c.buffered.length)f.error("buffered index size error");else return(c.duration-c._bufferedStart)*c._bufferedEnd+c._bufferedStart},length:0}}})),v(c,w),o.insertBefore(b),r&&d.extend(c,{volume:d.prop(b,"volume"),muted:d.prop(b,"muted")}),f.addShadowDom(b,o),u(b),m.setActive(b,
-"third",c),d(b).on("updatemediaelementdimensions updateshadowdom",function(){v(c,d.prop(b,"controls"))}));m.jarisEvent[c.id]||(m.jarisEvent[c.id]=function(a){if("ready"==a.type)n[a.type](a,c);else{c.currentTime=a.position;if(!c._calledMeta&&isNaN(a.duration)&&c.duration!=a.duration&&isNaN(c.duration))n.onDataInitialized(a,c);if(!c._ppFlag&&"onPlayPause"!=a.type)n.onPlayPause(a,c);if(n[a.type])n[a.type](a,c);c.duration=a.duration}});d(function(){clearInterval(c.readyInterval);clearInterval(c.flashBlock);
-c.readyInterval=setTimeout(function(){d.extend(e,{id:k,evtId:c.id,controls:""+w,autostart:"false"},g);if("audio/mpeg"==a.type||"audio/mp3"==a.type)e.type="audio",e.streamtype="file";else if("video/youtube"==a.type)e.streamtype="youtube";j.changeSWF(e,b,a,c,"embed");x.embedSWF(F,k,"100%","100%","9.0.0",!1,e,h,l,function(a){if(a.success)c.api=a.ref,w||d(a.ref).attr("tabindex","-1").css("outline","none"),c.flashBlock=setTimeout(function(){if(!a.ref.parentNode&&o[0].parentNode||"none"==a.ref.style.display)o.addClass("flashblocker-assumed"),
-d(b).trigger("flashblocker"),f.warn("flashblocker assumed");d(a.ref).css({minHeight:"2px",minWidth:"2px",display:"block"})},9),s||(clearTimeout(s),s=setTimeout(function(){var b=d(a.ref);1<b[0].offsetWidth&&1<b[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>b[0].offsetWidth||2>b[0].offsetHeight)&&f.warn("JS-SWF connection can't be established on hidden or unconnected flash objects")},
-8E3))})},9)})}else setTimeout(function(){d(b).mediaLoad()},1)};var t=function(b,a,c,d){return(d=d||i(b))?(d.api&&d.api[a]?d.api[a].apply(d.api,c||[]):(d.actionQueue.push({fn:a,args:c}),10<d.actionQueue.length&&setTimeout(function(){5<d.actionQueue.length&&d.actionQueue.shift()},99)),d):!1};["audio","video"].forEach(function(b){var a={},c,e=function(d){"audio"==b&&("videoHeight"==d||"videoWidth"==d)||(a[d]={get:function(){var a=i(this);return a?a[d]:r&&c[d].prop._supget?c[d].prop._supget.apply(this):
-A[d]},writeable:!1})},h=function(b,c){e(b);delete a[b].writeable;a[b].set=c};h("volume",function(a){var b=i(this);if(b){if(a*=1,!isNaN(a)&&((0>a||1<a)&&f.error("volume greater or less than allowed "+a/100),t(this,"api_volume",[a],b),b.volume!=a))b.volume=a,g(b._elem,"volumechange")}else if(c.volume.prop._supset)return c.volume.prop._supset.apply(this,arguments)});h("muted",function(a){var b=i(this);if(b){if(a=!!a,t(this,"api_volume",[a?0:b.volume||1],b),b.muted!=a)b.muted=a,g(b._elem,"volumechange")}else if(c.muted.prop._supset)return c.muted.prop._supset.apply(this,
-arguments)});h("currentTime",function(a){var b=i(this);if(b)a*=1,isNaN(a)||t(this,"api_seek",[a],b);else if(c.currentTime.prop._supset)return c.currentTime.prop._supset.apply(this,arguments)});["play","pause"].forEach(function(b){a[b]={value:function(){var a=i(this);if(a){if(a.stopPlayPause&&clearTimeout(a.stopPlayPause),t(this,"play"==b?"api_play":"api_pause",[],a),a._ppFlag=!0,a.paused!=("play"!=b))a.paused="play"!=b,g(a._elem,b)}else if(c[b].prop._supvalue)return c[b].prop._supvalue.apply(this,
-arguments)}}});E.forEach(e);f.onNodeNamesPropertyModify(b,"controls",function(a,c){var e=i(this);d(this)[c?"addClass":"removeClass"]("webshims-controls");e&&(f.warn("changing controls currently not fully supported with jaris player"),"audio"==b&&v(e,c),e.api&&d(this).mediaLoad())});c=f.defineNodeNameProperties(b,a,"prop")});if(y){var L=d.cleanData,M=d.browser.msie&&9>f.browserVersion,N={object:1,OBJECT:1};d.cleanData=function(b){var a,c,d;if(b&&(c=b.length)&&q)for(a=0;a<c;a++)if(N[b[a].nodeName]){if("api_pause"in
-b[a]){q--;try{b[a].api_pause()}catch(f){}}if(M)try{for(d in b[a])"function"==typeof b[a][d]&&(b[a][d]=null)}catch(g){}}return L.apply(this,arguments)}}r||(["poster","src"].forEach(function(b){f.defineNodeNamesProperty("src"==b?["audio","video","source"]:["video"],b,{reflect:!0,propType:"src"})}),["autoplay","controls"].forEach(function(b){f.defineNodeNamesBooleanProperty(["audio","video"],b)}),f.defineNodeNamesProperties(["audio","video"],{HAVE_CURRENT_DATA:{value:2},HAVE_ENOUGH_DATA:{value:4},HAVE_FUTURE_DATA:{value:3},
-HAVE_METADATA:{value:1},HAVE_NOTHING:{value:0},NETWORK_EMPTY:{value:0},NETWORK_IDLE:{value:1},NETWORK_LOADING:{value:2},NETWORK_NO_SOURCE:{value:3}},"prop"))});
+jQuery.webshims.register("mediaelement-jaris",function(e,t,n,r,i,s){"use strict";var o=t.mediaelement,u=n.swfobject,a=Modernizr.audio&&Modernizr.video,f=u.hasFlashPlayerVersion("9.0.115"),l=0,c={paused:!0,ended:!1,currentSrc:"",duration:n.NaN,readyState:0,networkState:0,videoHeight:0,videoWidth:0,error:null,buffered:{start:function(e){if(e){t.error("buffered index size error");return}return 0},end:function(e){if(e){t.error("buffered index size error");return}return 0},length:0}},h=Object.keys(c),p={currentTime:0,volume:1,muted:!1},d=Object.keys(p),v=e.extend({isActive:"html5",activating:"html5",wasSwfReady:!1,_bufferedEnd:0,_bufferedStart:0,currentTime:0,_ppFlag:i,_calledMeta:!1,lastDuration:0},c,p),m=/^jarisplayer-/,g=function(e){var n=r.getElementById(e.replace(m,""));if(!n)return;var i=t.data(n,"mediaelement");return i.isActive=="third"?i:null},y=function(e){try{e.nodeName}catch(n){return null}var r=t.data(e,"mediaelement");return r&&r.isActive=="third"?r:null},b=function(t,n){n=e.Event(n),n.preventDefault(),e.event.trigger(n,i,t)},w=s.playerPath||t.cfg.basePath+"swf/"+(s.playerName||"JarisFLVPlayer.swf");t.extendUNDEFProp(s.params,{allowscriptaccess:"always",allowfullscreen:"true",wmode:"transparent",allowNetworking:"all"}),t.extendUNDEFProp(s.vars,{controltype:"1",jsapi:"1"}),t.extendUNDEFProp(s.attrs,{bgcolor:"#000000"});var E=function(e,t){e<3&&clearTimeout(t._canplaythroughTimer),e>=3&&t.readyState<3&&(t.readyState=e,b(t._elem,"canplay"),t.paused||b(t._elem,"playing"),clearTimeout(t._canplaythroughTimer),t._canplaythroughTimer=setTimeout(function(){E(4,t)},4e3)),e>=4&&t.readyState<4&&(t.readyState=e,b(t._elem,"canplaythrough")),t.readyState=e};e.extend(e.event.customEvent,{updatemediaelementdimensions:!0,flashblocker:!0,swfstageresize:!0,mediaelementapichange:!0}),o.jarisEvent={};var S,x={onPlayPause:function(e,t,n){var r,i;if(n==null)try{r=t.api.api_get("isPlaying")}catch(s){}else r=n;r==t.paused&&(t.paused=!r,i=t.paused?"pause":"play",t._ppFlag=!0,b(t._elem,i),t.readyState<3&&E(3,t),t.paused||b(t._elem,"playing"))},onNotBuffering:function(e,t){E(3,t)},onDataInitialized:function(e,t){var n=t.duration,r;t.duration=e.duration;if(n==t.duration||isNaN(t.duration))return;if(t._calledMeta&&(r=Math.abs(t.lastDuration-t.duration))<2)return;t.videoHeight=e.height,t.videoWidth=e.width,t.networkState||(t.networkState=2),t.readyState<1&&E(1,t),clearTimeout(t._durationChangeTimer),t._calledMeta&&t.duration?t._durationChangeTimer=setTimeout(function(){t.lastDuration=t.duration,b(t._elem,"durationchange")},r>50?0:r>9?9:99):(t.lastDuration=t.duration,t.duration&&b(t._elem,"durationchange"),t._calledMeta||b(t._elem,"loadedmetadata")),t._calledMeta=!0},onBuffering:function(e,t){t.ended&&(t.ended=!1),E(1,t),b(t._elem,"waiting")},onTimeUpdate:function(e,t){t.ended&&(t.ended=!1),t.readyState<3&&(E(3,t),b(t._elem,"playing")),b(t._elem,"timeupdate")},onProgress:function(t,n){n.ended&&(n.ended=!1);if(!n.duration||isNaN(n.duration))return;var r=t.loaded/t.total;r>.02&&r<.2?E(3,n):r>.2&&(r>.99&&(n.networkState=1),E(4,n)),n._bufferedEnd&&n._bufferedEnd>r&&(n._bufferedStart=n.currentTime||0),n._bufferedEnd=r,n.buffered.length=1,e.event.trigger("progress",i,n._elem,!0)},onPlaybackFinished:function(e,t){t.readyState<4&&E(4,t),t.ended=!0,b(t._elem,"ended")},onVolumeChange:function(e,t){if(t.volume!=e.volume||t.muted!=e.mute)t.volume=e.volume,t.muted=e.mute,b(t._elem,"volumechange")},ready:function(){var n=function(e){var t=!0;try{e.api.api_get("volume")}catch(n){t=!1}return t};return function(r,i){var s=0,o=function(){if(s>9){i.tryedReframeing=0;return}s++,i.tryedReframeing++,n(i)?(i.wasSwfReady=!0,i.tryedReframeing=0,N(i),T(i)):i.tryedReframeing<6?i.tryedReframeing<3?(i.reframeTimer=setTimeout(o,9),i.shadowElem.css({overflow:"visible"}),setTimeout(function(){i.shadowElem.css({overflow:"hidden"})},1)):(i.shadowElem.css({overflow:"hidden"}),e(i._elem).mediaLoad()):(clearTimeout(i.reframeTimer),t.error("reframing error"))};if(!i||!i.api)return;i.tryedReframeing||(i.tryedReframeing=0),clearTimeout(S),clearTimeout(i.reframeTimer),i.shadowElem.removeClass("flashblocker-assumed"),s?i.reframeTimer=setTimeout(o,9):o()}}()};x.onMute=x.onVolumeChange;var T=function(e){var n=e.actionQueue.length,r=0,i;if(n&&e.isActive=="third")while(e.actionQueue.length&&n>r){r++,i=e.actionQueue.shift();try{e.api[i.fn].apply(e.api,i.args)}catch(s){t.warn(s)}}e.actionQueue.length&&(e.actionQueue=[])},N=function(t){if(!t)return;(t._ppFlag===i&&e.prop(t._elem,"autoplay")||!t.paused)&&setTimeout(function(){if(t.isActive=="third"&&(t._ppFlag===i||!t.paused))try{e(t._elem).play(),t._ppFlag=!0}catch(n){}},1),t.muted&&e.prop(t._elem,"muted",!0),t.volume!=1&&e.prop(t._elem,"volume",t.volume)},C=e.noop;if(a){var k={play:1,playing:1},L=["play","pause","playing","canplay","progress","waiting","ended","loadedmetadata","durationchange","emptied"],A=L.map(function(e){return e+".webshimspolyfill"}).join(" "),O=function(n){var r=t.data(n.target,"mediaelement");if(!r)return;var i=n.originalEvent&&n.originalEvent.type===n.type;i==(r.activating=="third")&&(n.stopImmediatePropagation(),k[n.type]&&r.isActive!=r.activating&&e(n.target).pause())};C=function(n){e(n).off(A).on(A,O),L.forEach(function(e){t.moveToFirstEvent(n,e)})},C(r)}o.setActive=function(n,r,i){i||(i=t.data(n,"mediaelement"));if(!i||i.isActive==r)return;r!="html5"&&r!="third"&&t.warn("wrong type for mediaelement activating: "+r);var s=t.data(n,"shadowData");i.activating=r,e(n).pause(),i.isActive=r,r=="third"?(s.shadowElement=s.shadowFocusElement=i.shadowElem[0],e(n).addClass("swf-api-active nonnative-api-active").hide().getShadowElement().show()):(e(n).removeClass("swf-api-active nonnative-api-active").show().getShadowElement().hide(),s.shadowElement=s.shadowFocusElement=!1),e(n).trigger("mediaelementapichange")};var M=function(){var e=["_calledMeta","lastDuration","_bufferedEnd","_bufferedStart","_ppFlag","currentSrc","currentTime","duration","ended","networkState","paused","videoHeight","videoWidth"],t=e.length;return function(n){if(!n)return;var r=t,i=n.networkState;E(0,n),clearTimeout(n._durationChangeTimer);while(--r>-1)delete n[e[r]];n.actionQueue=[],n.buffered.length=0,i&&b(n._elem,"emptied")}}(),_=function(t,n){var r=t._elem,i=t.shadowElem;e(r)[n?"addClass":"removeClass"]("webshims-controls"),t._elemNodeName=="audio"&&!n?i.css({width:0,height:0}):i.css({width:r.style.width||e(r).width(),height:r.style.height||e(r).height()})};o.createSWF=function(n,r,i){if(!f){setTimeout(function(){e(n).mediaLoad()},1);return}l<1?l=1:l++;var c=r.type=="audio/rtmp"||r.type=="video/rtmp",h=e.extend({},s.vars,{poster:e.prop(n,"poster")||"",source:r.streamId||r.srcProp,server:r.server||""}),p=e(n).data("vars")||{};i||(i=t.data(n,"mediaelement"));var d=e.prop(n,"controls"),m="jarisplayer-"+t.getID(n),g=e.extend({},s.params,e(n).data("params")),y=n.nodeName.toLowerCase(),b=e.extend({},s.attrs,{name:m,id:m},e(n).data("attrs")),E;i&&i.swfCreated?(o.setActive(n,"third",i),i.currentSrc=r.srcProp,i.shadowElem.html('<div id="'+m+'">'),i.api=!1,i.actionQueue=[],E=i.shadowElem,M(i)):(E=e('<div class="polyfill-'+y+' polyfill-mediaelement" id="wrapper-'+m+'"><div id="'+m+'"></div>').css({position:"relative",overflow:"hidden"}),i=t.data(n,"mediaelement",t.objectCreate(v,{actionQueue:{value:[]},shadowElem:{value:E},_elemNodeName:{value:y},_elem:{value:n},currentSrc:{value:r.srcProp},swfCreated:{value:!0},id:{value:m.replace(/-/g,"")},buffered:{value:{start:function(e){if(e>=i.buffered.length){t.error("buffered index size error");return}return 0},end:function(e){if(e>=i.buffered.length){t.error("buffered index size error");return}return(i.duration-i._bufferedStart)*i._bufferedEnd+i._bufferedStart},length:0}}})),_(i,d),E.insertBefore(n),a&&e.extend(i,{volume:e.prop(n,"volume"),muted:e.prop(n,"muted"),paused:e.prop(n,"paused")}),t.addShadowDom(n,E),C(n),o.setActive(n,"third",i),e(n).on("updatemediaelementdimensions updateshadowdom",function(){_(i,e.prop(n,"controls"))})),o.jarisEvent[i.id]||(o.jarisEvent[i.id]=function(e){e.type=="ready"?i.api?x[e.type](e,i):setTimeout(function(){x[e.type](e,i)},9):(i.currentTime=e.position,i.api&&(!i._calledMeta&&isNaN(e.duration)&&i.duration!=e.duration&&isNaN(i.duration)&&x.onDataInitialized(e,i),!i._ppFlag&&e.type!="onPlayPause"&&x.onPlayPause(e,i),x[e.type]&&x[e.type](e,i)),i.duration=e.duration)}),e.extend(h,{id:m,evtId:i.id,controls:""+d,autostart:"false",nodename:y},p),c?h.streamtype="rtmp":r.type=="audio/mpeg"||r.type=="audio/mp3"?(h.type="audio",h.streamtype="file"):r.type=="video/youtube"&&(h.streamtype="youtube"),s.changeSWF(h,n,r,i,"embed"),clearTimeout(i.flashBlock),u.embedSWF(w,m,"100%","100%","9.0.0",!1,h,g,b,function(r){r.success&&(i.api=r.ref,d||e(r.ref).attr("tabindex","-1").css("outline","none"),i.flashBlock=setTimeout(function(){if(!r.ref.parentNode&&E[0].parentNode||r.ref.style.display=="none")E.addClass("flashblocker-assumed"),e(n).trigger("flashblocker"),t.warn("flashblocker assumed");e(r.ref).css({minHeight:"2px",minWidth:"2px",display:"block"})},9),S||(clearTimeout(S),S=setTimeout(function(){var n=e(r.ref);n[0].offsetWidth>1&&n[0].offsetHeight>1&&location.protocol.indexOf("file:")===0?t.error("Add your local development-directory to the local-trusted security sandbox: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html"):(n[0].offsetWidth<2||n[0].offsetHeight<2)&&t.warn("JS-SWF connection can't be established on hidden or unconnected flash objects"),n=null},8e3)))})};var D=function(e,t,n,r){return r=r||y(e),r?(r.api&&r.api[t]?r.api[t].apply(r.api,n||[]):(r.actionQueue.push({fn:t,args:n}),r.actionQueue.length>10&&setTimeout(function(){r.actionQueue.length>5&&r.actionQueue.shift()},99)),r):!1};["audio","video"].forEach(function(n){var r={},i,s=function(e){if(n=="audio"&&(e=="videoHeight"||e=="videoWidth"))return;r[e]={get:function(){var t=y(this);return t?t[e]:a&&i[e].prop._supget?i[e].prop._supget.apply(this):v[e]},writeable:!1}},o=function(e,t){s(e),delete r[e].writeable,r[e].set=t};o("volume",function(e){var n=y(this);if(n)e*=1,isNaN(e)||((e<0||e>1)&&t.error("volume greater or less than allowed "+e/100),D(this,"api_volume",[e],n),n.volume!=e&&(n.volume=e,b(n._elem,"volumechange")),n=null);else if(i.volume.prop._supset)return i.volume.prop._supset.apply(this,arguments)}),o("muted",function(e){var t=y(this);if(t)e=!!e,D(this,"api_muted",[e],t),t.muted!=e&&(t.muted=e,b(t._elem,"volumechange")),t=null;else if(i.muted.prop._supset)return i.muted.prop._supset.apply(this,arguments)}),o("currentTime",function(e){var t=y(this);if(t)e*=1,isNaN(e)||D(this,"api_seek",[e],t);else if(i.currentTime.prop._supset)return i.currentTime.prop._supset.apply(this,arguments)}),["play","pause"].forEach(function(e){r[e]={value:function(){var t=y(this);if(t)t.stopPlayPause&&clearTimeout(t.stopPlayPause),D(this,e=="play"?"api_play":"api_pause",[],t),t._ppFlag=!0,t.paused!=(e!="play")&&(t.paused=e!="play",b(t._elem,e));else if(i[e].prop._supvalue)return i[e].prop._supvalue.apply(this,arguments)}}}),h.forEach(s),t.onNodeNamesPropertyModify(n,"controls",function(r,i){var s=y(this);e(this)[i?"addClass":"removeClass"]("webshims-controls"),s&&(t.warn("changing controls currently not fully supported with jaris player"),n=="audio"&&_(s,i),D(this,"api_controls",[i],s))}),i=t.defineNodeNameProperties(n,r,"prop")});if(f){var P=e.cleanData,H=e.browser.msie&&t.browserVersion<9,B={object:1,OBJECT:1};e.cleanData=function(e){var t,n,r;if(e&&(n=e.length)&&l)for(t=0;t<n;t++)if(B[e[t].nodeName]){if("api_pause"in e[t]){l--;try{e[t].api_pause()}catch(i){}}if(H)try{for(r in e[t])typeof e[t][r]=="function"&&(e[t][r]=null)}catch(i){}}return P.apply(this,arguments)}}a||(["poster","src"].forEach(function(e){t.defineNodeNamesProperty(e=="src"?["audio","video","source"]:["video"],e,{reflect:!0,propType:"src"})}),["autoplay","controls"].forEach(function(e){t.defineNodeNamesBooleanProperty(["audio","video"],e)}),t.defineNodeNamesProperties(["audio","video"],{HAVE_CURRENT_DATA:{value:2},HAVE_ENOUGH_DATA:{value:4},HAVE_FUTURE_DATA:{value:3},HAVE_METADATA:{value:1},HAVE_NOTHING:{value:0},NETWORK_EMPTY:{value:0},NETWORK_IDLE:{value:1},NETWORK_LOADING:{value:2},NETWORK_NO_SOURCE:{value:3}},"prop"))});
\ No newline at end of file