# HG changeset patch # User veltr # Date 1351069711 -7200 # Node ID b1c3bf6eca78ed0ee504377e428aba445fe35d3e # Parent 353b0881a0b96c2443cec368381e97df76f6cdcc Cleaning and refactoring diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/bab/URLLoaderLdt.as --- a/assets/player_bab_ldt/bab/URLLoaderLdt.as Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -package tools -{ - import flash.net.URLLoader; - import flash.net.URLRequest; - - public class URLLoaderLdt extends URLLoader - { - private var _url:String; - private var _preVideo:String; - private var _prePict:String; - private var _preExtra:String; - - public function URLLoaderLdt(request:URLRequest=null, preVideo:String=null, prePict:String=null, preExtra:String=null) - { - if(request!=null){ - _url = request.url; - _preVideo = preVideo; - _prePict = prePict; - _preExtra = preExtra; - } - super(request); - } - public function get url():String{ return _url; } - public function get preVideo():String{ return _preVideo; } - public function get prePict():String{ return _prePict; } - public function get preExtra():String{ return _preExtra; } - - } -} \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/bab/XMLInOut.as --- a/assets/player_bab_ldt/bab/XMLInOut.as Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -package bab { import flash.events.Event; import flash.events.IOErrorEvent; import flash.net.FileReference; import flash.net.URLLoader; import flash.net.URLRequest; import flash.system.Capabilities; import player_bab_ldt; public class XMLInOut { private var app:player_bab_ldt; private var myLdtEdits:XMLList; private var editsAr:Array = []; private var titlesAr:Array = []; private var nbBab:uint = 0; private var curBab:Number = -1; private var segAr1:Array; private var segAr2:Array; public function XMLInOut(o:player_bab_ldt, urlData:String) { app = o; var urll:URLLoader = new URLLoader(new URLRequest(urlData)); urll.addEventListener(Event.COMPLETE, onloadData); urll.addEventListener(IOErrorEvent.IO_ERROR, errorLoad); } private function errorLoad(e:IOErrorEvent):void{ trace("errorLoad"); //Alert.show("Impossible to load the file") + " " + e.text + "\n" + (e.target as URLLoaderLdt).url, "Error"); } private function onloadData(e:Event):void{ var ldtXml:XML = new XML(e.currentTarget.data); // We test if the project is in old iri/ldt format or cinelab format if(ldtXml.project.length()>0){ // There is a project tag in the xml -> iri/ldt format myLdtEdits = ldtXml.edits.editing; loadEditsXML(myLdtEdits); } else{ // Else cinelab format trace("No LDT format, No load"); //Alert.show("No LDT format","No load"); } } public function loadEditsXML(xl:XMLList):void{ trace("loadEditsXML l = " + xl.length() + ", nodename = " + xl[0].name().localName); if(xl!=null && xl.length()>0){ if(xl[0].name().localName=="view"){ //loadEditsXMLCinelab(xl); trace("No BAB LDT format, No load"); } else{ //trace(xl.toString()); editsAr = new Array(); titlesAr = new Array(); for each(var editing:XML in xl){ nbBab++; var inst:XML, curMedia:XMLList, a:Array, content:String; // First edit's line var ar1:Array = new Array(); var editList:XMLList = editing.edit.(@id=="edit1").eList.inst; var mediaList:XMLList = editing.edit.(@id=="edit1").mList.m; // We adapt the program to the new and old version of content/media place // new url or text content // old for each(inst in editList){ a = inst.@ref.split("|;|"); curMedia = mediaList.(@id==inst.@m); content = (curMedia.@src.toString()=="" || curMedia.@src==undefined) ? curMedia.content.toString() : curMedia.@src.toString(); //trace("m = " + inst.@m.toString() + ", " + curMedia.@t.toString() + ", " + uint(curMedia.@c) + ", " + curMedia.@src.toString() + ", " + curMedia.content.toString() + ", content=" + content); if(a[0]=="title"){ a[0]="text"; } // To allow old version // A video path can be dependant on the user's folder organisation. // If a user B receives a project from a user A, the video paths will be like // /users/userA/docs/video/id/id.flv and /users/userB/ldt/id/i d.flv // So in order ta read the BàB without problems, we match the bàb paths // with the video paths actually recorded. // if(curMedia.@t.toString()=="v"){ // content = content.replace(/\\/g,"/"); // var videoName:String = content.substr(content.lastIndexOf("/")+1); // for(var idCtt:String in Global.arContents){ // if(Global.arContents[idCtt]["path"].substr(Global.arContents[idCtt]["path"].replace(/\\/g,"/").lastIndexOf("/")+1)==videoName){ // content = Global.arContents[idCtt]["path"]; // } // } // } // Now that we got the good video path, we push in the array ar1.push({idCtt:a[0], idGrp:a[1], idCut:a[2], idView:a[3], crit:a[3], idSeg:a[5], tIn:Number(inst.@begin), tOut:Number(inst.@end), type:curMedia.@t.toString(), v:uint(inst.@v), color:uint(curMedia.@c), content:content, idAuthor:"", author:"", idTitle:"", title:"", date:"", trId:Number(inst.@trId), trIc:Number(inst.@trIc), trOd:Number(inst.@trOd), trOc:Number(inst.@trOc)}); } // Second edit's line var ar2:Array = new Array(); editList = editing.edit.(@id=="edit2").eList.inst; mediaList = editing.edit.(@id=="edit2").mList.m; for each(inst in editList){ a = inst.@ref.split("|;|"); //trace("m = " + inst.@m.toString() + ", " + edit1Media.(@id==inst.@m.toString()).@t.toString() + ", " + uint(edit1Media.(@id==inst.@m).@c) + ", " + edit1Media.(@id==inst.@m).@src.toString() + ", " + edit1Media.(@id==inst.@m).content.toString()); curMedia = mediaList.(@id==inst.@m); content = (curMedia.@src.toString()=="" || curMedia.@src==undefined) ? curMedia.content.toString() : curMedia.@src.toString(); if(a[0]=="title"){ a[0]="text"; } // To allow old version // A video path can be dependant on the user's folder organisation. // If a user B receives a project from a user A, the video paths will be like // /users/userA/docs/video/id/id.flv and /users/userB/ldt/id/id.flv // So in order ta read the BàB without problems, we match the bàb paths // with the video paths actually recorded. // if(curMedia.@t.toString()=="v"){ // content = content.replace(/\\/g,"/"); // videoName = content.substr(content.lastIndexOf("/")+1); // for(idCtt in Global.arContents){ // if(Global.arContents[idCtt]["path"].substr(Global.arContents[idCtt]["path"].replace(/\\/g,"/").lastIndexOf("/")+1)==videoName){ // content = Global.arContents[idCtt]["path"]; // } // } // } // Now that we got the good video path, we push in the array ar2.push({idCtt:a[0], idGrp:a[1], idCut:a[2], idView:a[3], crit:a[3], idSeg:a[5], tIn:Number(inst.@begin), tOut:Number(inst.@end), type:curMedia.@t.toString(), v:uint(inst.@v), color:uint(curMedia.@c), content:content, idAuthor:"", author:"", idTitle:"", title:"", date:"", trId:Number(inst.@trId), trIc:Number(inst.@trIc), trOd:Number(inst.@trOd), trOc:Number(inst.@trOc)}); } // And we push a new edit entry with the edit's title and abstract editsAr.push({id:"bab_1", title:editing.title.toString(), abstract:editing.abstract.toString(), segAr1:ar1, segAr2:ar2, creator:"projectCreator", created:now, contributor:"projectCreator", modified:now}); titlesAr.push(editing.title.toString()); } if(editsAr.length==0){ editsAr.push({id:"bab_1", title:"Bout à bout 1", abstract:"", segAr1:new Array(), segAr2:new Array(), creator:"projectCreator", created:now, contributor:"projectCreator", modified:now}); titlesAr.push("Bout à bout 1"); } //setBab(0, true); } } else{ editsAr = [{id:"bab_1", title:"Bout à bout 1", abstract:"", segAr1:new Array(), segAr2:new Array(), creator:"projectCreator", created:now, contributor:"projectCreator", modified:now}]; titlesAr = ["Bout à bout 1"]; //setBab(0, true); } app.youCanStart(); } public function getEditList1():Array{ trace("bab getEditList1"); // For each line, 2 arrays have to be prepared. The first is the edit instructions. // The second is the media array (type, content -path or text-, background color) return getEditMediaList(0, 1); } private function getEditMediaList(numBab:Number, line:uint):Array{ var a:Array = []; if(0<=numBab && numBab while the volume management has not been coded volBtn.visible = skinMc.volumeBar_mc.visible = true; // playBtn.addEventListener(MouseEvent.CLICK, playPauseHandler); pauseBtn.addEventListener(MouseEvent.CLICK, playPauseHandler); backBtn.addEventListener(MouseEvent.CLICK, backHandler); forwardBtn.addEventListener(MouseEvent.CLICK, forwardHandler); volBtn.addEventListener(MouseEvent.MOUSE_DOWN, startVolHandler); volBar.addEventListener(MouseEvent.MOUSE_DOWN, startVolHandler); } // // Mouse Event handlers // private function playPauseHandler(e:MouseEvent=null):void{ dispatchEvent(new EditEvent(EditEvent.EDIT_PLAYPAUSE, curVol)); } private function backHandler(e:MouseEvent=null):void{ dispatchEvent(new EditEvent(EditEvent.EDIT_BACK, curVol)); } private function forwardHandler(e:MouseEvent=null):void{ dispatchEvent(new EditEvent(EditEvent.EDIT_FORWARD, curVol)); } private function startVolHandler(e:MouseEvent=null):void{ //trace("startVolHandler"); volBtn.startDrag(false,new Rectangle(xVol,yVol,50,0)); volBtn.stage.addEventListener(MouseEvent.MOUSE_MOVE,updateSound); volBtn.stage.addEventListener(MouseEvent.MOUSE_UP, stopVolHandler); } private function stopVolHandler(e:MouseEvent=null):void{ volBtn.stopDrag(); volBtn.stage.removeEventListener(MouseEvent.MOUSE_MOVE,updateSound); volBtn.stage.removeEventListener(MouseEvent.MOUSE_UP, stopVolHandler); volBtn.buttonMode = true; // We dispatch the event only at the end } private function updateSound(e:MouseEvent=null):void{ //trace("xVol : " + xVol); //trace("volBtn.x : "+ volBtn.x); volBar.width = volBtn.x - xVol; //trace("volBar.width : " + volBar.width); curVol = (100 / 50) * (volBtn.x - xVol); dispatchEvent(new EditEvent(EditEvent.EDIT_SOUNDUPDATE, curVol/100)); } // // Enable to switch display between play and pause buttons // public function set isPlaying(b:Boolean):void{ if(b==true){ playBtn.visible = false; pauseBtn.visible = true; } else if(b==false){ playBtn.visible = true; pauseBtn.visible = false; } } public function setVolume(vol:Number):void{ volBtn.x = xVol + 50*vol; volBar.width = volBtn.x - xVol; //trace("setVolume, vol : " + vol); dispatchEvent(new EditEvent(EditEvent.EDIT_SOUNDUPDATE, vol)); } } } \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/bab/player/ExternalPlayer.as --- a/assets/player_bab_ldt/bab/player/ExternalPlayer.as Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -package bab.player { import fl.video.VideoEvent; import flash.display.DisplayObjectContainer; import flash.display.Loader; import flash.display.SimpleButton; import flash.events.ErrorEvent; import flash.events.Event; import flash.events.EventDispatcher; import flash.events.MouseEvent; import flash.events.SecurityErrorEvent; import flash.events.TimerEvent; import flash.net.URLRequest; import flash.system.Security; import flash.text.TextField; import flash.utils.Timer; //import mx.controls.Alert; public class ExternalPlayer extends EventDispatcher { private var curParent:DisplayObjectContainer; private var player:Object; private var playerYT:Object; private var playerDM:Object; private var playBtn:SimpleButton; private var pauseBtn:SimpleButton; private var volPlus:SimpleButton; private var volMinus:SimpleButton; private var playheadTimer:Timer; private var urlToLoad:String; private var sizeUpdated:Boolean = false; public static function get EXTERNALPLAYER_RATIO():Number{ return 1.6; } public function ExternalPlayer(prnt:DisplayObjectContainer, url:String="") { Security.allowDomain("*"); Security.allowInsecureDomain("*"); curParent = prnt; // Simple button Play var t:TextField = new TextField(); t.text = "PLAY"; t.autoSize = "left"; playBtn = new SimpleButton(t,t,t,t); playBtn.useHandCursor = playBtn.mouseEnabled = true; prnt.addChild(playBtn); // Simple button Pause var t2:TextField = new TextField(); t2.text = "PAUSE"; t2.autoSize = "left"; pauseBtn = new SimpleButton(t2,t2,t2,t2); pauseBtn.useHandCursor = pauseBtn.mouseEnabled = true; prnt.addChild(pauseBtn); // Simple button Volume + var t3:TextField = new TextField(); t3.text = "Vol + /"; t3.autoSize = "left"; volPlus = new SimpleButton(t3,t3,t3,t3); volPlus.useHandCursor = volPlus.mouseEnabled = true; prnt.addChild(volPlus); // Simple button Pause var t4:TextField = new TextField(); t4.text = "Vol -"; t4.autoSize = "left"; volMinus = new SimpleButton(t4,t4,t4,t4); volMinus.useHandCursor = volMinus.mouseEnabled = true; prnt.addChild(volMinus); pauseBtn.x = 50; volPlus.x = 200; volMinus.x = 235; // Play pause listeners playBtn.addEventListener(MouseEvent.CLICK, onBtnClick); pauseBtn.addEventListener(MouseEvent.CLICK, onBtnClick); // Volume listeners volPlus.addEventListener(MouseEvent.CLICK, onVolClick); volMinus.addEventListener(MouseEvent.CLICK, onVolClick); loadVideo(url); } // // Load Players // private function loadYTPlayer():void{ // Youtube loader var l:Loader = new Loader(); l.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadYTCLP); l.addEventListener(ErrorEvent.ERROR, onError, true); l.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError, true); l.contentLoaderInfo.addEventListener(ErrorEvent.ERROR, onError, true); l.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError, true); l.load(new URLRequest("http://www.youtube.com/apiplayer?version=3")); // The parent will load; curParent.addChild(l); } private function loadDMPlayer():void{ // Dailymotion loader var l:Loader = new Loader(); l.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadDMCLP); l.addEventListener(ErrorEvent.ERROR, onError, true); l.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError, true); l.contentLoaderInfo.addEventListener(ErrorEvent.ERROR, onError, true); l.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError, true); l.load(new URLRequest("http://www.dailymotion.com/swf?enableApi=1&chromeless=1")); // The parent will load; curParent.addChild(l); } // // OnLoad Players management // private function onLoadYTCLP(e:Event):void { //addChild(loader); playerYT = e.target.content; playerYT.addEventListener(ErrorEvent.ERROR, onError); playerYT.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError); playerYT.addEventListener("onReady", onYTPlayerReady); playerYT.addEventListener("onError", onYTPlayerError); playerYT.addEventListener("onStateChange", onYTStateChange); //YTPlayer.addEventListener("onPlaybackQualityChange", onVideoPlaybackQualityChange); } private function onLoadDMCLP(e:Event):void { //addChild(loader); playerDM = e.target.content; playerDM.addEventListener(ErrorEvent.ERROR, onError); playerDM.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onError); playerDM.addEventListener("onReady", onYTPlayerReady); playerDM.addEventListener("onError", onYTPlayerError); playerDM.addEventListener("onStateChange", onYTStateChange); //YTPlayer.addEventListener("onPlaybackQualityChange", onVideoPlaybackQualityChange); } // // Player event management // private function onYTPlayerReady(o:Object):void { // Event.data contains the event parameter, which is the Player API ID trace("player ready:" + o.data); // Once this event has been dispatched by the player, we can use // cueVideoById, loadVideoById, cueVideoByUrl and loadVideoByUrl // to load a particular YouTube video. loadVideo(urlToLoad); } private function onYTPlayerError(o:Object):void { // Event.data contains the event parameter, which is the error code trace("player error:", o.data); } private function onYTStateChange(o:Object):void { // Event.data contains the event parameter, which is the new player state trace("player state:" + o.data + (o.data==1) + (o.data=="1")); // o.data : unstarted (-1), ended (0), playing (1), paused (2), buffering (3), video cued (5) if(o.data==1 || o.data=="1" || o.data==3 || o.data=="3"){ // When the YTplayer enters in play state, it sends 1 or 3. if(playheadTimer!=null){ playheadTimer.stop(); playheadTimer = null; } playheadTimer = new Timer(500, 3600*2); playheadTimer.addEventListener(TimerEvent.TIMER, onTimer); playheadTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); playheadTimer.start(); } else{ // When the YTplayer enters in play state, it sends 1 or 3. if(playheadTimer!=null){ playheadTimer.stop(); playheadTimer = null; } } // When the video has been loaded, we ask a resize to the manager if(!sizeUpdated && o.data!=-1 && o.data!="-1"){ dispatchEvent(new VideoEvent(VideoEvent.READY)); } } // // Size matters // public function setSize(w:Number, h:Number):void{ if(player!=null){ //trace("setSize " + w + ", " + h); if(player.setSize) player.setSize(EXTERNALPLAYER_RATIO*Math.max(h,242),Math.max(h,242)); playBtn.y = pauseBtn.y = volPlus.y = volMinus.y = Math.max(h,240) + 10; } } // // Play/pause mangement // private function onBtnClick(e:MouseEvent):void{ if(e.target==playBtn) play(); else if(e.target==pauseBtn) pause(); } // // Play/pause mangement // public function play():void{ if(player!=null){ player.playVideo(); } } public function pause():void{ if(player!=null){ player.pauseVideo(); } } // // Timer management // private function onTimer(e:TimerEvent):void{ //trace("onTimer"); if(player!=null){ //trace("onTimer 2 " + player.getCurrentTime()); dispatchEvent(new VideoEvent(VideoEvent.PLAYHEAD_UPDATE, false, false, "playing", player.getCurrentTime())); } } private function onTimerComplete(e:TimerEvent):void{ // nothing to do } // // Visible management // public function set visible(b:Boolean):void{ if(player!=null){ player.visible = playBtn.visible = pauseBtn.visible = volMinus.visible = volPlus.visible = b; if(!b) pause(); } } public function get visible():Boolean{ if(player!=null){ return player.visible; } return false; } // // Volume management // private function onVolClick(e:MouseEvent):void{ if(player!=null){ if(e.target==volPlus) player.setVolume(Math.min(100, player.getVolume()+10)); else if(e.target==volMinus) player.setVolume(Math.max(0, player.getVolume()-10)); } } // // Url management // public function loadVideo(url:String):void{ var id:String = ""; if(url!=""&& url.search("youtube")>-1){ if(playerYT!=null){ // A valid youtube url is like : http://www.youtube.com/watch?v=PgEu923nxSE or http://www.youtube.com/v/PgEu923nxSE // The idea is to get the id from the url. The id is ALWAYS 11 characters. if(url.search("v=")>-1) id = url.substr(url.search("v=")+2, 11); else if(url.search("v/")>-1) id = url.substr(url.search("v/")+2, 11); sizeUpdated = false; player = playerYT; if(id!="" && id.length==11) player.loadVideoById(id); //else Alert.show("Youtube URL must be like\nhttp://www.youtube.com/watch?v=VIDEO_ID", "Attention"); //player.loadVideoById("PgEu923nxSE"); // Stiegler //player.loadVideoById("7xzU9Qqdqww"); // Kid Cudi - Pursuit Of Happiness ft. Ratatat } else{ urlToLoad = url; loadYTPlayer(); } } else if(url!=""&& url.search("dailymotion")>-1){ if(playerDM!=null){ // A valid DM url is like : http://www.dailymotion.com/video/VIDEO_ID // The idea is to get the id from the url. if(url.search("video/")>-1) id = url.substr(url.search("video/")+6); sizeUpdated = false; player = playerDM; if(id!="") player.loadVideoById(id); //else Alert.show("Dailymotion URL must be like\nhttp://www.dailymotion.com/video/VIDEO_ID", "Attention"); //player.loadVideoById("PgEu923nxSE"); // Stiegler //player.loadVideoById("7xzU9Qqdqww"); // Kid Cudi - Pursuit Of Happiness ft. Ratatat } else{ urlToLoad = url; loadDMPlayer(); } } } // // Seek management // public function goTo(tc:Number, paramPlay:Boolean):void{ if(player!=null){ //player.seekTo(tc, paramPlay); if(player==playerYT) player.seekTo(tc, true); else if(player==playerDM) player.seekTo(tc); } } // // Trying to catch the sandbox errors but does not work... // public function onError(er:*):void{ // do nothing trace("onError " + er); } } } \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/bab/player/FLVPlaybackCaptioningLDT.as --- a/assets/player_bab_ldt/bab/player/FLVPlaybackCaptioningLDT.as Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -package bab.player { import fl.video.*; import flash.events.Event; import flash.events.IOErrorEvent; import flash.net.URLLoader; import flash.net.URLRequest; //import mx.controls.Alert; import nl.inlet42.data.subtitles.SubTitleData; import nl.inlet42.data.subtitles.SubtitleParser; use namespace flvplayback_internal; public class FLVPlaybackCaptioningLDT extends FLVPlaybackCaptioning { public function FLVPlaybackCaptioningLDT() { super(); } public function loadCapXml(capXml:XML):void{ ttm = new TimedTextManager(this); //trace("ttm 2 = " + ttm); ttm.xmlLoader = new URLLoader(); ttm.xmlLoader.data = capXml; //trace("ttm.xmlLoader.data = " + ttm.xmlLoader.data.toString()); ttm.xmlLoadEventHandler(new Event(Event.COMPLETE)); } // // Generates a time text xml from a srt file // public function loadSrt(urlSrt:String):void{ var urll:URLLoader = new URLLoader(new URLRequest(urlSrt)); urll.addEventListener(Event.COMPLETE, onloadSrt); urll.addEventListener(IOErrorEvent.IO_ERROR, errorLoadSrt); } private function errorLoadSrt(e:IOErrorEvent):void{ //Alert.show("Impossible to load the file " + e.text, "Error"); } private function onloadSrt(e:Event):void{ var a:Array = SubtitleParser.parseSRT(e.currentTarget.data); //trace("a = " + a); var nbSub:uint = a.length; default xml namespace = new Namespace("http://www.w3.org/2006/10/ttaf1"); var subTtmXml:XML =
; var divNode:XML = subTtmXml.body.div[0]; for(var i:uint=0;i" + sub.text + "]]>

