From 384bc7afc86be706bf61def09afc8306cdad2443 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Sat, 2 Mar 2013 23:56:13 +0100 Subject: #2033 - Add Flowplayer 5 to play HTML5 videos. - add Flowplayer 5 to lib/flowplayer-html5 - move existing Flash Flowplayer to lib/flowplayer-flash - update page.html.php and movieplayer.html.php --HG-- rename : lib/flowplayer.controls.swf => lib/flowplayer-flash/flowplayer.controls.swf rename : lib/flowplayer.js => lib/flowplayer-flash/flowplayer.js rename : lib/flowplayer.pseudostreaming-byterange.swf => lib/flowplayer-flash/flowplayer.pseudostreaming-byterange.swf rename : lib/flowplayer.pseudostreaming.swf => lib/flowplayer-flash/flowplayer.pseudostreaming.swf rename : lib/flowplayer.swf => lib/flowplayer-flash/flowplayer.swf --- lib/flowplayer-flash/flowplayer.controls.swf | Bin 0 -> 38359 bytes lib/flowplayer-flash/flowplayer.js | 228 ++++++++++ .../flowplayer.pseudostreaming-byterange.swf | Bin 0 -> 171030 bytes .../flowplayer.pseudostreaming.swf | Bin 0 -> 4847 bytes lib/flowplayer-flash/flowplayer.swf | Bin 0 -> 126911 bytes lib/flowplayer-html5/flowplayer.js | 5 + lib/flowplayer-html5/flowplayer.swf | Bin 0 -> 3998 bytes lib/flowplayer-html5/skin/all-skins.css | 475 +++++++++++++++++++++ lib/flowplayer-html5/skin/functional.css | 158 +++++++ lib/flowplayer-html5/skin/img/black.png | Bin 0 -> 751 bytes lib/flowplayer-html5/skin/img/black@x2.png | Bin 0 -> 1229 bytes lib/flowplayer-html5/skin/img/play_black.png | Bin 0 -> 786 bytes lib/flowplayer-html5/skin/img/play_black@x2.png | Bin 0 -> 1581 bytes lib/flowplayer-html5/skin/img/play_white.png | Bin 0 -> 786 bytes lib/flowplayer-html5/skin/img/play_white@x2.png | Bin 0 -> 1581 bytes lib/flowplayer-html5/skin/img/playful_black.png | Bin 0 -> 1417 bytes lib/flowplayer-html5/skin/img/playful_black@x2.png | Bin 0 -> 3665 bytes lib/flowplayer-html5/skin/img/playful_white.png | Bin 0 -> 1424 bytes lib/flowplayer-html5/skin/img/playful_white@x2.png | Bin 0 -> 3684 bytes lib/flowplayer-html5/skin/img/white.png | Bin 0 -> 558 bytes lib/flowplayer-html5/skin/img/white@x2.png | Bin 0 -> 946 bytes lib/flowplayer-html5/skin/minimalist.css | 158 +++++++ lib/flowplayer-html5/skin/playful.css | 159 +++++++ lib/flowplayer.controls.swf | Bin 38359 -> 0 bytes lib/flowplayer.js | 228 ---------- lib/flowplayer.pseudostreaming-byterange.swf | Bin 171030 -> 0 bytes lib/flowplayer.pseudostreaming.swf | Bin 4847 -> 0 bytes lib/flowplayer.swf | Bin 126911 -> 0 bytes 28 files changed, 1183 insertions(+), 228 deletions(-) create mode 100644 lib/flowplayer-flash/flowplayer.controls.swf create mode 100644 lib/flowplayer-flash/flowplayer.js create mode 100644 lib/flowplayer-flash/flowplayer.pseudostreaming-byterange.swf create mode 100644 lib/flowplayer-flash/flowplayer.pseudostreaming.swf create mode 100644 lib/flowplayer-flash/flowplayer.swf create mode 100644 lib/flowplayer-html5/flowplayer.js create mode 100644 lib/flowplayer-html5/flowplayer.swf create mode 100644 lib/flowplayer-html5/skin/all-skins.css create mode 100644 lib/flowplayer-html5/skin/functional.css create mode 100644 lib/flowplayer-html5/skin/img/black.png create mode 100644 lib/flowplayer-html5/skin/img/black@x2.png create mode 100644 lib/flowplayer-html5/skin/img/play_black.png create mode 100644 lib/flowplayer-html5/skin/img/play_black@x2.png create mode 100644 lib/flowplayer-html5/skin/img/play_white.png create mode 100644 lib/flowplayer-html5/skin/img/play_white@x2.png create mode 100644 lib/flowplayer-html5/skin/img/playful_black.png create mode 100644 lib/flowplayer-html5/skin/img/playful_black@x2.png create mode 100644 lib/flowplayer-html5/skin/img/playful_white.png create mode 100644 lib/flowplayer-html5/skin/img/playful_white@x2.png create mode 100644 lib/flowplayer-html5/skin/img/white.png create mode 100644 lib/flowplayer-html5/skin/img/white@x2.png create mode 100644 lib/flowplayer-html5/skin/minimalist.css create mode 100644 lib/flowplayer-html5/skin/playful.css delete mode 100644 lib/flowplayer.controls.swf delete mode 100644 lib/flowplayer.js delete mode 100644 lib/flowplayer.pseudostreaming-byterange.swf delete mode 100644 lib/flowplayer.pseudostreaming.swf delete mode 100644 lib/flowplayer.swf (limited to 'lib') diff --git a/lib/flowplayer-flash/flowplayer.controls.swf b/lib/flowplayer-flash/flowplayer.controls.swf new file mode 100644 index 00000000..8809004d Binary files /dev/null and b/lib/flowplayer-flash/flowplayer.controls.swf differ diff --git a/lib/flowplayer-flash/flowplayer.js b/lib/flowplayer-flash/flowplayer.js new file mode 100644 index 00000000..83cd974f --- /dev/null +++ b/lib/flowplayer-flash/flowplayer.js @@ -0,0 +1,228 @@ +!function(){function log(args){console.log("$f.fireEvent",[].slice.call(args));} +function clone(obj){if(!obj||typeof obj!='object'){return obj;} +var temp=new obj.constructor();for(var key in obj){if(obj.hasOwnProperty(key)){temp[key]=clone(obj[key]);}} +return temp;} +function each(obj,fn){if(!obj){return;} +var name,i=0,length=obj.length;if(length===undefined){for(name in obj){if(fn.call(obj[name],name,obj[name])===false){break;}}}else{for(var value=obj[0];i1){var params=arguments[1],conf=(arguments.length==3)?arguments[2]:{};if(typeof params=='string'){params={src:params};} +params=extend({bgcolor:"#000000",version:[10,1],expressInstall:"http://releases.flowplayer.org/swf/expressinstall.swf",cachebusting:false},params);if(typeof arg=='string'){if(arg.indexOf(".")!=-1){var instances=[];each(select(arg),function(){instances.push(new Player(this,clone(params),clone(conf)));});return new Iterator(instances);}else{var node=el(arg);return new Player(node!==null?node:clone(arg),clone(params),clone(conf));}}else if(arg){return new Player(arg,clone(params),clone(conf));}} +return null;};extend(window.$f,{fireEvent:function(){var a=[].slice.call(arguments);var p=$f(a[0]);return p?p._fireEvent(a.slice(1)):null;},addPlugin:function(name,fn){Player.prototype[name]=fn;return $f;},each:each,extend:extend});if(typeof jQuery=='function'){jQuery.fn.flowplayer=function(params,conf){if(!arguments.length||typeof arguments[0]=='number'){var arr=[];this.each(function(){var p=$f(this);if(p){arr.push(p);}});return arguments.length?arr[arguments[0]]:new Iterator(arr);} +return this.each(function(){$f(this,clone(params),conf?clone(conf):{});});};}}();!function(){var IE=document.all,URL='http://get.adobe.com/flashplayer',JQUERY=typeof jQuery=='function',RE=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,GLOBAL_OPTS={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(){};});} +function extend(to,from){if(from){for(var key in from){if(from.hasOwnProperty(key)){to[key]=from[key];}}} +return to;} +function map(arr,func){var newArr=[];for(var i in arr){if(arr.hasOwnProperty(i)){newArr[i]=func(arr[i]);}} +return newArr;} +window.flashembed=function(root,opts,conf){if(typeof root=='string'){root=document.getElementById(root.replace("#",""));} +if(!root){return;} +if(typeof opts=='string'){opts={src:opts};} +return new Flash(root,extend(extend({},GLOBAL_OPTS),opts),conf);};var f=extend(window.flashembed,{conf:GLOBAL_OPTS,getVersion:function(){var fo,ver;try{ver=navigator.plugins["Shockwave Flash"].description.slice(16);}catch(e){try{fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");ver=fo&&fo.GetVariable("$version");}catch(err){try{fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");ver=fo&&fo.GetVariable("$version");}catch(err2){}}} +ver=RE.exec(ver);return ver?[1*ver[1],1*ver[(ver[1]*1>9?2:3)]*1]:[0,0];},asString:function(obj){if(obj===null||obj===undefined){return null;} +var type=typeof obj;if(type=='object'&&obj.push){type='array';} +switch(type){case'string':return string2JsonString(obj);case'array':return'['+map(obj,function(el){return f.asString(el);}).join(',')+']';case'function':return'"function()"';case'object':var str=[];for(var prop in obj){if(obj.hasOwnProperty(prop)){str.push('"'+prop+'":'+f.asString(obj[prop]));}} +return'{'+str.join(',')+'}';} +return String(obj).replace(/\s/g," ").replace(/\'/g,"\"");},getHTML:function(opts,conf){opts=extend({},opts);var html='';} +opts.width=opts.height=opts.id=opts.w3c=opts.src=null;opts.onFail=opts.version=opts.expressInstall=null;for(var key in opts){if(opts[key]){html+='';}} +var vars="";if(conf){for(var k in conf){if(conf[k]){var val=conf[k];vars+=encodeURIComponent(k)+'=' ++encodeURIComponent(/function|object/.test(typeof val)?f.asString(val):val) ++'&';}} +vars=vars.slice(0,-1);html+='';} +html+="";return html;},isSupported:function(ver){return VERSION[0]>ver[0]||VERSION[0]==ver[0]&&VERSION[1]>=ver[1];}});var VERSION=f.getVersion();function Flash(root,opts,conf){if(f.isSupported(opts.version)){root.innerHTML=f.getHTML(opts,conf);}else if(opts.expressInstall&&f.isSupported([6,65])){root.innerHTML=f.getHTML(extend(opts,{src:opts.expressInstall}),{MMredirectURL:encodeURIComponent(location.href),MMplayerType:'PlugIn',MMdoctitle:document.title});}else{if(!root.innerHTML.replace(/\s/g,'')){root.innerHTML="

