The Apple Http Live Streaming features come from http://code.google.com/p/apple-http-osmf/ with some refactored modifications for multi bitrate support available in the swc library for now.
1) Checkout OSMF 2.0 Source http://www.osmf.org/source.html or download here http://sourceforge.net/projects/osmf.adobe/files/OSMF%202.0%20Release%20%28final%20source%2C%20ASDocs%2C%20pdf%20guides%20and%20release%20notes%29/
2) Change the location of the build property osmf-dir to the location of the osmf 2.0 checkout or download.
3) Run ant example
4) Load example in build/example/index.html
Examples available at http://flowplayer.electroteque.org/httpstreaminghls
* Flowplayer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Flowplayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Flowplayer. If not, see <http://www.gnu.org/licenses/>.
*
* Date: 2012-06-16 10:34:45 -0400 (Sat, 16 Jun 2012)
* Revision: 808
*/
(function(){functiong(o){console.log("$f.fireEvent",[].slice.call(o))}functionk(q){if(!q||typeofq!="object"){returnq}varo=newq.constructor();for(varpinq){if(q.hasOwnProperty(p)){o[p]=k(q[p])}}returno}functionm(t,q){if(!t){return}varo,p=0,r=t.length;if(r===undefined){for(oint){if(q.call(t[o],o,t[o])===false){break}}}else{for(vars=t[0];p<r&&q.call(s,p,s)!==false;s=t[++p]){}}returnt}functionc(o){returndocument.getElementById(o)}functioni(q,p,o){if(typeofp!="object"){returnq}if(q&&p){m(p,function(r,s){if(!o||typeofs!="function"){q[r]=s}})}returnq}functionn(s){varq=s.indexOf(".");if(q!=-1){varp=s.slice(0,q)||"*";varo=s.slice(q+1,s.length);varr=[];m(document.getElementsByTagName(p),function(){if(this.className&&this.className.indexOf(o)!=-1){r.push(this)}});returnr}}functionf(o){o=o||window.event;if(o.preventDefault){o.stopPropagation();o.preventDefault()}else{o.returnValue=false;o.cancelBubble=true}returnfalse}functionj(q,o,p){q[o]=q[o]||[];q[o].push(p)}functione(){return"_"+(""+Math.random()).slice(2,10)}varh=function(t,r,s){varq=this,p={},u={};q.index=r;if(typeoft=="string"){t={url:t}}i(this,t,true);m(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){varv="on"+this;if(v.indexOf("*")!=-1){v=v.slice(0,v.length-1);varw="onBefore"+v.slice(2);q[w]=function(x){j(u,w,x);returnq}}q[v]=function(x){j(u,v,x);returnq};if(r==-1){if(q[w]){s[w]=q[w]}if(q[v]){s[v]=q[v]}}});i(this,{onCuepoint:function(x,w){if(arguments.length==1){p.embedded=[null,x];returnq}if(typeofx=="number"){x=[x]}varv=e();p[v]=[x,w];if(s.isLoaded()){s._api().fp_addCuepoints(x,r,v)}returnq},update:function(w){i(q,w);if(s.isLoaded()){s._api().fp_updateClip(w,r)}varv=s.getConfig();varx=(r==-1)?v.clip:v.playlist[r];i(x,w,true)},_fireEvent:function(v,y,w,A){if(v=="onLoad"){m(p,function(B,C){if(C[0]){s._api().fp_addCuepoints(C[0],r,B)}});returnfalse}A=A||q;if(v=="onCuepoint"){varz=p[y];if(z){returnz[1].call(s,A,w)}}if(y&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(v)!=-1){i(A,y);if(y.metaData){if(!A.duration){A.duration=y.metaData.duration}else{A.fullDuration=y.metaData.duration}}}varx=true;m(u[v],function(){x=this.call(s,A,y,w)});returnx}});if(t.onCuepoint){varo=t.onCuepoint;q.onCuepoint.apply(q,typeofo=="function"?[o]:o);deletet.onCuepoint}m(t,function(v,w){if(typeofw=="function"){j(u,v,w);deletet[v]}});if(r==-1){s.onCuepoint=this.onCuepoint}};varl=function(p,r,q,t){varo=this,s={},u=false;if(t){i(s,t)}m(r,function(v,w){if(typeofw=="function"){s[v]=w;deleter[v]}});i(this,{animate:function(y,z,x){if(!y){returno}if(typeofz=="function"){x=z;z=500}if(typeofy=="string"){varw=y;y={};y[w]=z;z=500}if(x){varv=e();s[v]=x}if(z===undefined){z=500}r=q._api().fp_animate(p,y,z,v);returno},css:function(w,x){if(x!==undefined){varv={};v[w]=x;w=v}r=q._api().fp_css(p,w);i(o,r);returno},show:function(){this.display="block";q._api().fp_showPlugin(p);returno},hide:function(){this.display="none";q._api().fp_hidePlugin(p);returno},toggle:function(){this.display=q._api().fp_togglePlugin(p);returno},fadeTo:function(y,x,w){if(typeofx=="function"){w=x;x=500}if(w){varv=e();s[v]=w}this.display=q._api().fp_fadeTo(p,y,x,v);this.opacity=y;returno},fadeIn:function(w,v){returno.fadeTo(1,w,v)},fadeOut:function(w,v){returno.fadeTo(0,w,v)},getName:function(){returnp},getPlayer:function(){returnq},_fireEvent:function(w,v,x){if(w=="onUpdate"){varz=q._api().fp_getPlugin(p);if(!z){return}i(o,z);deleteo.methods;if(!u){m(z.methods,function(){varB=""+this;o[B]=function(){varC=[].slice.call(arguments);varD=q._api().fp_invoke(p,B,C);returnD==="undefined"||D===undefined?o:D}});u=true}}varA=s[w];if(A){vary=A.apply(o,v);if(w.slice(0,1)=="_"){deletes[w]}returny}returno}})};functionb(q,G,t){varw=this,v=null,D=false,u,s,F=[],y={},x={},E,r,p,C,o,A;i(w,{id:function(){returnE},isLoaded:function(){return(v!==null&&v.fp_play!==undefined&&!D)},getParent:function(){returnq},hide:function(H){if(H){q.style.height="0px"}if(w.isLoaded()){v.style.height="0px"}returnw},show:function(){q.style.height=A+"px";if(w.isLoaded()){v.style.height=o+"px"}returnw},isHidden:function(){returnw.isLoaded()&&parseInt(v.style.height,10)===0},load:function(J){if(!w.isLoaded()&&w._fireEvent("onBeforeLoad")!==false){varH=function(){if(u&&!flashembed.isSupported(G.version)){q.innerHTML=""}if(J){J.cached=true;j(x,"onLoad",J)}flashembed(q,G,{config:t})};varI=0;m(a,function(){this.unload(function(K){if(++I==a.length){H()}})})}returnw},unload:function(J){if(u.replace(/\s/g,"")!==""){if(w._fireEvent("onBeforeUnload")===false){if(J){J(false)}returnw}D=true;try{if(v){if(v.fp_isFullscreen()){v.fp_toggleFullscreen()}v.fp_close();w._fireEvent("onUnload")}}catch(H){}varI=function(){v=null;q.innerHTML=u;D=false;if(J){J(true)}};if(/WebKit/i.test(navigator.userAgent)&&!/Chrome/i.test(navigator.userAgent)){setTimeout(I,0)}else{I()}}else{if(J){J(false)}}returnw},getClip:function(H){if(H===undefined){H=C}returnF[H]},getCommonClip:function(){returns},getPlaylist:function(){returnF},getPlugin:function(H){varJ=y[H];if(!J&&w.isLoaded()){varI=w._api().fp_getPlugin(H);if(I){J=newl(H,I,w);y[H]=J}}returnJ},getScreen:function(){returnw.getPlugin("screen")},getControls:function(){returnw.getPlugin("controls")._fireEvent("onUpdate")},getLogo:function(){try{returnw.getPlugin("logo")._fireEvent("onUpdate")}catch(H){}},getPlay:function(){returnw.getPlugin("play")._fireEvent("onUpdate")},getConfig:function(H){returnH?k(t):t},getFlashParams:function(){returnG},loadPlugin:function(K,J,M,L){if(typeofM=="function"){L=M;M={}}varI=L?e():"_";w._api().fp_loadPlugin(K,J,M,I);varH={};H[I]=L;varN=newl(K,null,w,H);y[K]=N;returnN},getState:function(){returnw.isLoaded()?v.fp_getState():-1},play:function(I,H){varJ=function(){if(I!==undefined){w._api().fp_play(I,H)}else{w._api().fp_play()}};if(w.isLoaded()){J()}else{if(D){setTimeout(function(){w.play(I,H)},50)}else{w.load(function(){J()})}}returnw},getVersion:function(){varI="flowplayer.js 3.2.11";if(w.isLoaded()){varH=v.fp_getVersion();H.push(I);returnH}returnI},_api:function(){if(!w.isLoaded()){throw"Flowplayer "+w.id()+" not loaded when calling an API method"}returnv},setClip:function(H){m(H,function(I,J){if(typeofJ=="function"){j(x,I,J);deleteH[I]}else{if(I=="onCuepoint"){$f(q).getCommonClip().onCuepoint(H[I][0],H[I][1])}}});w.setPlaylist([H]);returnw},getIndex:function(){returnp},bufferAnimate:function(H){v.fp_bufferAnimate(H===undefined||H);returnw},_swfHeight:function(){returnv.clientHeight}});m(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){varH="on"+this;if(H.indexOf("*")!=-1){H=H.slice(0,H.length-1);varI="onBefore"+H.slice(2);w[I]=function(J){j(x,I,J);returnw}}w[H]=function(J){j(x,H,J);returnw}});m(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed,setKeyboardShortcutsEnabled,isKeyboardShortcutsEnabled").split(","),function(){varH=this;w[H]=function(J,I){if(!w.isLoaded()){returnw}varK=null;if(J!==undefined&&I!==undefined){K=v["fp_"+H](J,I)}else{K=(J===undefined)?v["fp_"+H]():v["fp_"+H](J)}returnK==="undefined"||K===undefined?w:K}});w._fireEvent=function(Q){if(typeofQ=="string"){Q=[Q]}varR=Q[0],O=Q[1],M=Q[2],L=Q[3],K=0;if(t.debug){g(Q)}if(!w.isLoaded()&&R=="onLoad"&&O=="player"){v=v||c(r);o=w._swfHeight();m(F,function(){this._fireEvent("onLoad")});m(y,function(S,T){T._fireEvent("onUpdate")});s._fireEvent("onLoad")}if(R=="onLoad"&&O!="player"){return}if(R=="onError"){if(typeofO=="string"||(typeofO=="number"&&typeofM=="number")){O=M;M=L}}if(R=="onContextMenu"){m(t.contextMenu[O],function(S,T){T.call(w)});return}if(R=="onPluginEvent"||R=="onBeforePluginEvent"){varH=O.name||O;varI=y[H];if(I){I._fireEvent("onUpdate",O);returnI._fireEvent(M,Q.slice(3))}return}if(R=="onPlaylistReplace"){F=[];varN=0;m(O,function(){F.push(newh(this,N++,w))})}if(R=="onClipAdd"){if(O.isInStream){return}O=newh(O,M,w);F.splice(M,0,O);for(K=M+1;K<F.length;K++){F[K].index++}}varP=true;if(typeofO=="number"&&O<F.length){C=O;varJ=F[O];if(J){P=J._fireEvent(R,M,L)}if(!J||P!==false){P=s._fireEvent(R,M,L,J)}}m(x[R],function(){P=this.call(w,O,M);if(this.cached){x[R].splice(K,1)}if(P===false){returnfalse}K++});returnP};functionB(){if($f(q)){$f(q).getParent().innerHTML="";p=$f(q).getIndex();a[p]=w}else{a.push(w);p=a.length-1}A=parseInt(q.style.height,10)||q.clientHeight;E=q.id||"fp"+e();r=G.id||E+"_api";G.id=r;u=q.innerHTML;if(typeoft=="string"){t={clip:{url:t}}}t.playerId=E;t.clip=t.clip||{};if(q.getAttribute("href",2)&&!t.clip.url){t.clip.url=q.getAttribute("href",2)}s=newh(t.clip,-1,w);t.playlist=t.playlist||[t.clip];varI=0;m(t.playlist,function(){varL=this;if(typeofL=="object"&&L.length){L={url:""+L}}m(t.clip,function(M,N){if(N!==undefined&&L[M]===undefined&&typeofN!="function"){L[M]=N}});t.playlist[I]=L;L=newh(L,I,w);F.push(L);I++});m(t,function(L,M){if(typeofM=="function"){if(s[L]){s[L](M)}else{j(x,L,M)}deletet[L]}});m(t.plugins,function(L,M){if(M){y[L]=newl(L,M,w)}});if(!t.plugins||t.plugins.controls===undefined){y.controls=newl("controls",null,w)}y.canvas=newl("canvas",null,w);u=q.innerHTML;functionK(L){if(/iPad|iPhone|iPod/i.test(navigator.userAgent)&&!/.flv$/i.test(F[0].url)&&!J()){returntrue}if(!w.isLoaded()&&w._fireEvent("onBeforeClick")!==false){w.load()}returnf(L)}functionJ(){returnw.hasiPadSupport&&w.hasiPadSupport()}functionH(){if(u.replace(/\s/g,"")!==""){if(q.addEventListener){q.addEventListener("click",K,false)}else{if(q.attachEvent){q.attachEvent("onclick",K)}}}else{if(q.addEventListener&&!J()){q.addEventListener("click",f,false)}w.load()}}setTimeout(H,0)}if(typeofq=="string"){varz=c(q);if(!z){throw"Flowplayer cannot access element: "+q}q=z;B()}else{B()}}vara=[];functiond(o){this.length=o.length;this.each=function(q){m(o,q)};this.size=function(){returno.length};varp=this;for(nameinb.prototype){p[name]=function(){varq=arguments;p.each(function(){this[name].apply(this,q)})}}}window.flowplayer=window.$f=function(){varp=null;varo=arguments[0];if(!arguments.length){m(a,function(){if(this.isLoaded()){p=this;returnfalse}});returnp||a[0]}if(arguments.length==1){if(typeofo=="number"){returna[o]}else{if(o=="*"){returnnewd(a)}m(a,function(){if(this.id()==o.id||this.id()==o||this.getParent()==o){p=this;returnfalse}});returnp}}if(arguments.length>1){vart=arguments[1],q=(arguments.length==3)?arguments[2]:{};if(typeoft=="string"){t={src:t}}t=i({bgcolor:"#000000",version:[10,1],expressInstall:"http://releases.flowplayer.org/swf/expressinstall.swf",cachebusting:false},t);if(typeofo=="string"){if(o.indexOf(".")!=-1){vars=[];m(n(o),function(){s.push(newb(this,k(t),k(q)))});returnnewd(s)}else{varr=c(o);returnnewb(r!==null?r:k(o),k(t),k(q))}}else{if(o){returnnewb(o,k(t),k(q))}}}returnnull};i(window.$f,{fireEvent:function(){varo=[].slice.call(arguments);varq=$f(o[0]);returnq?q._fireEvent(o.slice(1)):null},addPlugin:function(o,p){b.prototype[o]=p;return$f},each:m,extend:i});if(typeofjQuery=="function"){jQuery.fn.flowplayer=function(q,p){if(!arguments.length||typeofarguments[0]=="number"){varo=[];this.each(function(){varr=$f(this);if(r){o.push(r)}});returnarguments.length?o[arguments[0]]:newd(o)}returnthis.each(function(){$f(this,k(q),p?k(p):{})})}}})();(function(){varh=document.all,j="http://get.adobe.com/flashplayer",c=typeofjQuery=="function",e=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,b={width:"100%",height:"100%",id:"_"+(""+Math.random()).slice(9),allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:[3,0],onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}functioni(m,l){if(l){for(varfinl){if(l.hasOwnProperty(f)){m[f]=l[f]}}}returnm}functiona(f,n){varm=[];for(varlinf){if(f.hasOwnProperty(l)){m[l]=n(f[l])}}returnm}window.flashembed=function(f,m,l){if(typeoff=="string"){f=document.getElementById(f.replace("#",""))}if(!f){return}if(typeofm=="string"){m={src:m}}returnnewd(f,i(i({},b),m),l)};varg=i(window.flashembed,{conf:b,getVersion:function(){varm,f;try{f=navigator.plugins["Shockwave Flash"].description.slice(16)}catch(o){try{m=newActiveXObject("ShockwaveFlash.ShockwaveFlash.7");f=m&&m.GetVariable("$version")}catch(n){try{m=newActiveXObject("ShockwaveFlash.ShockwaveFlash.6");f=m&&m.GetVariable("$version")}catch(l){}}}f=e.exec(f);returnf?[1*f[1],1*f[(f[1]*1>9?2:3)]*1]:[0,0]},asString:function(l){if(l===null||l===undefined){returnnull}varf=typeofl;if(f=="object"&&l.push){f="array"}switch(f){case"string":l=l.replace(newRegExp('(["\\\\])',"g"),"\\$1");l=l.replace(/^\s?(\d+\.?\d*)%/,"$1pct");return'"'+l+'"';case"array":return"["+a(l,function(o){returng.asString(o)}).join(",")+"]";case"function":return'"function()"';case"object":varm=[];for(varninl){if(l.hasOwnProperty(n)){m.push('"'+n+'":'+g.asString(l[n]))}}return"{"+m.join(",")+"}"}returnString(l).replace(/\s/g,"").replace(/\'/g,'"')},getHTML:function(o,l){o=i({},o);varn='<object width="'+o.width+'" height="'+o.height+'" id="'+o.id+'" name="'+o.id+'"';if(o.cachebusting){o.src+=((o.src.indexOf("?")!=-1?"&":"?")+Math.random())}if(o.w3c||!h){n+=' data="'+o.src+'" type="application/x-shockwave-flash"'}else{n+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}n+=">";if(o.w3c||h){n+='<param name="movie" value="'+o.src+'" />'}o.width=o.height=o.id=o.w3c=o.src=null;o.onFail=o.version=o.expressInstall=null;for(varmino){if(o[m]){n+='<param name="'+m+'" value="'+o[m]+'" />'}}varp="";if(l){for(varfinl){if(l[f]){varq=l[f];p+=f+"="+(/function|object/.test(typeofq)?g.asString(q):q)+"&"}}p=p.slice(0,-1);n+='<param name="flashvars" value=\''+p+"' />"}n+="</object>";returnn},isSupported:function(f){returnk[0]>f[0]||k[0]==f[0]&&k[1]>=f[1]}});vark=g.getVersion();functiond(f,n,m){if(g.isSupported(n.version)){f.innerHTML=g.getHTML(n,m)}else{if(n.expressInstall&&g.isSupported([6,65])){f.innerHTML=g.getHTML(i(n,{src:n.expressInstall}),{MMredirectURL:encodeURIComponent(location.href),MMplayerType:"PlugIn",MMdoctitle:document.title})}else{if(!f.innerHTML.replace(/\s/g,"")){f.innerHTML="<h2>Flash version "+n.version+" or greater is required</h2><h3>"+(k[0]>0?"Your version is "+k:"You have no flash plugin installed")+"</h3>"+(f.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='"+j+"'>here</a></p>");if(f.tagName=="A"||f.tagName=="DIV"){f.onclick=function(){location.href=j}}}if(n.onFail){varl=n.onFail.call(this);if(typeofl=="string"){f.innerHTML=l}}}}if(h){window[n.id]=document.getElementById(n.id)}i(this,{getRoot:function(){returnf},getOptions:function(){returnn},getConf:function(){returnm},getApi:function(){returnf.firstChild}})}if(c){jQuery.tools=jQuery.tools||{version:"3.2.11"};jQuery.tools.flashembed={conf:b};jQuery.fn.flashembed=function(l,f){returnthis.each(function(){$(this).data("flashembed",flashembed(this,l,f))})}}})();
$f.addPlugin("ipad",function(y){varS=-1;varz=0;varA=1;varP=2;varE=3;varL=4;varj=5;vari=this;varU=1;varT=false;varI=false;varv=false;vars=0;varR=[];varl;vart=null;vard=0;varf={accelerated:false,autoBuffering:false,autoPlay:true,baseUrl:null,bufferLength:3,connectionProvider:null,cuepointMultiplier:1000,cuepoints:[],controls:{},duration:0,extension:"",fadeInSpeed:1000,fadeOutSpeed:1000,image:false,linkUrl:null,linkWindow:"_self",live:false,metaData:{},originalUrl:null,position:0,playlist:[],provider:"http",scaling:"scale",seekableOnBegin:false,start:0,url:null,urlResolvers:[]};varx=S;varr=S;varu=/iPad|iPhone|iPod/i.test(navigator.userAgent);varc=null;functionn(Y,X,V){if(X){for(keyinX){if(key){if(X[key]&&typeofX[key]=="function"&&!V){continue}if(X[key]&&typeofX[key]=="object"&&X[key].length===undefined){varW={};n(W,X[key]);Y[key]=W}else{Y[key]=X[key]}}}}returnY}varB={simulateiDevice:false,controlsSizeRatio:1.5,controls:true,debug:false,validExtensions:"mov|m4v|mp4|avi|mp3|m4a|aac|m3u8|m3u|pls",posterExtensions:"png|jpg"};n(B,y);varb=B.validExtensions?newRegExp("^.("+B.validExtensions+")$","i"):null;vare=newRegExp("^.("+B.posterExtensions+")$","i");functionh(){if(B.debug){if(u){varV=[].splice.call(arguments,0).join(", ");console.log.apply(console,[V])}else{console.log.apply(console,arguments)}}}functionm(V){switch(V){case-1:return"UNLOADED";case0:return"LOADED";case1:return"UNSTARTED";case2:return"BUFFERING";case3:return"PLAYING";case4:return"PAUSED";case5:return"ENDED"}return"UNKOWN"}functionJ(V){varW=$f.fireEvent(i.id(),"onBefore"+V,s);returnW!==false}functionO(V){V.stopPropagation();V.preventDefault();returnfalse}functionM(W,V){if(x==S&&!V){return}r=x;x=W;D();if(W==E){p()}h(m(W))}functionC(){c.fp_stop();T=false;I=false;v=false;M(A);M(A)}varg=null;functionp(){if(g){return}console.log("starting tracker");g=setInterval(G,100);G()}functionD(){clearInterval(g);g=null}functionG(){varW=Math.floor(c.fp_getTime()*10)*100;varX=Math.floor(c.duration*10)*100;varY=(newDate()).time;functionV(ab,Z){ab=ab>=0?ab:X-Math.abs(ab);for(varaa=0;aa<Z.length;aa++){if(Z[aa].lastTimeFired>Y){Z[aa].lastTimeFired=-1}else{if(Z[aa].lastTimeFired+500>Y){continue}else{if(ab==W||(W-500<ab&&W>ab)){Z[aa].lastTimeFired=Y;$f.fireEvent(i.id(),"onCuepoint",s,Z[aa].fnId,Z[aa].parameters)}}}}}$f.each(i.getCommonClip().cuepoints,V);$f.each(R[s].cuepoints,V)}functionH(){C();v=true;c.fp_seek(0)}functionN(V){}functionq(){console.log(c);functionV(X){varW={};n(W,f);n(W,i.getCommonClip());n(W,X);if(W.ipadUrl){url=decodeURIComponent(W.ipadUrl)}else{if(W.url){url=W.url}}if(url&&url.indexOf("://")==-1&&W.ipadBaseUrl){url=W.ipadBaseUrl+"/"+url}else{if(url&&url.indexOf("://")==-1&&W.baseUrl){url=W.baseUrl+"/"+url}}W.originalUrl=W.url;W.completeUrl=url;W.extension=W.completeUrl.substr(W.completeUrl.lastIndexOf("."));varY=W.extension.indexOf("?");if(Y>-1){W.extension=W.extension.substr(0,Y)}W.type="video";deleteW.index;h("fixed clip",W);returnW}c.fp_play=function(Z,X,ab,ac){varW=null;varaa=true;varY=true;h("Calling play() "+Z,Z);if(X){h("ERROR: inStream clips not yet supported");return}if(Z!==undefined){if(typeofZ=="number"){if(s>=R.length){return}s=Z;Z=R[s]}else{if(typeofZ=="string"){Z={url:Z}}c.fp_setPlaylist(Z.length!==undefined?Z:[Z])}if(s==0&&R.length>1&&e.test(R[s].extension)){varac=R[s].url;console.log("Poster image available with url "+ac);++s;console.log("Not last clip in the playlist, moving to next one");c.fp_play(s,false,true,ac);return}if(b&&!b.test(R[s].extension)){return}Z=R[s];W=Z.completeUrl;if(Z.autoBuffering!==undefined&&Z.autoBuffering===false){aa=false}if(Z.autoPlay===undefined||Z.autoPlay===true||ab===true){aa=true;Y=true}else{Y=false}}else{h("clip was not given, simply calling video.play, if not already buffering");if(x!=P){c.play()}return}h("about to play "+W,aa,Y);C();if(W){h("Changing SRC attribute"+W);c.setAttribute("src",W)}if(aa){if(!J("Begin")){returnfalse}if(ac){Y=Z.autoPlay;c.setAttribute("poster",ac);c.setAttribute("preload","none")}$f.fireEvent(i.id(),"onBegin",s);h("calling video.load()");c.load()}if(Y){h("calling video.play()");c.play()}};c.fp_pause=function(){h("pause called");if(!J("Pause")){returnfalse}c.pause()};c.fp_resume=function(){h("resume called");if(!J("Resume")){returnfalse}c.play()};c.fp_stop=function(){h("stop called");if(!J("Stop")){returnfalse}I=true;c.pause();try{c.currentTime=0}catch(W){}};c.fp_seek=function(W){h("seek called "+W);if(!J("Seek")){returnfalse}varaa=0;varW=W+"";if(W.charAt(W.length-1)=="%"){varX=parseInt(W.substr(0,W.length-1))/100;varZ=c.duration;aa=Z*X}else{aa=W}try{c.currentTime=aa}catch(Y){h("Wrong seek time")}};c.fp_getTime=function(){returnc.currentTime};c.fp_mute=function(){h("mute called");if(!J("Mute")){returnfalse}U=c.volume;c.volume=0};c.fp_unmute=function(){if(!J("Unmute")){returnfalse}c.volume=U};c.fp_getVolume=function(){returnc.volume*100};c.fp_setVolume=function(W){if(!J("Volume")){returnfalse}c.volume=W/100};c.fp_toggle=function(){h("toggle called");if(i.getState()==j){H();return}if(c.paused){c.fp_play()}else{c.fp_pause()}};c.fp_isPaused=function(){returnc.paused};c.fp_isPlaying=function(){return!c.paused};c.fp_getPlugin=function(X){if(X=="canvas"||X=="controls"){varW=i.getConfig();returnW.plugins&&W.plugins[X]?W.plugins[X]:null}h("ERROR: no support for "+X+" plugin on iDevices");returnnull};c.fp_close=function(){M(S);c.parentNode.removeChild(c);c=null};c.fp_getStatus=function(){varX=0;varY=0;try{X=c.buffered.start();Y=c.buffered.end()}catch(W){}return{bufferStart:X,bufferEnd:Y,state:x,time:c.fp_getTime(),muted:c.muted,volume:c.fp_getVolume()}};c.fp_getState=function(){returnx};c.fp_startBuffering=function(){if(x==A){c.load()}};c.fp_setPlaylist=function(X){h("Setting playlist");s=0;for(varW=0;W<X.length;W++){X[W]=V(X[W])}R=X;$f.fireEvent(i.id(),"onPlaylistReplace",X)};c.fp_addClip=function(X,W){X=V(X);R.splice(W,0,X);$f.fireEvent(i.id(),"onClipAdd",X,W)};c.fp_updateClip=function(X,W){n(R[W],X);returnR[W]};c.fp_getVersion=function(){return"3.2.3"};c.fp_isFullscreen=function(){varW=c.webkitDisplayingFullscreen;if(W!==undefined){returnW}returnfalse};c.fp_toggleFullscreen=function(){if(c.fp_isFullscreen()){c.webkitExitFullscreen()}else{c.webkitEnterFullscreen()}};c.fp_addCuepoints=function(Z,X,W){varab=X==-1?i.getCommonClip():R[X];ab.cuepoints=ab.cuepoints||{};Z=ZinstanceofArray?Z:[Z];for(varY=0;Y<Z.length;Y++){varac=typeofZ[Y]=="object"?(Z[Y]["time"]||null):Z[Y];if(ac==null){continue}ac=Math.floor(ac/100)*100;varaa=ac;if(typeofZ[Y]=="object"){aa=n({},Z[Y],false);if(aa.time===undefined){deleteaa.time}if(aa.parameters!==undefined){n(aa,aa.parameters,false);deleteaa.parameters}}ab.cuepoints[ac]=ab.cuepoints[ac]||[];ab.cuepoints[ac].push({fnId:W,lastTimeFired:-1,parameters:aa})}};$f.each(("toggleFullscreen,stopBuffering,reset,playFeed,setKeyboardShortcutsEnabled,isKeyboardShortcutsEnabled,css,animate,showPlugin,hidePlugin,togglePlugin,fadeTo,invoke,loadPlugin").split(","),function(){varW=this;c["fp_"+W]=function(){h("ERROR: unsupported API on iDevices "+W);returnfalse}})}functionK(){varai=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","volumechange","waiting"];varaa=function(ak){h("Got event "+ak.type,ak)};for(varac=0;ac<ai.length;ac++){c.addEventListener(ai[ac],aa,false)}varX=function(ak){h("got onBufferEmpty event "+ak.type);M(P);$f.fireEvent(i.id(),"onBufferEmpty",s)};c.addEventListener("emptied",X,false);c.addEventListener("waiting",X,false);varZ=function(ak){if(r==A||r==P){}else{h("Restoring old state "+m(r));M(r)}$f.fireEvent(i.id(),"onBufferFull",s)};c.addEventListener("canplay",Z,false);c.addEventListener("canplaythrough",Z,false);varY=function(al){varak;d=R[s].start;if(R[s].duration>0){ak=R[s].duration;t=ak+d}else{ak=c.duration;t=null}c.fp_updateClip({duration:ak,metaData:{duration:c.duration}},s);R[s].duration=c.duration;R[s].metaData={duration:c.duration};$f.fireEvent(i.id(),"onMetaData",s,R[s])};c.addEventListener("loadedmetadata",Y,false);c.addEventListener("durationchange",Y,false);varW=function(ak){if(t&&c.currentTime>t){c.fp_seek(d);C();returnO(ak)}};c.addEventListener("timeupdate",W,false);varah=function(ak){if(x==L){if(!J("Resume")){h("Resume disallowed, pausing");c.fp_pause();returnO(ak)}$f.fireEvent(i.id(),"onResume",s)}M(E);if(!T){T=true;$f.fireEvent(i.id(),"onStart",s)}};c.addEventListener("playing",ah,false);varV=function(ak){F()};c.addEventListener("play",V,false);varae=function(ak){if(!J("Finish")){if(R.length==1){h("Active playlist only has one clip, onBeforeFinish returned false. Replaying");H()}else{if(s!=(R.length-1)){h("Not the last clip in the playlist, but onBeforeFinish returned false. Returning to the beginning of current clip");c.fp_seek(0)}else{h("Last clip in playlist, but onBeforeFinish returned false, start again from the beginning");c.fp_play(0)}}returnO(ak)}M(j);$f.fireEvent(i.id(),"onFinish",s);if(R.length>1&&s<(R.length-1)){h("Not last clip in the playlist, moving to next one");c.fp_play(++s,false,true)}};c.addEventListener("ended",ae,false);varad=function(ak){M(z,true);$f.fireEvent(i.id(),"onError",s,201);if(B.onFail&&B.onFailinstanceofFunction){B.onFail.apply(i,[])}};c.addEventListener("error",ad,false);varag=function(ak){h("got pause event from player"+i.id());if(I){return}if(x==P&&r==A){h("forcing play");setTimeout(function(){c.play()},0);return}if(!J("Pause")){c.fp_resume();returnO(ak)}Q();M(L);$f.fireEvent(i.id(),"onPause",s)};c.addEventListener("pause",ag,false);varaj=function(ak){$f.fireEvent(i.id(),"onBeforeSeek",s)};c.addEventListener("seeking",aj,false);varab=function(ak){if(I){I=false;$f.fireEvent(i.id(),"onStop",s)}else{$f.fireEvent(i.id(),"onSeek",s)}h("seek done, currentState",m(x));if(v){v=false;c.fp_play()}else{if(x!=E){c.fp_pause()}}};c.addEventListener("seeked",ab,false);varaf=function(ak){$f.fireEvent(i.id(),"onVolume",c.fp_getVolume())};c.addEventListener("volumechange",af,false)}functionF(){l=setInterval(function(){if(c.fp_getTime()>=c.duration-1){$f.fireEvent(i.id(),"onLastSecond",s);Q()}},100)}functionQ(){clearInterval(l)}functiono(){c.fp_play(0)}functionw(){}if(u||B.simulateiDevice){if(!window.flashembed.__replaced){vark=window.flashembed;window.flashembed=function(X,ac,Y){if(typeofX=="string"){X=document.getElementById(X.replace("#",""))}if(!X){return}varab=window.getComputedStyle(X,null);varaa=parseInt(ab.width);varV=parseInt(ab.height);while(X.firstChild){X.removeChild(X.firstChild)}varW=document.createElement("div");varZ=document.createElement("video");W.appendChild(Z);X.appendChild(W);W.style.height=V+"px";W.style.width=aa+"px";W.style.display="block";W.style.position="relative";W.style.background="-webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.7)))";W.style.cursor="default";W.style.webkitUserDrag="none";Z.style.height="100%";Z.style.width="100%";Z.style.display="block";Z.id=ac.id;Z.name=ac.id;Z.style.cursor="pointer";Z.style.webkitUserDrag="none";Z.type="video/mp4";Z.playerConfig=Y.config;$f.fireEvent(Y.config.playerId,"onLoad","player")};flashembed.getVersion=k.getVersion;flashembed.asString=k.asString;flashembed.isSupported=function(){returntrue};flashembed.__replaced=true}vara=i._fireEvent;i._fireEvent=function(V){if(V[0]=="onLoad"&&V[1]=="player"){c=i.getParent().querySelector("video");if(B.controls){c.controls="controls"}q();K();M(z,true);c.fp_setPlaylist(c.playerConfig.playlist);o();a.apply(i,[V])}varW=x!=S;if(x==S&&typeofV=="string"){W=true}if(W){returna.apply(i,[V])}};i._swfHeight=function(){returnparseInt(c.style.height)};i.hasiPadSupport=function(){returntrue}}returni});