")); } loadCapXml(subTtmXml); } } } \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/bab/player/FLVPlaybackLDT.as --- a/assets/player_bab_ldt/bab/player/FLVPlaybackLDT.as Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -package bab.player { import fl.video.*; import flash.display.DisplayObjectContainer; use namespace flvplayback_internal; public class FLVPlaybackLDT extends FLVPlayback { public function FLVPlaybackLDT() { super(); } public function showHideSkin(b:Boolean):void{ flvplayback_internal::uiMgr.visible = b; } public function hideSeekBarHit():void{ // In some cases, we need to disable the access to the whole media. // In this purpose, we hise the SeekBarHit and SeekBarHandle. if(seekBar!=null){ var s:DisplayObjectContainer = seekBar.parent; var n:uint = s.numChildren; for(var i:uint=0;i-1 || path.search("dailymotion.com")>-1){ pause(); // A valid youtube url is like : http://www.youtube.com/watch?v=PgEu923nxSE or http://www.youtube.com/v/PgEu923nxSE if(YTPlayer==null){ YTPlayer = new ExternalPlayer(uic, path); YTPlayer.addEventListener(VideoEvent.PLAYHEAD_UPDATE, onPlayheadUpdate); YTPlayer.addEventListener(VideoEvent.READY, initSizes); } else YTPlayer.loadVideo(path); curRatio = ExternalPlayer.EXTERNALPLAYER_RATIO; //initSizes(); YTPlayer.visible = true; flvPB.visible = false; } else{ if(YTPlayer!=null) YTPlayer.visible = false; flvPB.visible = true; // We check if the media is already loaded var nbMedias:uint = metas.length; var vp:Number = getVp(path); lastVolume = flvPB.volume; // We stop the current reading if possible if(nbMedias>0 && allowFlvPB()) { flvPB.stop(); } // We load the new content or play the already loaded content if(isNaN(vp)){ vp = metas.length; // We activate the good video player index flvPB.activeVideoPlayerIndex = flvPB.visibleVideoPlayerIndex = vp; flvPB.smoothing = true; //trace("je load " + vp + ", " + path); metas.push({path:path, w:3, h:1, ratio:3}); curRatio = metas[vp].ratio; savePlay = paramPlay; if(live==true){ savePlay = true; flvPB.play(path, NaN, true); } else flvPB.load(path); // Then the window will be resized on metadata received //trace("LoadMedia flvPB.volume : " + flvPB.volume); // sets the volume to 0 (to avoid a bug) then sets it back to its previous level flvPB.volume = 0; flvPB.volume = lastVolume; } else{ // We activate the good video player index flvPB.activeVideoPlayerIndex = flvPB.visibleVideoPlayerIndex = vp; flvPB.smoothing = true; //trace("vp = " + flvPB.activeVideoPlayerIndex + ", " + flvPB.isLive); //trace("je play " + vp + ", " + path); if(allowFlvPB()){ savePlay==false ? flvPB.pause() : flvPB.play(); } // sets the volume to 0 (to avoid a bug) then sets it back to its previous level flvPB.volume = 0; flvPB.volume = lastVolume; // We have to resize the window curRatio = metas[vp].ratio; initSizes(); } // If a subtitle path is indicated we display it var ext:String = firstST.toLowerCase().substr(firstST.length-3); if(ext=="xml"){ caption.source = firstST; } else if(ext=="srt"){ caption.loadSrt(firstST); } // We set the caption/subtitles module to the good videoPlayerIndex index caption.videoPlayerIndex = vp; } } private function getVp(path:String):Number{ // We check if the media is already loaded var i:uint = 0; var nbMedias:uint = metas.length; var vp:Number = NaN; while(i=editList[curInst].tOut && e.state=="playing"){ playBabInst(curInst+1); } //var tcBab:Number; if(mediaList[editList[curInst].m].type=="v"){ //trace(editList[curInst].eIn + ", " + e.playheadTime + ", " + editList[curInst].tIn + ", diff = " + (editList[curInst].tIn - e.playheadTime) + ", last>1 = " + ((getTimer() - lastReSeek)>2000)); // If the current playheadTime is inferior to editList[curInst].tIn more than 3 seconds, we reseek to the tIn. // And we avoid too many seek by waiting 2 sec at least. if((editList[curInst].tIn - e.playheadTime)>3 && (getTimer() - lastReSeek)>2000){ //debugText.text = "HIDE and RESEEK"; if(allowFlvPB()) flvPB.seek(tcToReach); lastReSeek = getTimer(); flvPB.visible = false; flvPB.volume = 0; loading.visible = true; } else{ if((getTimer() - lastReSeek)>1000){ //debugText.text = "SEEK OK"; flvPB.visible = true; flvPB.volume = lastVolume; loading.visible = false; } // We apply max : because of the playhead's approximation, e.playheadTime can be inferior to tIn currentTcBab = Math.max(editList[curInst].eIn*1000,(editList[curInst].eIn + e.playheadTime - editList[curInst].tIn)*1000); //currentTcBab = tcBab; if(tcLabel) tcLabel.text = "[" + convertTC(currentTcBab, false) + "]"; this.dispatchEvent(new EditEvent(EditEvent.EDIT_UPDATETC, currentTcBab)); } } else if(mediaList[editList[curInst].m].type=="p" || mediaList[editList[curInst].m].type=="t"){ currentTcBab = (editList[curInst].eIn)*1000; if(tcLabel) tcLabel.text = "[" + convertTC(currentTcBab, false) + "]"; this.dispatchEvent(new EditEvent(EditEvent.EDIT_UPDATETC, currentTcBab)); } } } // // Set the good sizes function of the ratio // public function initSizes(e:VideoEvent=null):void{ // We set hMin and wMin for the video to take the maximum of space. wMax = 415, hMax = 310 /*if((Math.round(424/curRatio)+24+37)>310){ hMin = 310; wMin = (310-24-37)*curRatio; } else{ wMin = 415; hMin = Math.round(wMin/curRatio) + 24 + 37; } if(width-1){ flvPB.setSize(widthFlv,heightFlv); flvPB.scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO; if(babSkin!=null){ babSkin.y = heightFlv - 3; babSkin.getChildAt(0).width = widthFlv; } var nbChilds:uint = imageLayer.numChildren; for(var i:uint=0;i0 && editListPar.length>0){ instanceToPlay = 0; curInst = -1; // We don't display the different layers textLayer.visible = false; mcContainer.visible = false; imageLayer.visible = false; flvPB.visible = false; // We search for every media var i:uint; editList = editListPar; mediaList = mediaListPar; var nbMedias:uint = mediaList.length; var nbLoaded:uint = metas.length; var canStart:Boolean = true; var a:Array = new Array(); for(i=0;i0){ // We prepare pictAr for(i=0;i0 && allowFlvPB()){ flvPB.pause(); } //displayPict( ((mediaList[editList[curInst].m].content.substr(0,9)=="_resource") ? Global.projPath : "") + mediaList[editList[curInst].m].content); displayPict(mediaList[editList[curInst].m].content); imageLayer.y = 0; babRunningTimer = new Timer(250, editList[i].tOut*4); //trace("je lance un timer sur " + (babAr[i].tOut*4)); babRunningTimer.addEventListener(TimerEvent.TIMER, onRunningTimer); babRunningTimer.addEventListener(TimerEvent.TIMER_COMPLETE, completeTimer); babRunningTimer.start(); if(paramPlay==false){ onEditPlayPause(); } } else if(mediaList[editList[curInst].m].type=="t"){ // Text case textLayer.visible = true; mcContainer.visible = true; drawBgCtn(mediaList[editList[curInst].m].color); imageLayer.visible = false; flvPB.visible = false; if(metas.length>0 && allowFlvPB()){ flvPB.pause(); } textLayer.htmlText = mediaList[editList[curInst].m].content; // If the color is clear the text will be black, if the color is dark the text will be white. tf.color = (RGB2L(mediaList[editList[curInst].m].color)>(255*3/2)) ? 0x000000 : 0xFFFFFF; textLayer.setTextFormat(tf); textLayer.height = Math.floor(textLayer.textHeight) + 10; textLayer.y = ((hMin-37-37)/2) - (textLayer.textHeight/2); if(babRunningTimer!=null){ if(babRunningTimer.running==true){ babRunningTimer.stop(); } } babRunningTimer = new Timer(250, editList[i].tOut*4); //trace("je lance un timer sur " + (babAr[i].tOut*4)); babRunningTimer.addEventListener(TimerEvent.TIMER, onRunningTimer); babRunningTimer.addEventListener(TimerEvent.TIMER_COMPLETE, completeTimer); babRunningTimer.start(); if(paramPlay==false){ onEditPlayPause(); } } //if(Global.flv2==name) trace(name + " playBabInst textLayer = " + textLayer.visible + ", mcContainer = " + mcContainer.visible + ", imageLayer = " + imageLayer.visible + ", flvPB = " + flvPB.visible); //trace("4* tcBab = " + (editList[curInst].eIn*1000)); currentTcBab = editList[curInst].eIn * 1000; dispatchEvent(new EditEvent(EditEvent.EDIT_UPDATETC, currentTcBab)); if(tcLabel) tcLabel.text = "[" + convertTC(currentTcBab, false) + "]"; } // Else we run the current segment from the beginning else if(curInst==i){ babRunning = true; if(babRunningTimer!=null){ if(babRunningTimer.running==true){ babRunningTimer.stop(); } } //if(Global.flv2==name) trace(name + " 2 type m = " + mediaList[editList[curInst].m].type); //trace("m " + mediaList[editList[curInst].m].type + ", c = " + mediaList[editList[curInst].m].content + ", col = " + mediaList[editList[curInst].m].color); if(mediaList[editList[curInst].m].type=="v"){ savePlay = paramPlay; //if(Global.flv2==name) trace(name + " 2 vp = " + vp); if(allowFlvPB()){ // If the video is NOT streamed and savePlay==true, we play it. if(savePlay==true && mediaList[editList[curInst].m].content.substr(0,4).toLowerCase()!="rtmp") flvPB.play(); // If the video IS streamed and the player is playing, we have to pause it for the seek to work. if(!flvPB.paused && mediaList[editList[curInst].m].content.substr(0,4).toLowerCase()=="rtmp") flvPB.pause(); tcToReach = editList[curInst].tIn; flvPB.seek(tcToReach); } } else if(mediaList[editList[curInst].m].type=="p"){ babRunningTimer = new Timer(250, editList[i].tOut*4); //trace("je lance un timer sur " + (editList[i].tOut*4)); babRunningTimer.addEventListener(TimerEvent.TIMER, onRunningTimer); babRunningTimer.addEventListener(TimerEvent.TIMER_COMPLETE, completeTimer); babRunningTimer.start(); if(paramPlay==false){ onEditPlayPause(); } } else if(mediaList[editList[curInst].m].type=="t"){ if(babRunningTimer!=null){ if(babRunningTimer.running==true){ babRunningTimer.stop(); } } babRunningTimer = new Timer(250, editList[i].tOut*4); //trace("je lance un timer sur " + (babAr[i].tOut*4)); babRunningTimer.addEventListener(TimerEvent.TIMER, onRunningTimer); babRunningTimer.addEventListener(TimerEvent.TIMER_COMPLETE, completeTimer); babRunningTimer.start(); if(paramPlay==false){ onEditPlayPause(); } } //if(Global.flv2==name) trace(name + " playBabInst 2 textLayer = " + textLayer.visible + ", mcContainer = " + mcContainer.visible + ", imageLayer = " + imageLayer.visible + ", flvPB = " + flvPB.visible); currentTcBab = editList[curInst].eIn * 1000; dispatchEvent(new EditEvent(EditEvent.EDIT_UPDATETC, currentTcBab)); if(tcLabel) tcLabel.text = "[" + convertTC(currentTcBab, false) + "]"; } } else{ if(metas.length>0 && allowFlvPB()){ flvPB.pause(); } babRunning = false; }} //if(Global.flv2==name) trace(name + " playBabInst 2 textLayer = " + textLayer.visible + ", mcContainer = " + mcContainer.visible + ", imageLayer = " + imageLayer.visible + ", flvPB = " + flvPB.visible); } private function drawBgCtn(col:uint):void{ var g:Graphics = bgMcCtn.graphics; g.clear(); g.beginFill(col); g.drawRect(0,0,wMin,hMin-((editSkin) ? 39 : 0)); g.endFill(); } // // Empties the edit arrays // public function empty():void{ editList = []; mediaList = []; babRunning = false; curInst = -1; } // // Get luminance from RGB. Luminance is the sum between the 3 values from 0 to 255 of red, green and blue. // private function RGB2L(c:uint):uint{ var r:uint = (c >> 16) & 0xFF; var g:uint = (c >> 8) & 0xFF; var b:uint = c & 0xFF; var l:uint = r + g + b; return l; } public function get volume():Number{ return flvPB.volume;} private function convertTC(monTC:Number, tenth:Boolean=true) : String { // We do this 2 divisions to keep only 1 number after "." monTC = Math.floor(monTC/100); monTC = (tenth==true) ? monTC/10 : Math.floor(monTC/10); var MaHeu:Number = Math.floor(monTC/3600); var MaMin:Number = Math.floor(monTC/60)-(60*MaHeu); var MaSec:Number = ((monTC*10)%600) / 10; // We have to do that because there is an incomprehensible probleme with %60 var MonTime:String = ((MaHeu<10)?"0":"") + MaHeu + ":" + ((MaMin<10)?"0":"") + MaMin + ":" + ((MaSec<10)?"0":"") + MaSec; return MonTime; } // // External Interface functions // public function playVideo(e:*=null):Boolean{ if(metas.length>0 && allowFlvPB()){ flvPB.play(); if(editSkin) editSkin.isPlaying = true; } debugOutput("playVideo e = " + e); return true; } public function pauseVideo(e:*=null):Boolean{ if(metas.length>0 && allowFlvPB()){ flvPB.pause(); if(editSkin) editSkin.isPlaying = false; } debugOutput("pauseVideo e = " + e); return true; } public function getCurrentTime(e:*=null):Number{ // We send in seconds var tc:Number = Math.floor(currentTcBab) / 1000; debugOutput("getCurrentTime e = " + tc); return tc; } public function seekTo(e:*=null):Boolean{ // e is a number of seconds. we search wich instruction is relative to this timecode try{ e = Number(e); } catch(er:*){ debugOutput("seekToH TIMECODE NOT VALID"); return false; } var nbInst:uint = editList.length; var iToPlay:int = -1; for(var i:uint=0;i=0){ // We search the diffence of timecode between the wanted timecode et the instruction's beginning playBabInst(iToPlay, true, (editList[iToPlay].tIn + (e - editList[iToPlay].eIn))); debugOutput("seekToH e = " + e + " FOUND i = " + iToPlay + ", realTC = " + ((editList[iToPlay].tIn + (e - editList[iToPlay].eIn)) * 1000)); } else{ debugOutput("seekToH e = " + e + " NOT FOUND"); } return true; } public function isMuted(e:*=null):Boolean{ var b:Boolean = (flvPB.volume==0); debugOutput("isMuted e = " + b); return b; } public function mute(e:*=null):Boolean{ debugOutput("mute e = " + e); flvPB.volume = 0; lastVolume = flvPB.volume = 0; return true; } public function unMute(e:*=null):Boolean{ debugOutput("unMute e = " + e); flvPB.volume = 0; lastVolume = flvPB.volume = 1; return true; } public function getVolume(e:*=null):Number{ debugOutput("getVolume e = " + volume); return volume; } public function setVolume(e:*=null):Boolean{ flvPB.volume = 0; lastVolume = flvPB.volume = e; debugOutput("setVolume e = " + e); return true; } public function playInstruction(e:*=null):Boolean{ var i:uint = uint(e) - 1; playBabInst(i); debugOutput("playInstruction e = " + e); return true; } private function debugOutput(s:String):void{ if(debugText) debugText.text = "bab " + s; } private function onCCC(e:*):void{ seekTo("51"); } } } \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/bab/player/Image.as --- a/assets/player_bab_ldt/bab/player/Image.as Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -package bab.player { import flash.display.Sprite; public class Image extends Sprite { public var source:*; public function Image() { super(); } } } \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/bab/player/events/EditEvent.as --- a/assets/player_bab_ldt/bab/player/events/EditEvent.as Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -package bab.player.events { import flash.events.Event; public class EditEvent extends Event { public static var EDIT_PLAYPAUSE:String = "EditPlayPause"; public static var EDIT_BACK:String = "EditBack"; public static var EDIT_FORWARD:String = "EditForward"; public static var EDIT_SOUNDUPDATE:String = "EditSoundUpdate"; public static var EDIT_UPDATETC:String = "EditUpdateTC"; public static var EDIT_CHANGEINSTRUCTION:String = "EditChangeInstruction"; public var volume:Number; // between 0 and 100; public var inst:Number; // number of instruction in an edit from 0 to ... public var tc:Number; // bab-edit's timecode public function EditEvent(typePar:String, nb:Number=100, bubbles:Boolean=false, cancelable:Boolean=false) { super(typePar, bubbles, cancelable); if(typePar==EDIT_SOUNDUPDATE) volume = nb; else if(typePar==EDIT_UPDATETC) tc = nb; else if(typePar==EDIT_CHANGEINSTRUCTION) inst = nb; } } } \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/nl/inlet42/data/subtitles/SubTitleData.as --- a/assets/player_bab_ldt/nl/inlet42/data/subtitles/SubTitleData.as Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -package nl.inlet42.data.subtitles { - - public class SubTitleData { - public var text : String; - public var start : Number; - public var duration : Number; - public var end : Number; - public var startStr : String; - public var endStr : String; - - public function SubTitleData(inText : String = "",inStart : Number = 0,inDuration : Number = 0,inEnd : Number = 0,inStartStr : String = "",inEndStr : String = "") { - text = inText; - start = inStart; - duration = inDuration; - end = inEnd; - startStr = inStartStr; - endStr = inEndStr; - } - - public function toString() : void { - //trace("nl.inlet42.data.subtitles.SubTitleData " + ); - trace("SubTitleData " + start + ", " + duration + ", " + end + ", " + text); - } - } -} \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/nl/inlet42/data/subtitles/SubtitleParser.as --- a/assets/player_bab_ldt/nl/inlet42/data/subtitles/SubtitleParser.as Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -package nl.inlet42.data.subtitles { - - /** - * @author Jankees.van.Woezik - */ - public class SubtitleParser { - public static function parseSRT(data : String) : Array { - var result : Array = new Array(); - - var lines : Array; - var translation : SubTitleData; - - var blocks : Array = data.split(/^[0-9]+$/gm); - for each (var block : String in blocks) { - translation = new SubTitleData(); - lines = block.split(/[\r\n]+/); - for each (var line : String in lines) { - //all lines in a translation block - if(trim(line) != "") { - if(line.match("-->")) { - //timecodes line - var timecodes : Array = line.split(/[ ]+-->[ ]+/gm); - if(timecodes.length != 2) { - trace("Translation error, something wrong with the start or end time"); - } else { - translation.start = stringToSeconds(timecodes[0]); - translation.end = stringToSeconds(timecodes[1]); - translation.startStr = timecodes[0].replace(",","."); - translation.endStr = timecodes[1].replace(",","."); - translation.duration = translation.end - translation.start; - if(translation.duration < 0) { - trace("Translation error, something wrong with the start or end time"); - } - } - } else { - //translation line - if(translation.text.length != 0) line = "\n" + trim(line); - translation.text += line; - } - } - } - result.push(translation); - } - return result; - } - - public static function trim(p_string : String) : String { - if (p_string == null) { - return ''; - } - return p_string.replace(/^\s+|\s+$/g, ''); - } - - /** - * Convert a string to seconds, with these formats supported: - * 00:03:00.1 / 03:00.1 / 180.1s / 3.2m / 3.2h / 00:01:53,800 - * - * Special thanks to Thijs Broerse of Media Monks! - * - **/ - public static function stringToSeconds(string : String) : Number { - var arr : Array = string.split(':'); - var sec : Number = 0; - if (string.substr(-1) == 's') { - sec = Number(string.substr(0, string.length - 1)); - }else if (string.substr(-1) == 'm') { - sec = Number(string.substr(0, string.length - 1)) * 60; - }else if(string.substr(-1) == 'h') { - sec = Number(string.substr(0, string.length - 1)) * 3600; - }else if(arr.length > 1) { - if(arr[2] && String(arr[2]).indexOf(',') != -1) arr[2] = String(arr[2]).replace(/\,/, "."); - sec = Number(arr[arr.length - 1]); - sec += Number(arr[arr.length - 2]) * 60; - if(arr.length == 3) { - sec += Number(arr[arr.length - 3]) * 3600; - } - } else { - sec = Number(string); - } - return sec; - } - } -} \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/player_bab_ldt.as --- a/assets/player_bab_ldt/player_bab_ldt.as Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -package { import flash.display.MovieClip; import flash.display.StageScaleMode; import bab.XMLInOut; import bab.player.FlvPlayer; import bab.player.events.EditEvent; import flash.text.TextField; import flash.display.StageAlign; import flash.external.*; import flash.system.Security; import flash.events.Event; import fl.video.VideoEvent; import fl.video.VideoState; public class player_bab_ldt extends MovieClip { private var flashVars:Object; private var xio:XMLInOut; private var flvP1:FlvPlayer; private var ar:Array; private var t:TextField; public function player_bab_ldt() { // constructor code Security.allowDomain("*"); Security.allowInsecureDomain("*"); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; // Fuck CS5 "new feature from built-in preloader" : loaderInfo.parameters is from parent.parent.loaderInfo.parameter flashVars = new Object(); if(parent!=null){ if (parent.parent!=null) flashVars = parent.parent.loaderInfo.parameters; else flashVars = parent.loaderInfo.parameters; } else flashVars = loaderInfo.parameters; for(var param:Object in flashVars){ trace(" flashVars " + param + " : " + flashVars[param.toString()]); } t = new TextField(); t.text = "init s.w = " + stage.stageWidth + ", s.h = " + stage.stageHeight + ", ei.a = " + ExternalInterface.available; t.textColor = 0xBBBBBB; t.width = stage.stageWidth; addChild(t); //var urlData:String = "../../test/integration/fichiers_bab/yeelen_bab.ldt"; var urlData:String = ""; if(flashVars["urlData"]!="" && flashVars["urlData"]!=null){ urlData = flashVars["urlData"]; } if(urlData!="" && urlData!=null){ xio = new XMLInOut(this, urlData); } else{ t.text = "urlData INVALID"; } } public function youCanStart():void{ trace("youCanStart"); ar = xio.getEditList1(); trace("youCanStart 2 = " + ar.length); //var urlSkin:String = "../../test/integration/fichiers_bab/SkinBoutABout.swf"; var urlSkin:String = ""; if(flashVars["urlSkin"]!="" && flashVars["urlSkin"]!=null){ urlSkin = flashVars["urlSkin"]; } flvP1 = new FlvPlayer(stage.stageWidth, stage.stageHeight, urlSkin, t); if(urlSkin!=null && urlSkin!=""){ flvP1.addEventListener(EditEvent.EDIT_CHANGEINSTRUCTION, youCanStartBab); } flvP1.addEventListener(EditEvent.EDIT_UPDATETC, onBabVideoProgress); flvP1.addEventListener(VideoEvent.STATE_CHANGE, onBabStateChange); addChild(flvP1); // External interface management try{ ExternalInterface.addCallback("playVideo", flvP1.playVideo); ExternalInterface.addCallback("pauseVideo", flvP1.pauseVideo); ExternalInterface.addCallback("getCurrentTime", flvP1.getCurrentTime); ExternalInterface.addCallback("seekTo", flvP1.seekTo); ExternalInterface.addCallback("isMuted", flvP1.isMuted); ExternalInterface.addCallback("mute", flvP1.mute); ExternalInterface.addCallback("unMute", flvP1.unMute); ExternalInterface.addCallback("getVolume", flvP1.getVolume); ExternalInterface.addCallback("setVolume", flvP1.setVolume); ExternalInterface.addCallback("playInstruction", flvP1.playInstruction); } catch(e:*){ t.text = "ExternalInterface error catch e = " + e; t.textColor = 0xFFFFFF; } ExternalInterface.call("onBabPlayerReady","cool"); if(urlSkin==null || urlSkin==""){ youCanStartBab(); } } public function youCanStartBab(e:*=null):void{ flvP1.removeEventListener(EditEvent.EDIT_CHANGEINSTRUCTION, youCanStartBab); flvP1.getEditList(ar[0], ar[1]); } private function onBabVideoProgress(e:EditEvent):void{ // e.tc arrives in milliseconds ExternalInterface.call("onBabVideoProgress",{mediaTime:(Math.floor(e.tc)/1000)}); } private function onBabStateChange(e:VideoEvent):void{ var s:Number; // Embeddable adaptation : we limit the number of states // States can be : loading, stopped, seeking (3), paused (2), buffering, playing (1). switch(e.state){ case VideoState.SEEKING: s = 3; break; case VideoState.PAUSED: s = 2; break; case VideoState.PLAYING: s = 1; break; } if(!isNaN(s)){ ExternalInterface.call("onBabStateChange",s); } } } } \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/player_bab_ldt.swf Binary file assets/player_bab_ldt/player_bab_ldt.swf has changed diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/player_bab_ldt/DOMDocument.xml --- a/assets/player_bab_ldt/player_bab_ldt/DOMDocument.xml Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <__go_to_ctor_definition_help file="C:\devsrc\flashfarm\media_frameworks\branches\FLVPlayback_AS3_DVR\FLVPlayback\..\fl\video\FLVPlayback.as" pos="31557" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]]> - - - - - - - - - - - - - - - - - - - - - - - - -]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/player_bab_ldt/LIBRARY/Component Assets/ProgressBarSkins/ProgressBar_barSkin.xml --- a/assets/player_bab_ldt/player_bab_ldt/LIBRARY/Component Assets/ProgressBarSkins/ProgressBar_barSkin.xml Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/player_bab_ldt/LIBRARY/Component Assets/ProgressBarSkins/ProgressBar_indeterminateSkin.xml --- a/assets/player_bab_ldt/player_bab_ldt/LIBRARY/Component Assets/ProgressBarSkins/ProgressBar_indeterminateSkin.xml Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/player_bab_ldt/LIBRARY/Component Assets/ProgressBarSkins/ProgressBar_trackSkin.xml --- a/assets/player_bab_ldt/player_bab_ldt/LIBRARY/Component Assets/ProgressBarSkins/ProgressBar_trackSkin.xml Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/player_bab_ldt/LIBRARY/Component Assets/_private/Component_avatar.xml --- a/assets/player_bab_ldt/player_bab_ldt/LIBRARY/Component Assets/_private/Component_avatar.xml Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 353b0881a0b9 -r b1c3bf6eca78 assets/player_bab_ldt/player_bab_ldt/LIBRARY/ProgressBar.xml --- a/assets/player_bab_ldt/player_bab_ldt/LIBRARY/ProgressBar.xml Tue Oct 02 18:08:05 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,642 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Track Skin - - - - - - - - - - - - - Bar Skin - - - - - - - - - - - - - Indeterminate Pattern - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]]> - - - - - - - - - - - - - - - - - - - - - - - -]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -