(function(f,g){var n=function(){};var p={initialize:function(){this.userAgent=navigator.userAgent;this.isiPad=this.userAgent.match(/iPad/i)!=null;this.isiPhone=this.userAgent.match(/iPhone/i)!=null;this.isAndroid=this.userAgent.match(/Android/i)!=null;this.screenWidth=f(window).width();this.screenHeight=f(window).height();this.isPhone=this.screenHeight<360;this.isTablet=this.screenHeight>=360&&this.screenHeight<=768;this.isDesktop=this.screenHeight>768;this.hasHTML5VideoCapability=!!document.createElement("video").canPlayType;this.flashPlayerVersion=swfobject.getFlashPlayerVersion();this.hasFlashPlayerCapability=this.flashPlayerVersion.major>=10},adapt:function(r){if(!this.userAgent){this.initialize()}r=f.extend({},f.fn.strobemediaplayback.defaults,r);this.changed=true;var q=0,s=this.rules.length;while(this.changed){this.changed=false;for(q=0;q<s;q++){this.rules[q](this,r)}this.changed=false}return r},setOption:function(r,q,s){if(!r.hasOwnProperty(q)||r[q]!=s){r[q]=s;this.changed=true}},rules:[function(r,q){if(q.favorFlashOverHtml5Video&&r.hasFlashPlayerCapability){r.setOption(q,"useHTML5",false)}else{if(!q.favorFlashOverHtml5Video&&r.hasHTML5VideoCapability){r.setOption(q,"useHTML5",true)}else{if(q.favorFlashOverHtml5Video){r.setOption(q,"useHTML5",!r.hasFlashPlayerCapability)}else{r.setOption(q,"useHTML5",r.hasHTML5VideoCapability)}}}},function(r,q){if(r.isiPhone){r.setOption(q,"javascriptControls",false)}},function(r,q){if(r.isiPad){r.setOption(q,"disabledControls",".volume");r.setOption(q,"javascriptControls",false)}},function(r,q){if(!r.hasFlashPlayerCapability&&!r.hasHTML5VideoCapability){r.setOption(q,"javascriptControls",false);r.setOption(q,"displayAlternativeContent",true)}}]};n.prototype=p;f.fn.adaptiveexperienceconfigurator=new n();var l=function(q,r){this.element=q;this.$element=f(q);this.options=f.extend({},f.fn.strobemediaplayback.defaults,r)};var o=null;var k={initialize:function(){this.options=f.fn.adaptiveexperienceconfigurator.adapt(this.options);if(this.options.useHTML5){var u=navigator.userAgent;var s="";if(this.options.captionTrackURL!=""||typeof this.options.captionTrackURL!="undefined"){s='<track id="captionTrack" src="'+this.options.captionTrackURL+'" kind="subtitle" srclang="en-US" label="English">'}else{}if(u.match(/iPad/i)!=null||u.match(/iPhone/i)!=null){var r=f("<video controls='true' x-webkit-airplay='allow' preload='auto'>"+s+"</video>")}else{var r=f("<video>"+s+"</video>");r.attr("preload","none")}r.attr("id",this.options.id);r.attr("class","smp_video");r.attr("width",this.options.width);r.attr("height",this.options.height);r.attr("src",this.options.src);r.attr("x-webkit-airplay","allow");if(this.options.loop){r.attr("loop","loop")}if(this.options.autoPlay=="true"){r.attr("autoplay","autoplay")}if(this.options.controlBarMode!="none"){r.attr("controls","controls")}if(this.options.poster!=""){r.attr("poster",this.options.poster)}this.$element.replaceWith(r);this.$video=r;this.video=r[0]}else{this.options.queryString=f.fn.strobemediaplayback.generateQueryString(this.options);var t=this.options;t.javascriptCallbackFunction="$.fn.strobemediaplayback.triggerHandler";var v={allowFullScreen:"true",wmode:"direct"};var q={id:this.options.id,name:this.options.id};o=this;swfobject.addParam("wmode","opaque");swfobject.embedSWF(this.options.swf,this.$element.attr("id"),this.options.width,this.options.height,this.options.minimumFlashPlayerVersion,this.options.expressInstallSwfUrl,t,v,q,this.onFlashEmbedComplete);this.monitor=new a(null);this.$video=this.monitor.$videoElement;this.video=this.monitor.videoElement;b[this.options.id]=this.monitor}},onFlashEmbedComplete:function(q){if(!q.success&&f.fn.adaptiveexperienceconfigurator.hasHTML5VideoCapability){o.useHTML5=true;o.initialize()}else{}}};l.prototype=k;f.fn.strobemediaplayback=function(r){var t=[],q;var s=null;this.each(function(){var u=new l(this,r);t.push(u)});for(q=0;q<t.length;q++){t[q].initialize();if(s==null){s=t[q].$video}else{s.push(t[q].video)}}return s};f.fn.strobemediaplayback.defaults={favorFlashOverHtml5Video:true,swf:"StrobeMediaPlayback.swf",javascriptCallbackFunction:"$.fn.strobemediaplayback.triggerHandler",minimumFlashPlayerVersion:"10.0.0",expressInstallSwfUrl:"expressInstall.swf",autoPlay:false,loop:false,controlBarMode:"docked",poster:""};f.fn.strobemediaplayback.parseQueryString=function(v){var u={};var t=v.split("&"),r,w=t.length;for(var s=0;s<w;s++){r=t[s].split("=");if(r[1]=="true"||r[1]=="false"){u[r[0]]=(r[1]=="true")}else{var q=parseFloat(r[1]);if(!isNaN(q)){u[r[0]]=q}else{u[r[0]]=r[1]}}}return u};f.fn.strobemediaplayback.generateQueryString=function(s){var q=[];for(var r in s){if(q.length>0){q.push("&")}q.push(encodeURIComponent(r));q.push("=");q.push((s[r]))}return q.join("")};var b={};var m={};f.fn.strobemediaplayback.triggerHandler=function(t,s,q){var r=b[t];if(typeof r!="undefined"){if(typeof m[t]=="undefined"){strobeMediaPlayback=document.getElementById(t);m[t]=strobeMediaPlayback;r.strobeMediaPlayback=strobeMediaPlayback;r.videoElement.play=jQuery.proxy(strobeMediaPlayback.play2,r.strobeMediaPlayback);r.videoElement.pause=jQuery.proxy(strobeMediaPlayback.pause,r.strobeMediaPlayback);r.videoElement.load=jQuery.proxy(r.load,r);r.videoElement.strobeMediaPlayback=strobeMediaPlayback;i(r)}r.update(q,[s],r)}};var c="src preload currentTime defaultPlaybackRate playbackRate autoplay loop controls volume muted".split(" ");var e="played seekable buffered".split(" ");var d={start:function(q){return this._start[q]},end:function(q){return this._end[q]}};var i=function(q){var r=c.length;while(r--){var s=c[r];if(q.cc.hasOwnProperty(s)&&q.videoElement.hasOwnProperty(s)&&q.cc[s]!=q.videoElement[s]){var t="set"+s.charAt(0).toUpperCase()+s.substring(1);q.strobeMediaPlayback[t](q.videoElement[s]);q.cc[s]=q.videoElement[s]}}setTimeout(function(){i(q)},500)};var a=function(q){this.videoElement={duration:0,currentTime:0,paused:true,muted:false};this.cc={duration:0,currentTime:0,paused:true,muted:false};this.$videoElement=f(this.videoElement)};var h=function(q,s,r){return !q.hasOwnProperty(r)&&q[r]!=s[r]};var j={load:function(){this.strobeMediaPlayback.setSrc(this.videoElement.src);this.strobeMediaPlayback.load()},update:function(s,r,q){var u;for(u in s){if(jQuery.inArray("emptied",r)<0&&q.cc.hasOwnProperty(u)&&q.videoElement.hasOwnProperty(u)&&(q.cc[u]!=q.videoElement[u]&&!isNaN(q.cc[u])&&!isNaN(q.videoElement[u]))){continue}q.cc[u]=s[u];q.videoElement[u]=s[u];if(jQuery.inArray(u,e)>=0){q.videoElement[u].start=d.start;q.videoElement[u].end=d.end}}if(r){var t=r.length;while(t--){q.$videoElement.triggerHandler(r[t])}}}};a.prototype=j})(jQuery);if(typeof org=="undefined"){var org={}}if(typeof org.strobemediaplayback=="undefined"){org.strobemediaplayback={}}if(typeof org.strobemediaplayback.proxied=="undefined"){org.strobemediaplayback.proxied={}}org.strobemediaplayback.triggerHandler=function(c,b,a){if(b=="onJavaScriptBridgeCreated"){if(typeof onJavaScriptBridgeCreated=="function"){onJavaScriptBridgeCreated(c)}}else{if(typeof org.strobemediaplayback.proxied[c]!="undefined"){org.strobemediaplayback.proxied[c].update(a,[b],org.strobemediaplayback.proxied[c])}}};
