From 8cc5831a7004aa1d5c74d29b5806491fafc27323 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 28 Jun 2013 22:27:04 +0000 Subject: media9 (7jun13) git-svn-id: svn://tug.org/texlive/trunk@31021 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/media9/ChangeLog | 9 ++ .../doc/latex/media9/files/players/APlayer.mxml | 93 +++++++++--------- .../doc/latex/media9/files/players/VPlayer.mxml | 28 +++--- Master/texmf-dist/doc/latex/media9/media9.pdf | Bin 2703923 -> 2751983 bytes Master/texmf-dist/doc/latex/media9/media9.tex | 21 ++--- Master/texmf-dist/tex/latex/media9/media9.sty | 104 +++++++++++++++------ .../tex/latex/media9/players/APlayer.swf | Bin 342345 -> 343550 bytes .../latex/media9/players/StrobeMediaPlayback.swf | Bin 275712 -> 275743 bytes .../tex/latex/media9/players/VPlayer.swf | Bin 453674 -> 501218 bytes 9 files changed, 152 insertions(+), 103 deletions(-) diff --git a/Master/texmf-dist/doc/latex/media9/ChangeLog b/Master/texmf-dist/doc/latex/media9/ChangeLog index c38154a7731..07751b993d9 100644 --- a/Master/texmf-dist/doc/latex/media9/ChangeLog +++ b/Master/texmf-dist/doc/latex/media9/ChangeLog @@ -1,3 +1,12 @@ +2013-06-06 + * fix: APlayer & VPlayer updated, all players recompiled using + ApacheFlexSDK-4.9.1 + +2013-06-03 + * v0.28 + * fix: updated APlayer.swf + * new: options `draft' and `final' for media bottons + 2013-03-27 * new: APlayer displays ID3 tags (artist, song, album), if available diff --git a/Master/texmf-dist/doc/latex/media9/files/players/APlayer.mxml b/Master/texmf-dist/doc/latex/media9/files/players/APlayer.mxml index 09783ab38af..1822f9b82be 100644 --- a/Master/texmf-dist/doc/latex/media9/files/players/APlayer.mxml +++ b/Master/texmf-dist/doc/latex/media9/files/players/APlayer.mxml @@ -1,16 +1,16 @@ - + - + - + - + @@ -19,7 +19,7 @@ - + @@ -40,7 +40,7 @@ xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" preinitialize="initialise(FlexGlobals.topLevelApplication.parameters);" - applicationComplete="initSound();addeventlisteners(); + applicationComplete="initSound();addEventListeners(); fadeTargets=new Array(playProgress, caption);" creationComplete="initCallBacks();" mouseDown="pause();setFocus();" @@ -60,6 +60,7 @@ [Bindable] private var txtAlign:String; private var snd:Sound; + private var id3:ID3Info; private var sndCh:SoundChannel; private var sndTr:SoundTransform; private var playResumePosition:Number = 0; @@ -83,31 +84,30 @@ } import mx.controls.Alert; + private function initSound():void { - snd = new Sound(new URLRequest(source)); + snd = new Sound(); id3=null; sndTr = new SoundTransform(vol, pan); - - snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); - snd.addEventListener(ProgressEvent.PROGRESS, progressHandler); - snd.addEventListener(Event.COMPLETE, completeHandler); - + snd.addEventListener(Event.ID3, onID3Info); + snd.addEventListener(IOErrorEvent.IO_ERROR, onError); + snd.addEventListener(ProgressEvent.PROGRESS, onProgress); + snd.addEventListener(Event.COMPLETE, onComplete); + snd.load(new URLRequest(source), new SoundLoaderContext(1000, true)); if(autoPlay) play(); } - import flash.events.MouseEvent; - private function mouseOvrHnd(e:MouseEvent):void { + private function onMouseOver(e:MouseEvent):void { mouseIsOver=true; fadeEffect.end(); playProgress.alpha=caption.alpha=1.0; } - private function mouseOutHnd(e:MouseEvent):void { + private function onMouseOut(e:MouseEvent):void { mouseIsOver=false; fadeEffect.play(); } - import flash.events.KeyboardEvent; - private function keyDnHnd(e:KeyboardEvent):void { + private function onKeyDown(e:KeyboardEvent):void { switch(e.keyCode) { case 32: //space bar playPause(); @@ -179,7 +179,7 @@ } } - private function keyUpHnd(e:KeyboardEvent):void { + private function onKeyUp(e:KeyboardEvent):void { switch(e.keyCode) { case 37: //<-- case 39: //--> @@ -195,50 +195,43 @@ var hrs:Number = Math.floor(s / 3600); var min:Number = Math.floor(s / 60 % 60); var sec:Number = Math.floor(s % 60); - var fmtd:String=''; - if(hrs>0) fmtd = String(hrs)+':'; - if(hrs>0 && min <10) fmtd+='0'; fmtd += String(min)+':'; - if(sec<10) fmtd+='0'; fmtd += String(sec); - - if(snd.id3.songName) - fmtd += ' '+ String.fromCharCode(0x2014) + ' ' + snd.id3.songName; - if(snd.id3.artist) fmtd += ' | ' + snd.id3.artist; - if(snd.id3.album) fmtd += ' | ' + snd.id3.album; - - if(snd.id3.songName || snd.id3.artist || snd.id3.album) - txtAlign="start"; - else - txtAlign="center"; - + txtAlign="center"; + try{ + if(id3.songName) + fmtd += ' '+ String.fromCharCode(0x2014) + ' ' + id3.songName; + if(id3.artist) fmtd += ' | ' + id3.artist; + if(id3.album) fmtd += ' | ' + id3.album; + if(id3) txtAlign="start"; + }catch(e:Object){} return fmtd; } - private function addeventlisteners():void { + private function addEventListeners():void { this.setFocus(); this.addEventListener(Event.ENTER_FRAME, onEnterFrame); - this.addEventListener(KeyboardEvent.KEY_DOWN, keyDnHnd); - this.addEventListener(KeyboardEvent.KEY_UP, keyUpHnd); - this.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHnd); - this.addEventListener(MouseEvent.MOUSE_OVER, mouseOvrHnd); + this.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); + this.addEventListener(KeyboardEvent.KEY_UP, onKeyUp); + this.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut); + this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver); } private function setSource(src:String):void { pause(); - snd = new Sound(new URLRequest(src)); - if(autoPlay) play(); + source=src; + initSound(); } private function play():void { if(playing) return; try{sndCh = snd.play(playResumePosition, 0, sndTr);} - catch(err:Error){Alert.show(err.message,'Error');} - sndCh.addEventListener(Event.SOUND_COMPLETE, sndCompleteHandler); + catch(e:Error){Alert.show(e.message,'Error');} + sndCh.addEventListener(Event.SOUND_COMPLETE, onSoundComplete); playing = true; } @@ -300,22 +293,21 @@ ExternalInterface.addCallback("setSource", setSource); } - private function sndCompleteHandler(event:Event):void { + private function onSoundComplete(e:Event):void { playing = false; playResumePosition = 0; if(loop) play(); } - private function completeHandler(event:Event):void { + private function onComplete(e:Event):void { playProgress.indeterminate=false; } - import flash.events.ProgressEvent; - private function progressHandler(event:ProgressEvent):void { + private function onProgress(e:ProgressEvent):void { playProgress.indeterminate=true; } - private function onEnterFrame(event:Event):void { + private function onEnterFrame(e:Event):void { if(!playProgress.indeterminate) { if(playing) { playProgress.setProgress(sndCh.position,snd.length); @@ -335,9 +327,10 @@ } } - import flash.events.IOErrorEvent; - private function errorHandler(errorEvent:IOErrorEvent):void { - Alert.show(errorEvent.text + '\ncould not be loaded','Error'); + private function onID3Info(e:Event):void {id3 = e.target.id3;} + + private function onError(e:ErrorEvent):void { + Alert.show(e.type, e.text); } ]]> diff --git a/Master/texmf-dist/doc/latex/media9/files/players/VPlayer.mxml b/Master/texmf-dist/doc/latex/media9/files/players/VPlayer.mxml index cc28466c8f2..6a18cd7f27c 100644 --- a/Master/texmf-dist/doc/latex/media9/files/players/VPlayer.mxml +++ b/Master/texmf-dist/doc/latex/media9/files/players/VPlayer.mxml @@ -1,16 +1,16 @@ - + - + - + - + @@ -19,7 +19,7 @@ - + @@ -67,22 +67,20 @@ if(flashVars.stepping){stepping=flashVars.stepping} } - import flash.events.ProgressEvent; - private function progressHandler(event:ProgressEvent):void { + private function onProgress(event:ProgressEvent):void { if (event.bytesTotal) event.target.visible=true; else event.target.visible=false; } import org.osmf.events.MediaPlayerStateChangeEvent; import mx.controls.Alert; - private function stateChangeHandler(event:MediaPlayerStateChangeEvent):void { + private function onStateChange(event:MediaPlayerStateChangeEvent):void { vidComplete=false; if(event.state=='playbackError') Alert.show('Unable to play \''+event.target.source+'\'','Error'); } - import flash.events.KeyboardEvent; - private function keyDnHnd(e:KeyboardEvent):void { + private function onKeyDown(e:KeyboardEvent):void { switch(e.keyCode) { case 32: //space bar playPause(); @@ -140,7 +138,7 @@ } } - private function keyUpHnd(e:KeyboardEvent):void { + private function onKeyUp(e:KeyboardEvent):void { switch(e.keyCode) { case 37: //<-- case 39: //--> @@ -227,8 +225,8 @@ ExternalInterface.addCallback("setSource", setSource); ExternalInterface.addCallback("stepping", step); this.setFocus(); - this.addEventListener(KeyboardEvent.KEY_DOWN, keyDnHnd); - this.addEventListener(KeyboardEvent.KEY_UP, keyUpHnd); + this.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); + this.addEventListener(KeyboardEvent.KEY_UP, onKeyUp); this.addEventListener(Event.ENTER_FRAME, onEnterFrame); } ]]> @@ -245,7 +243,7 @@ autoPlay="{autoPlay}" autoRewind="false" loop="{loop}" mouseDown="if(stepping){vidDisp.play();}else{vidDisp.pause();}this.setFocus();" mouseUp="if(vidComplete) vidDisp.seek(0);if(!stepping){vidDisp.play();}" - mediaPlayerStateChange="stateChangeHandler(event);" + mediaPlayerStateChange="onStateChange(event);" complete="vidComplete=true;" durationChange="if(vidDisp.autoPlay) vidDisp.play(); else vidDisp.seek(0);" /> @@ -254,7 +252,7 @@ horizontalCenter="0" bottom="0" labelPlacement="center" id="loadingProgress" alpha="0.5" complete="loadingProgress.visible=false;" - progress="progressHandler(event)" + progress="onProgress(event)" /> , depth= \end{verbatim} Resize the media playback area, overriding the original dimensions of the {\tt} argument. Option `\verb+depth+' specifies how far the playback area should extend below the base line of the running text. If only one of `\verb+width+' or `\verb+height+' is given, the other dimension is scaled to maintain the aspect ratio of \verb++. Any valid \TeX{} dimension is accepted as a parameter. In addition, the length commands \verb+\width+, \verb+\height+, \verb+\depth+ and \verb+\totalheight+ can be used to refer to the original dimensions of \verb++. - \begin{verbatim} label=