Flash version "+opts.version+" or greater is required

"+"

"+ +(VERSION[0]>0?"Your version is "+VERSION:"You have no flash plugin installed")+"

"+ +(root.tagName=='A'?"

Click here to download latest version

":"

Download latest version from here

");if(root.tagName=='A'||root.tagName=="DIV"){root.onclick=function(){location.href=URL;};}} +if(opts.onFail){var ret=opts.onFail.call(this);if(typeof ret=='string'){root.innerHTML=ret;}}} +if(IE){window[opts.id]=document.getElementById(opts.id);} +extend(this,{getRoot:function(){return root;},getOptions:function(){return opts;},getConf:function(){return conf;},getApi:function(){return root.firstChild;}});} +var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function string2JsonString(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} +if(JQUERY){jQuery.tools=jQuery.tools||{version:'@VERSION'};jQuery.tools.flashembed={conf:GLOBAL_OPTS};jQuery.fn.flashembed=function(opts,conf){return this.each(function(){$(this).data("flashembed",flashembed(this,opts,conf));});};}}();$f.addPlugin("ipad",function(options){var STATE_UNLOADED=-1;var STATE_LOADED=0;var STATE_UNSTARTED=1;var STATE_BUFFERING=2;var STATE_PLAYING=3;var STATE_PAUSED=4;var STATE_ENDED=5;var self=this;var currentVolume=1;var onStartFired=false;var stopping=false;var playAfterSeek=false;var activeIndex=0;var activePlaylist=[];var lastSecondTimer;var endTime=null;var startTime=0;var clipDefaults={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:[]};var currentState=STATE_UNLOADED;var previousState=STATE_UNLOADED;var isiDevice=/iPad|iPhone|iPod/i.test(navigator.userAgent);var video=null;function extend(to,from,includeFuncs){if(from){for(key in from){if(key){if(from[key]&&typeof from[key]=="function"&&!includeFuncs) +continue;if(from[key]&&typeof from[key]=="object"&&from[key].length===undefined){var cp={};extend(cp,from[key]);to[key]=cp;}else{to[key]=from[key];}}}} +return to;} +var opts={simulateiDevice:false,controlsSizeRatio:1.5,controls:true,debug:false,validExtensions:'mov|m4v|mp4|avi|mp3|m4a|aac|m3u8|m3u|pls',posterExtensions:'png|jpg'};extend(opts,options);var validExtensions=opts.validExtensions?new RegExp('^\.('+opts.validExtensions+')$','i'):null;var posterExtensions=new RegExp('^\.('+opts.posterExtensions+')$','i');function log(){if(opts.debug){if(isiDevice){var str=[].splice.call(arguments,0).join(', ');console.log.apply(console,[str]);}else{console.log.apply(console,arguments);}}} +function stateDescription(state){switch(state){case-1:return"UNLOADED";case 0:return"LOADED";case 1:return"UNSTARTED";case 2:return"BUFFERING";case 3:return"PLAYING";case 4:return"PAUSED";case 5:return"ENDED";} +return"UNKOWN";} +function actionAllowed(eventName){var ret=$f.fireEvent(self.id(),"onBefore"+eventName,activeIndex);return ret!==false;} +function stopEvent(e){e.stopPropagation();e.preventDefault();return false;} +function setState(state,force){if(currentState==STATE_UNLOADED&&!force) +return;previousState=currentState;currentState=state;stopPlayTimeTracker();if(state==STATE_PLAYING) +startPlayTimeTracker();log(stateDescription(state));} +function resetState(){video.fp_stop();onStartFired=false;stopping=false;playAfterSeek=false;setState(STATE_UNSTARTED);setState(STATE_UNSTARTED);} +var _playTimeTracker=null;function startPlayTimeTracker(){if(_playTimeTracker) +return;console.log("starting tracker");_playTimeTracker=setInterval(onTimeTracked,100);onTimeTracked();} +function stopPlayTimeTracker(){clearInterval(_playTimeTracker);_playTimeTracker=null;} +function onTimeTracked(){var currentTime=Math.floor(video.fp_getTime()*10)*100;var duration=Math.floor(video.duration*10)*100;var fireTime=(new Date()).time;function fireCuePointsIfNeeded(time,cues){time=time>=0?time:duration-Math.abs(time);for(var i=0;ifireTime){cues[i].lastTimeFired=-1;}else if(cues[i].lastTimeFired+500>fireTime){continue;}else{if(time==currentTime||(currentTime-500time)){cues[i].lastTimeFired=fireTime;$f.fireEvent(self.id(),'onCuepoint',activeIndex,cues[i].fnId,cues[i].parameters);}}}} +$f.each(self.getCommonClip().cuepoints,fireCuePointsIfNeeded);$f.each(activePlaylist[activeIndex].cuepoints,fireCuePointsIfNeeded);} +function replay(){resetState();playAfterSeek=true;video.fp_seek(0);} +function scaleVideo(clip){} +function addAPI(){console.log(video);function fixClip(clip){var extendedClip={};extend(extendedClip,clipDefaults);extend(extendedClip,self.getCommonClip());extend(extendedClip,clip);if(extendedClip.ipadUrl) +url=decodeURIComponent(extendedClip.ipadUrl);else if(extendedClip.url) +url=extendedClip.url;if(url&&url.indexOf('://')==-1&&extendedClip.ipadBaseUrl) +url=extendedClip.ipadBaseUrl+'/'+url;else if(url&&url.indexOf('://')==-1&&extendedClip.baseUrl) +url=extendedClip.baseUrl+'/'+url;extendedClip.originalUrl=extendedClip.url;extendedClip.completeUrl=url;extendedClip.extension=extendedClip.completeUrl.substr(extendedClip.completeUrl.lastIndexOf('.'));var queryIndex=extendedClip.extension.indexOf('?');if(queryIndex>-1) +extendedClip.extension=extendedClip.extension.substr(0,queryIndex);extendedClip.type='video';delete extendedClip.index;log("fixed clip",extendedClip);return extendedClip;} +video.fp_play=function(clip,inStream,forcePlay,poster){var url=null;var autoBuffering=true;var autoPlay=true;log("Calling play() "+clip,clip);if(inStream){log("ERROR: inStream clips not yet supported");return;} +if(clip!==undefined){if(typeof clip=="number"){if(activeIndex>=activePlaylist.length) +return;activeIndex=clip;clip=activePlaylist[activeIndex];}else{if(typeof clip=="string"){clip={url:clip};} +video.fp_setPlaylist(clip.length!==undefined?clip:[clip]);} +if(activeIndex==0&&activePlaylist.length>1&&posterExtensions.test(activePlaylist[activeIndex].extension)){var poster=activePlaylist[activeIndex].url;console.log("Poster image available with url "+poster);++activeIndex;console.log("Not last clip in the playlist, moving to next one");video.fp_play(activeIndex,false,true,poster);return;} +if(validExtensions&&!validExtensions.test(activePlaylist[activeIndex].extension)){return;} +clip=activePlaylist[activeIndex];url=clip.completeUrl;if(clip.autoBuffering!==undefined&&clip.autoBuffering===false) +autoBuffering=false;if(clip.autoPlay===undefined||clip.autoPlay===true||forcePlay===true){autoBuffering=true;autoPlay=true;}else{autoPlay=false;}}else{log("clip was not given, simply calling video.play, if not already buffering");if(currentState!=STATE_BUFFERING){video.play();} +return;} +log("about to play "+url,autoBuffering,autoPlay);resetState();if(url){log("Changing SRC attribute"+url);video.setAttribute('src',url);} +if(autoBuffering){if(!actionAllowed('Begin')) +return false;if(poster){autoPlay=clip.autoPlay;video.setAttribute('poster',poster);video.setAttribute('preload',"none");} +$f.fireEvent(self.id(),'onBegin',activeIndex);log("calling video.load()");video.load();} +if(autoPlay){log("calling video.play()");video.play();}} +video.fp_pause=function(){log("pause called");if(!actionAllowed('Pause')) +return false;video.pause();};video.fp_resume=function(){log("resume called");if(!actionAllowed('Resume')) +return false;video.play();};video.fp_stop=function(){log("stop called");if(!actionAllowed('Stop')) +return false;stopping=true;video.pause();try{video.currentTime=0;}catch(ignored){}};video.fp_seek=function(position){log("seek called "+position);if(!actionAllowed('Seek')) +return false;var seconds=0;var position=position+"";if(position.charAt(position.length-1)=='%'){var percentage=parseInt(position.substr(0,position.length-1))/100;var duration=video.duration;seconds=duration*percentage;}else{seconds=position;} +try{video.currentTime=seconds;}catch(e){log("Wrong seek time");}};video.fp_getTime=function(){return video.currentTime;};video.fp_mute=function(){log("mute called");if(!actionAllowed('Mute')) +return false;currentVolume=video.volume;video.volume=0;};video.fp_unmute=function(){if(!actionAllowed('Unmute')) +return false;video.volume=currentVolume;};video.fp_getVolume=function(){return video.volume*100;};video.fp_setVolume=function(volume){if(!actionAllowed('Volume')) +return false;video.volume=volume/100;};video.fp_toggle=function(){log('toggle called');if(self.getState()==STATE_ENDED){replay();return;} +if(video.paused) +video.fp_play();else +video.fp_pause();};video.fp_isPaused=function(){return video.paused;};video.fp_isPlaying=function(){return!video.paused;};video.fp_getPlugin=function(name){if(name=='canvas'||name=='controls'){var config=self.getConfig();return config['plugins']&&config['plugins'][name]?config['plugins'][name]:null;} +log("ERROR: no support for "+name+" plugin on iDevices");return null;};video.fp_close=function(){setState(STATE_UNLOADED);video.parentNode.removeChild(video);video=null;};video.fp_getStatus=function(){var bufferStart=0;var bufferEnd=0;try{bufferStart=video.buffered.start();bufferEnd=video.buffered.end();}catch(ignored){} +return{bufferStart:bufferStart,bufferEnd:bufferEnd,state:currentState,time:video.fp_getTime(),muted:video.muted,volume:video.fp_getVolume()};};video.fp_getState=function(){return currentState;};video.fp_startBuffering=function(){if(currentState==STATE_UNSTARTED) +video.load();};video.fp_setPlaylist=function(playlist){log("Setting playlist");activeIndex=0;for(var i=0;i0){clipDuration=activePlaylist[activeIndex].duration;endTime=clipDuration+startTime;}else{clipDuration=video.duration;endTime=null;} +video.fp_updateClip({duration:clipDuration,metaData:{duration:video.duration}},activeIndex);activePlaylist[activeIndex].duration=video.duration;activePlaylist[activeIndex].metaData={duration:video.duration};$f.fireEvent(self.id(),'onMetaData',activeIndex,activePlaylist[activeIndex]);};video.addEventListener('loadedmetadata',onMetaData,false);video.addEventListener('durationchange',onMetaData,false);var onTimeUpdate=function(e){if(endTime&&video.currentTime>endTime){video.fp_seek(startTime);resetState();return stopEvent(e);}};video.addEventListener("timeupdate",onTimeUpdate,false);var onStart=function(e){if(currentState==STATE_PAUSED){if(!actionAllowed('Resume')){log("Resume disallowed, pausing");video.fp_pause();return stopEvent(e);} +$f.fireEvent(self.id(),'onResume',activeIndex);} +setState(STATE_PLAYING);if(!onStartFired){onStartFired=true;$f.fireEvent(self.id(),'onStart',activeIndex);}};video.addEventListener('playing',onStart,false);var onPlay=function(e){startLastSecondTimer();} +video.addEventListener('play',onPlay,false);var onFinish=function(e){if(!actionAllowed('Finish')){if(activePlaylist.length==1){log("Active playlist only has one clip, onBeforeFinish returned false. Replaying");replay();}else if(activeIndex!=(activePlaylist.length-1)){log("Not the last clip in the playlist, but onBeforeFinish returned false. Returning to the beginning of current clip");video.fp_seek(0);}else{log("Last clip in playlist, but onBeforeFinish returned false, start again from the beginning");video.fp_play(0);} +return stopEvent(e);} +setState(STATE_ENDED);$f.fireEvent(self.id(),'onFinish',activeIndex);if(activePlaylist.length>1&&activeIndex<(activePlaylist.length-1)){log("Not last clip in the playlist, moving to next one");video.fp_play(++activeIndex,false,true);}};video.addEventListener('ended',onFinish,false);var onError=function(e){setState(STATE_LOADED,true);$f.fireEvent(self.id(),'onError',activeIndex,201);if(opts.onFail&&opts.onFail instanceof Function) +opts.onFail.apply(self,[]);};video.addEventListener('error',onError,false);var onPause=function(e){log("got pause event from player"+self.id());if(stopping) +return;if(currentState==STATE_BUFFERING&&previousState==STATE_UNSTARTED){log("forcing play");setTimeout(function(){video.play();},0);return;} +if(!actionAllowed('Pause')){video.fp_resume();return stopEvent(e);} +stopLastSecondTimer();setState(STATE_PAUSED);$f.fireEvent(self.id(),'onPause',activeIndex);} +video.addEventListener('pause',onPause,false);var onSeek=function(e){$f.fireEvent(self.id(),'onBeforeSeek',activeIndex);};video.addEventListener('seeking',onSeek,false);var onSeekDone=function(e){if(stopping){stopping=false;$f.fireEvent(self.id(),'onStop',activeIndex);} +else +$f.fireEvent(self.id(),'onSeek',activeIndex);log("seek done, currentState",stateDescription(currentState));if(playAfterSeek){playAfterSeek=false;video.fp_play();}else if(currentState!=STATE_PLAYING) +video.fp_pause();};video.addEventListener('seeked',onSeekDone,false);var onVolumeChange=function(e){$f.fireEvent(self.id(),'onVolume',video.fp_getVolume());};video.addEventListener('volumechange',onVolumeChange,false);} +function startLastSecondTimer(){lastSecondTimer=setInterval(function(){if(video.fp_getTime()>=video.duration-1){$f.fireEvent(self.id(),'onLastSecond',activeIndex);stopLastSecondTimer();}},100);} +function stopLastSecondTimer(){clearInterval(lastSecondTimer);} +function onPlayerLoaded(){video.fp_play(0);} +function installControlbar(){} +if(isiDevice||opts.simulateiDevice){if(!window.flashembed.__replaced){var realFlashembed=window.flashembed;window.flashembed=function(root,opts,conf){if(typeof root=='string'){root=document.getElementById(root.replace("#",""));} +if(!root){return;} +var style=window.getComputedStyle(root,null);var width=parseInt(style.width);var height=parseInt(style.height);while(root.firstChild) +root.removeChild(root.firstChild);var container=document.createElement('div');var api=document.createElement('video');container.appendChild(api);root.appendChild(container);container.style.height=height+'px';container.style.width=width+'px';container.style.display='block';container.style.position='relative';container.style.background='-webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.7)))';container.style.cursor='default';container.style.webkitUserDrag='none';api.style.height='100%';api.style.width='100%';api.style.display='block';api.id=opts.id;api.name=opts.id;api.style.cursor='pointer';api.style.webkitUserDrag='none';api.type="video/mp4";api.playerConfig=conf.config;$f.fireEvent(conf.config.playerId,'onLoad','player');};flashembed.getVersion=realFlashembed.getVersion;flashembed.asString=realFlashembed.asString;flashembed.isSupported=function(){return true;} +flashembed.__replaced=true;} +var __fireEvent=self._fireEvent;self._fireEvent=function(a){if(a[0]=='onLoad'&&a[1]=='player'){video=self.getParent().querySelector('video');if(opts.controls) +video.controls="controls";addAPI();addListeners();setState(STATE_LOADED,true);video.fp_setPlaylist(video.playerConfig.playlist);onPlayerLoaded();__fireEvent.apply(self,[a]);} +var shouldFireEvent=currentState!=STATE_UNLOADED;if(currentState==STATE_UNLOADED&&typeof a=='string') +shouldFireEvent=true;if(shouldFireEvent) +return __fireEvent.apply(self,[a]);} +self._swfHeight=function(){return parseInt(video.style.height);} +self.hasiPadSupport=function(){return true;}} +return self;}); \ No newline at end of file diff --git a/lib/flowplayer-flash/flowplayer.pseudostreaming-byterange.swf b/lib/flowplayer-flash/flowplayer.pseudostreaming-byterange.swf new file mode 100644 index 00000000..c35a3e20 Binary files /dev/null and b/lib/flowplayer-flash/flowplayer.pseudostreaming-byterange.swf differ diff --git a/lib/flowplayer-flash/flowplayer.pseudostreaming.swf b/lib/flowplayer-flash/flowplayer.pseudostreaming.swf new file mode 100644 index 00000000..74663e85 Binary files /dev/null and b/lib/flowplayer-flash/flowplayer.pseudostreaming.swf differ diff --git a/lib/flowplayer-flash/flowplayer.swf b/lib/flowplayer-flash/flowplayer.swf new file mode 100644 index 00000000..a7f1e5cf Binary files /dev/null and b/lib/flowplayer-flash/flowplayer.swf differ diff --git a/lib/flowplayer-html5/flowplayer.js b/lib/flowplayer-html5/flowplayer.js new file mode 100644 index 00000000..1ba19163 --- /dev/null +++ b/lib/flowplayer-html5/flowplayer.js @@ -0,0 +1,5 @@ +/*! + + Flowplayer v5.3.2 (Monday, 28. January 2013 10:02AM) | flowplayer.org/license + +*/!function(e){function o(t,n){var r="obj"+(""+Math.random()).slice(2,15),i='':' data="'+t+'" type="application/x-shockwave-flash">';var s={width:"100%",height:"100%",allowscriptaccess:"always",wmode:"transparent",quality:"high",flashvars:"",movie:t+(e.browser.msie?"?"+r:""),name:r};return e.each(n,function(e,t){s.flashvars+=e+"="+t+"&"}),e.each(s,function(e,t){i+=''}),i+="",e(i)}function f(e){return Math.round(e*100)/100}function l(e){return/mpegurl/i.test(e)?"application/x-mpegurl":"video/"+e}function c(e){return/^(video|application)/.test(e)||(e=l(e)),!!u.canPlayType(e).replace("no","")}function v(e){var t=e.attr("src"),n=e.attr("type")||"",r=t.split(d)[1];return n=/mpegurl/.test(n)?"mpegurl":n.replace("video/",""),{src:t,suffix:r||n,type:n||r}}function m(t){var n=this,r=[];e("source",t).each(function(){r.push(v(e(this)))}),r.length||r.push(v(t)),n.initialSources=r,n.resolve=function(t){return t?(e.isArray(t)?t={sources:e.map(t,function(t){var n;return e.each(t,function(e,t){n=e}),t.type=n,t.src=t[n],delete t[n],t})}:typeof t=="string"&&(t={src:t,sources:[]},e.each(r,function(e,n){n.type!="flash"&&t.sources.push({type:n.type,src:t.src.replace(d,"")+"."+n.suffix})})),t):{sources:r}}}function g(e){return e=parseInt(e,10),e>=10?e:"0"+e}function y(e){e=e||0;var t=Math.floor(e/3600),n=Math.floor(e/60);return e-=n*60,t>=1?(n-=t*60,t+":"+g(n)+":"+g(e)):g(n)+":"+g(e)}!function(e){if(!e.browser){var t=e.browser={},n=navigator.userAgent.toLowerCase(),r=/(chrome)[ \/]([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[];r[1]&&(t[r[1]]=!0,t.version=r[2]||"0")}}(jQuery),e(function(){typeof e.fn.flowplayer=="function"&&e("video").parent(".flowplayer").flowplayer()});var t=[],n=[],r=navigator.userAgent,i=/Android/.test(r)&&/Firefox/.test(r);window.flowplayer=function(r){return i?0:e.isFunction(r)?n.push(r):typeof r=="number"||r===undefined?t[r||0]:e(r).data("flowplayer")},e.extend(flowplayer,{version:"5.3.2",engine:{},conf:{},support:{},defaults:{debug:!1,disabled:!1,engine:"html5",fullscreen:window==window.top,keyboard:!0,ratio:9/16,flashfit:!1,rtmp:0,splash:!1,swf:"http://releases.flowplayer.org/5.3.2/flowplayer.swf",speeds:[.25,.5,1,1.5,2],tooltip:!0,volume:1,errors:["","Video loading aborted","Network error","Video not properly encoded","Video file not found","Unsupported video","Skin not found","SWF file not found","Subtitles not found","Invalid RTMP URL","Unsupported video format. Try installing Adobe Flash."],errorUrls:["","","","","","","","","","","http://get.adobe.com/flashplayer/"]}});if(i)return e(function(){e("video").attr("controls","controls")});var s=0;e.fn.flowplayer=function(r,i){return typeof r=="string"&&(r={swf:r}),e.isFunction(r)&&(i=r,r={}),!r&&this.data("flowplayer")||this.each(function(){var o=e(this).addClass("is-loading"),u=e.extend({},flowplayer.defaults,flowplayer.conf,r,o.data()),a=e("video",o).addClass("fp-engine").removeAttr("controls"),f=new m(a),l={},c,h;o.data("fp-player_id",o.data("fp-player_id")||s++);try{l=window.localStorage||l}catch(p){}var d={conf:u,currentSpeed:1,volumeLevel:l.volume*1||u.volume,video:{},disabled:!1,finished:!1,loading:!1,muted:l.muted=="true"||u.muted,paused:!1,playing:!1,ready:!1,splash:!1,load:function(t,n){if(d.error||d.loading||d.disabled)return;t=f.resolve(t),e.extend(t,h.pick(t.sources));if(t.src){var r=e.Event("load");o.trigger(r,[d,t,h]),r.isDefaultPrevented()||(h.load(t),e.isFunction(t)&&(n=t),n&&o.one("ready",n))}return d},pause:function(e){return d.ready&&!d.seeking&&!d.disabled&&!d.loading&&(h.pause(),d.one("pause",e)),d},resume:function(){return d.ready&&d.paused&&!d.disabled&&(h.resume(),d.finished&&(d.trigger("resume"),d.finished=!1)),d},toggle:function(){return d.ready?d.paused?d.resume():d.pause():d.load()},seek:function(t,n){if(d.ready){if(typeof t=="boolean"){var r=d.video.duration*.1;t=d.video.time+(t?r:-r)}t=c=Math.min(Math.max(t,0),d.video.duration),h.seek(t),e.isFunction(n)&&o.one("seek",n)}return d},seekTo:function(e,t){var n=e===undefined?c:d.video.duration*.1*e;return d.seek(n,t)},mute:function(e){e==undefined&&(e=!d.muted),l.muted=d.muted=e,d.volume(e?0:l.volume),d.trigger("mute",e)},volume:function(e){return d.ready&&(e=Math.min(Math.max(e,0),1),l.volume=e,h.volume(e)),d},speed:function(t,n){return d.ready&&(typeof t=="boolean"&&(t=u.speeds[e.inArray(d.currentSpeed,u.speeds)+(t?1:-1)]||d.currentSpeed),h.speed(t),n&&o.one("speed",n)),d},stop:function(){return d.ready&&(d.pause(),d.seek(0,function(){o.trigger("stop")})),d},unload:function(){return o.hasClass("is-embedding")||(u.splash?(d.trigger("unload"),h.unload()):d.stop()),d},disable:function(e){e===undefined&&(e=!d.disabled),e!=d.disabled&&(d.disabled=e,d.trigger("disable",e))}};e.each(["bind","one","unbind"],function(e,t){d[t]=function(e,n){return o[t](e,n),d}}),d.trigger=function(e,t){return o.trigger(e,[d,t]),d},o.bind("boot",function(){e.each(["autoplay","loop","preload","poster"],function(e,t){var n=a.attr(t);n!==undefined&&(u[t]=n?n:!0)});if(u.splash||o.hasClass("is-splash")||!flowplayer.support.firstframe)d.splash=u.splash=u.autoplay=!0,o.addClass("is-splash"),a.attr("preload","none");e.each(n,function(e){this(d,o)}),h=flowplayer.engine[u.engine],h&&(h=h(d,o)),h.pick(f.initialSources)?d.engine=u.engine:e.each(flowplayer.engine,function(e,t){if(e!=u.engine)return h=this(d,o),h.pick(f.initialSources)&&(d.engine=e),!1});if(!d.engine)return d.trigger("error",{code:flowplayer.support.flash?5:10});u.splash?d.unload():d.load(),u.disabled&&d.disable(),o.one("ready",i),t.push(d)}).bind("load",function(t,n,r){u.splash&&e(".flowplayer").filter(".is-ready, .is-loading").not(o).each(function(){var t=e(this).data("flowplayer");t.conf.splash&&t.unload()}),o.addClass("is-loading"),n.loading=!0}).bind("ready",function(e,t,n){function r(){o.removeClass("is-loading"),t.loading=!1}n.time=0,t.video=n,u.splash?o.one("progress",r):r(),t.muted?t.mute(!0):t.volume(t.volumeLevel)}).bind("unload",function(e){u.splash&&a.remove(),o.removeClass("is-loading"),d.loading=!1}).bind("ready unload",function(e){var t=e.type=="ready";o.toggleClass("is-splash",!t).toggleClass("is-ready",t),d.ready=t,d.splash=!t}).bind("progress",function(e,t,n){t.video.time=n}).bind("speed",function(e,t,n){t.currentSpeed=n}).bind("volume",function(e,t,n){t.volumeLevel=Math.round(n*100)/100,t.muted?n&&t.mute(!1):l.volume=n}).bind("beforeseek seek",function(e){d.seeking=e.type=="beforeseek",o.toggleClass("is-seeking",d.seeking)}).bind("ready pause resume unload finish stop",function(e,t,n){d.paused=/pause|finish|unload|stop/.test(e.type),e.type=="ready"&&n&&(d.paused=!n.duration||!u.autoplay&&(u.preload!="none"||d.engine=="flash")),d.playing=!d.paused,o.toggleClass("is-paused",d.paused).toggleClass("is-playing",d.playing),d.load.ed||d.pause()}).bind("finish",function(e){d.finished=!0}).bind("error",function(){a.remove()}),o.trigger("boot",[d,o]).data("flowplayer",d)})},!function(){var t=flowplayer.support,n=e.browser,r=e("