diff options
author | Karl Berry <karl@freefriends.org> | 2013-11-05 01:11:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-11-05 01:11:31 +0000 |
commit | cb8ce9e6e7ffe0c47a132f688e67b159355d82a2 (patch) | |
tree | e4cb84a07c948fa0b9d7103d032f3350073ad82f | |
parent | e622b0b85ef0c5d697b6a571ed79b6e6501f2f33 (diff) |
media9 (4nov13)
git-svn-id: svn://tug.org/texlive/trunk@32074 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/media9/ChangeLog | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/media9/files/players/APlayer.mxml | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/media9/files/players/APlayer9.mxml | 345 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/media9/files/players/VPlayer.mxml | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml | 253 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/media9/media9.pdf | bin | 2757065 -> 3185053 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/media9/media9.tex | 63 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/players/APlayer.swf | bin | 345881 -> 345869 bytes | |||
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/players/APlayer9.swf | bin | 0 -> 205580 bytes | |||
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/players/VPlayer.swf | bin | 502390 -> 502390 bytes | |||
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/players/VPlayer9.swf | bin | 0 -> 218886 bytes |
11 files changed, 667 insertions, 13 deletions
diff --git a/Master/texmf-dist/doc/latex/media9/ChangeLog b/Master/texmf-dist/doc/latex/media9/ChangeLog index 151ee765822..36850c2f4cd 100644 --- a/Master/texmf-dist/doc/latex/media9/ChangeLog +++ b/Master/texmf-dist/doc/latex/media9/ChangeLog @@ -1,3 +1,8 @@ +2013-11-01 + * new: Media player Flash components (VPlayer9.swf, APlayer9.swf) added + for compatibility with the Flash Player 9 plugin that is bundled with + Adobe Reader 9.4.1 for Linux) + 2013-09-24 * v0.33 * Fix: Adobe Reader prompting for "save changes" on closing 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 04336cba5f5..fad4deca9aa 100644 --- a/Master/texmf-dist/doc/latex/media9/files/players/APlayer.mxml +++ b/Master/texmf-dist/doc/latex/media9/files/players/APlayer.mxml @@ -4,7 +4,7 @@ <!-- a FlashPlayer-10 compatible component for playing --> <!-- MP3 audio files and streams. --> <!-- --> -<!-- version 20130611 --> +<!-- version 20131030 --> <!-- --> <!-- --> <!-- The free Apache Flex 4 SDK is required to compile --> @@ -78,11 +78,11 @@ private function initialise(flashVars:Object):void { source=flashVars.source; if(flashVars.policy) policy=flashVars.policy; - if(flashVars.autoPlay) autoPlay=(flashVars.autoPlay=='true'); - if(flashVars.loop) loop=(flashVars.loop=='true'); + if(flashVars.autoPlay=='true') autoPlay=true; + if(flashVars.loop=='true') loop=true; if(flashVars.volume) vol=Number(flashVars.volume); if(flashVars.balance) pan=Number(flashVars.balance); - if(flashVars.hideBar) hideBar=(flashVars.hideBar=='true'); + if(flashVars.hideBar=='true') hideBar=true; } import mx.controls.Alert; diff --git a/Master/texmf-dist/doc/latex/media9/files/players/APlayer9.mxml b/Master/texmf-dist/doc/latex/media9/files/players/APlayer9.mxml new file mode 100644 index 00000000000..7559b779679 --- /dev/null +++ b/Master/texmf-dist/doc/latex/media9/files/players/APlayer9.mxml @@ -0,0 +1,345 @@ +<?xml version="1.0"?> +<!-- --> +<!-- Adobe Flex 3 source file of APlayer9.swf, --> +<!-- a FlashPlayer-9 compatible component for playing --> +<!-- MP3 audio files and streams. --> +<!-- --> +<!-- version 20131030 --> +<!-- --> +<!-- Copyright (C) 2012-today Alexander Grahn --> +<!-- --> +<!-- This work may be distributed and/or modified under the --> +<!-- conditions of the LaTeX Project Public License, either --> +<!-- version 1.3 of this license or (at your option) any later --> +<!-- version. --> +<!-- --> +<!-- The latest version of this license is in --> +<!-- http://www.latex-project.org/lppl.txt --> +<!-- and version 1.3 or later is part of all distributions of --> +<!-- LaTeX version 2005/12/01 or later. --> +<!-- --> +<!-- This work has the LPPL maintenance status `maintained'. --> +<!-- --> +<!-- The current maintainer of this work is A. Grahn. --> +<!-- --> + +<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" + preinitialize="initialise(Application.application.parameters);" + applicationComplete="initSound();addEventListeners();" + creationComplete="initCallBacks();" + mouseDown="pause();setFocus();" + mouseUp="play();" + backgroundAlpha="0" + paddingTop="0" paddingBottom="0" + paddingLeft="0" paddingRight="0" + layout="absolute" clipContent="false" +> + + <mx:Script> + <![CDATA[ + [Bindable] private var source:String; + [Bindable] private var policy:String=null; + [Bindable] private var autoPlay:Boolean=false; + [Bindable] private var loop:Boolean=false; + [Bindable] private var vol:Number=0.75; + [Bindable] private var pan:Number=0; + [Bindable] private var hideBar:Boolean=false; + [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; + private var playing:Boolean = false; + private var muted:Boolean = false; + private var lastVol:Number; + + private var deltaSeek:Number; + private var currentTime:Number; + private var keyPressed:Boolean=false; + private var mouseIsOver:Boolean=false; + + import flash.external.*; + private function initialise(flashVars:Object):void { + source=flashVars.source; + if(flashVars.policy) policy=flashVars.policy; + if(flashVars.autoPlay=='true') autoPlay=true; + if(flashVars.loop=='true') loop=true; + if(flashVars.volume) vol=Number(flashVars.volume); + if(flashVars.balance) pan=Number(flashVars.balance); + if(flashVars.hideBar=='true') hideBar=true; + } + + import mx.controls.Alert; + + private function initSound():void { + snd = new Sound(); id3=null; + sndTr = new SoundTransform(vol, pan); + snd.addEventListener(Event.ID3, onID3Info); + snd.addEventListener(IOErrorEvent.IO_ERROR, onError); + snd.addEventListener(ProgressEvent.PROGRESS, onProgress); + snd.addEventListener(Event.COMPLETE, onComplete); + if(policy) Security.loadPolicyFile(policy); + snd.load(new URLRequest(source), new SoundLoaderContext(1000, true)); + if(autoPlay) play(); + } + + private function onMouseOver(e:MouseEvent):void { + mouseIsOver=true; + fadeEffect.end(); + playProgress.alpha=caption.alpha=1.0; + caption.visible=!hideBar; + } + + private function onMouseOut(e:MouseEvent):void { + mouseIsOver=false; + fadeEffect.play(); + } + + private function onKeyDown(e:KeyboardEvent):void { + switch(e.keyCode) { + case 32: //space bar + playPause(); + break; + case 36: //home + pause(); + playResumePosition=(0); + break; + case 35: //end + if(playProgress.indeterminate) break; + pause(); + playResumePosition=(snd.length); + break; + case 37: //<-- + fadeEffect.end(); + playProgress.alpha=caption.alpha=1.0; + caption.visible=!hideBar; + if(e.ctrlKey){ + pan=Math.max(-1,pan-0.025); + balance(pan); + break; + } + if(!keyPressed){ + deltaSeek=Math.max(100,snd.length/10000); + if(playing) + currentTime=sndCh.position; + else + currentTime=playResumePosition; + } + keyPressed=true; + playResumePosition=Math.max(0,currentTime-deltaSeek); + if(playing) seek(playResumePosition/1000); + deltaSeek*=1.1; + break; + case 39: //--> + fadeEffect.end(); + playProgress.alpha=caption.alpha=1.0; + caption.visible=!hideBar; + if(e.ctrlKey){ + pan=Math.min(1,pan+0.025); + balance(pan); + break; + } + if(!keyPressed){ + deltaSeek=Math.max(100,snd.length/10000); + if(playing) + currentTime=sndCh.position; + else + currentTime=playResumePosition; + } + keyPressed=true; + playResumePosition=Math.min(snd.length-10,currentTime+deltaSeek); + seek(playResumePosition/1000); + deltaSeek*=1.1; + break; + case 38: + vol=Math.min(1,vol+0.025); + volume(vol); + break; + case 40: + if(e.ctrlKey){ + pan=0; + balance(pan); + break; + } + vol=Math.max(0,vol-0.025); + volume(vol); + break; + default: + if(e.charCode==109) mute(); //`m' + } + } + + private function onKeyUp(e:KeyboardEvent):void { + switch(e.keyCode) { + case 37: //<-- + case 39: //--> + deltaSeek=Math.max(100,snd.length/10000); + keyPressed=false; + if (!mouseIsOver) fadeEffect.play(); + break; + } + } + + private function formatLabel(s:Number):String { + s/=1000; + 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); + 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 { + this.setFocus(); + this.addEventListener(Event.ENTER_FRAME, onEnterFrame); + 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(s:String):void { + pause(); + source=s; + initSound(); + } + + private function loadPolicy(p:String):void {policy=p;} + + private function play():void { + if(playing) return; + try{sndCh = snd.play(playResumePosition, 0, sndTr);} + catch(e:Error){Alert.show(e.message,'Error');} + sndCh.addEventListener(Event.SOUND_COMPLETE, onSoundComplete); + playing = true; + } + + private function pause():void { + if(!playing) return; + playResumePosition = sndCh.position; + sndCh.stop(); + playing = false; + } + + private function playPause():void { + if(playing) pause(); else play(); + } + + private function seek(p:Number):void { + playResumePosition = p*1000; + if(!playing) return; + sndCh.stop(); + playing = false; + play(); + } + + private function rewind():void { + seek(0); + } + + private function volume(v:Number):void { + sndTr.volume = v; + sndCh.soundTransform=sndTr; + } + + private function mute():void { + if(muted) { + if(lastVol==0) lastVol=0.75; + volume(lastVol); + muted=false; + } + else { + lastVol = sndTr.volume + volume(0); + muted=true; + } + } + + private function balance(p:Number):void { + sndTr.pan = p; + sndCh.soundTransform=sndTr; + } + + private function initCallBacks():void { + ExternalInterface.addCallback("play", play); + ExternalInterface.addCallback("pause", pause); + ExternalInterface.addCallback("playPause", playPause); + ExternalInterface.addCallback("seek", seek); + ExternalInterface.addCallback("rewind", rewind); + ExternalInterface.addCallback("volume", volume); + ExternalInterface.addCallback("balance", balance); + ExternalInterface.addCallback("mute", mute); + ExternalInterface.addCallback("setSource", setSource); + ExternalInterface.addCallback("loadPolicy", loadPolicy); + } + + private function onSoundComplete(e:Event):void { + playing = false; + playResumePosition = 0; + if(loop) play(); + } + + private function onComplete(e:Event):void { + playProgress.indeterminate=false; + } + + private function onProgress(e:ProgressEvent):void { + playProgress.indeterminate=true; + } + + private function onEnterFrame(e:Event):void { + if(!playProgress.indeterminate) { + if(playing) { + playProgress.setProgress(sndCh.position,snd.length); + caption.text=formatLabel(sndCh.position); + } else { + playProgress.setProgress(playResumePosition,snd.length); + caption.text=formatLabel(playResumePosition); + } + }else{ + if(playing) { + playProgress.setProgress(Math.random(),1); + caption.text=formatLabel(sndCh.position); + } else { + playProgress.setProgress(snd.bytesLoaded,snd.bytesTotal); + caption.text=formatLabel(playResumePosition); + } + } + } + + private function onID3Info(e:Event):void {id3 = e.target.id3;} + + private function onError(e:ErrorEvent):void { + Alert.show(e.type, e.text); + } + ]]> + </mx:Script> + + <mx:Fade id="fadeEffect" target="{playProgress}" alphaFrom="1.0" alphaTo="0" + effectEnd="caption.visible=false" duration="2000"/> + + <mx:ProgressBar width="100%" height="100%" mode="manual" + labelPlacement="center" label="" id="playProgress" + visible="{!hideBar}" + /> + + <mx:Label id="caption" width="100%" verticalCenter="0" + paddingTop="2" fontWeight="bold" visible="{!hideBar}" + textAlign="{txtAlign}" paddingLeft="5" + /> +</mx:Application> 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 2919fa4857c..a5ee8eddbda 100644 --- a/Master/texmf-dist/doc/latex/media9/files/players/VPlayer.mxml +++ b/Master/texmf-dist/doc/latex/media9/files/players/VPlayer.mxml @@ -4,7 +4,7 @@ <!-- a FlashPlayer-10 compatible component for playing --> <!-- FLV and MP4/H.264 video files and streams. --> <!-- --> -<!-- version 20130607 --> +<!-- version 20131030 --> <!-- --> <!-- --> <!-- The free Apache Flex 4 SDK is required to compile --> @@ -60,8 +60,8 @@ import mx.core.FlexGlobals; private function initialise(flashVars:Object):void { source=flashVars.source; - if(flashVars.autoPlay){autoPlay=(flashVars.autoPlay=='true')} - if(flashVars.loop){loop=(flashVars.loop=='true')} + if(flashVars.autoPlay=='true'){autoPlay=true} + if(flashVars.loop=='true'){loop=true} if(flashVars.volume){vol=Number(flashVars.volume)} if(flashVars.scaleMode){scaleMode=flashVars.scaleMode} if(flashVars.stepping){stepping=flashVars.stepping} diff --git a/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml b/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml new file mode 100644 index 00000000000..55a901e6c50 --- /dev/null +++ b/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml @@ -0,0 +1,253 @@ +<?xml version="1.0"?> +<!-- --> +<!-- Adobe Flex 3 source file of VPlayer9.swf, --> +<!-- a FlashPlayer-9 compatible component for playing --> +<!-- FLV and MP4/H.264 video files and streams. --> +<!-- --> +<!-- version 20131030 --> +<!-- --> +<!-- Copyright (C) 2012-today Alexander Grahn --> +<!-- --> +<!-- This work may be distributed and/or modified under the --> +<!-- conditions of the LaTeX Project Public License, either --> +<!-- version 1.3 of this license or (at your option) any later --> +<!-- version. --> +<!-- --> +<!-- The latest version of this license is in --> +<!-- http://www.latex-project.org/lppl.txt --> +<!-- and version 1.3 or later is part of all distributions of --> +<!-- LaTeX version 2005/12/01 or later. --> +<!-- --> +<!-- This work has the LPPL maintenance status `maintained'. --> +<!-- --> +<!-- The current maintainer of this work is A. Grahn. --> +<!-- --> + +<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" + preinitialize="initialise(Application.application.parameters);" + creationComplete="init();" + backgroundAlpha="0" + paddingTop="0" paddingBottom="0" + paddingLeft="0" paddingRight="0" + layout="absolute" clipContent="false" +> + <mx:Script> + <![CDATA[ + [Bindable] private var source:String; + [Bindable] private var autoPlay:Boolean=false; + [Bindable] private var loop:Boolean=false; + [Bindable] private var vol:Number=0.75; + [Bindable] private var stepping:Boolean=false; + [Bindable] private var letterbox:Boolean=false; + private var vidComplete:Boolean=false; + private var deltaSeek:Number; + private var playheadTime:Number; + private var newPos:Number; + private var keyPressed:Boolean=false; + private var muted:Boolean=false; + private var lastVolume:Number; + + import flash.external.*; + private function initialise(flashVars:Object):void { + source=flashVars.source; + if(flashVars.autoPlay=='true'){autoPlay=true} + if(flashVars.loop=='true'){loop=true} + if(flashVars.volume){vol=Number(flashVars.volume)} + if(flashVars.stepping){stepping=flashVars.stepping} + if(flashVars.scaleMode=='letterbox'){letterbox=true} + } + + private function onProgress(event:ProgressEvent):void { + if (event.bytesTotal) event.target.visible=true; + else event.target.visible=false; + } + + import mx.events.VideoEvent; + import mx.controls.Alert; + private function onStateChange(event:VideoEvent):void { + vidComplete=false; + if(event.state=='connectionError') + Alert.show('Unable to play \''+event.target.source+'\'','Error'); + } + + private function onKeyDown(e:KeyboardEvent):void { + switch(e.keyCode) { + case 32: //space bar + playPause(); + break; + case 36: //home + vidDisp.pause(); + vidDisp.playheadTime=0; + break; + case 35: //end + if(vidDisp.bytesTotal){ + vidDisp.pause(); + vidDisp.playheadTime=vidDisp.totalTime-0.1; + } + break; + case 37: //<-- + fadeEffect.end(); + playProgress.alpha=0.5; + playProgress.visible=true; + if(!keyPressed){ + deltaSeek=Math.max(1,vidDisp.totalTime/1000); + playheadTime=vidDisp.playheadTime; + } + keyPressed=true; + newPos=Math.max(0,playheadTime-deltaSeek); + playProgress.setProgress(newPos,vidDisp.totalTime); + playProgress.label=formatTime(newPos); + vidDisp.playheadTime=newPos; + deltaSeek*=1.1; + break; + case 39: //--> + fadeEffect.end(); + playProgress.alpha=0.5; + playProgress.visible=true; + if(!keyPressed){ + deltaSeek=Math.max(1,vidDisp.totalTime/1000); + playheadTime=vidDisp.playheadTime; + } + keyPressed=true; + newPos=Math.min(vidDisp.totalTime-0.1,playheadTime+deltaSeek); + playProgress.setProgress(newPos,vidDisp.totalTime); + playProgress.label=formatTime(newPos); + vidDisp.playheadTime=newPos; + deltaSeek*=1.1; + break; + case 38: + vol=Math.min(1,vol+0.025); + volume(vol); + break; + case 40: + vol=Math.max(0,vol-0.025); + volume(vol); + break; + default: + if(e.charCode==109) mute(); //`m' + } + } + + private function onKeyUp(e:KeyboardEvent):void { + switch(e.keyCode) { + case 37: //<-- + case 39: //--> + deltaSeek=Math.max(1,vidDisp.totalTime/1000); + keyPressed=false; + fadeEffect.play(); + break; + } + } + + private function onEnterFrame(e:Event):void { + if(stepping&&vidDisp.playing){vidDisp.pause();} + } + + private function play():void { + if(vidComplete){vidDisp.playheadTime=0;}vidDisp.play(); + } + + private function pause():void { + vidDisp.pause(); + } + + private function playPause():void { + if(vidDisp.playing) vidDisp.pause(); else vidDisp.play(); + } + + private function seek(p:Number):void { + vidDisp.playheadTime=p; + } + + private function step():void { + if(stepping){stepping=false;}else{stepping=true;} + } + + private function rewind():void { + vidDisp.playheadTime=0; + } + + private function volume(v:Number):void { + muted=false; + vidDisp.volume = v; + } + + private function mute():void { + if(muted) { + if (lastVolume==0) volume(0.75); + else volume(lastVolume); + } + else { + muted=true;lastVolume=vidDisp.volume;vidDisp.volume=0; + } + } + + private function setSource(s:String):void { + vidDisp.source = s; + } + + private function formatTime(s:Number):String { + 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); + + return fmtd; + } + + private function init():void { + this.setFocus(); + this.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); + this.addEventListener(KeyboardEvent.KEY_UP, onKeyUp); + this.addEventListener(Event.ENTER_FRAME, onEnterFrame); + ExternalInterface.addCallback("play", play); + ExternalInterface.addCallback("pause", pause); + ExternalInterface.addCallback("playPause", playPause); + ExternalInterface.addCallback("seek", seek); + ExternalInterface.addCallback("rewind", rewind); + ExternalInterface.addCallback("volume", volume); + ExternalInterface.addCallback("mute", mute); + ExternalInterface.addCallback("setSource", setSource); + ExternalInterface.addCallback("stepping", step); + } + ]]> + </mx:Script> + + <mx:Fade id="fadeEffect" target="{playProgress}" alphaFrom="0.5" alphaTo="0" duration="2000" + effectEnd="playProgress.label=''"/> + + <mx:VideoDisplay + id="vidDisp" + width="100%" height="100%" maintainAspectRatio="{letterbox}" + backgroundAlpha="0" borderThickness="0" + source="{source}" volume="{vol}" + autoPlay="{autoPlay}" autoRewind="{loop}" + mouseDown="if(stepping){vidDisp.play();}else{vidDisp.pause();}this.setFocus();" + mouseUp="if(vidComplete) vidDisp.playheadTime=0;if(!stepping){vidDisp.play();}" + stateChange="onStateChange(event);" + complete="vidComplete=true;" + rewind="vidDisp.play();" + /> + + <mx:ProgressBar width="100%" mode="polled" source="vidDisp" + horizontalCenter="0" bottom="0" labelPlacement="center" + id="loadingProgress" alpha="0.5" + complete="loadingProgress.visible=false;" + progress="onProgress(event)" + /> + + <mx:ProgressBar width="100%" mode="manual" + horizontalCenter="0" bottom="0" labelPlacement="center" + id="playProgress" alpha="0.5" + visible="false" + /> +</mx:Application> diff --git a/Master/texmf-dist/doc/latex/media9/media9.pdf b/Master/texmf-dist/doc/latex/media9/media9.pdf Binary files differindex 989721e57d3..c8ac87e4d05 100644 --- a/Master/texmf-dist/doc/latex/media9/media9.pdf +++ b/Master/texmf-dist/doc/latex/media9/media9.pdf diff --git a/Master/texmf-dist/doc/latex/media9/media9.tex b/Master/texmf-dist/doc/latex/media9/media9.tex index 06a95592adf..c4e999d836f 100644 --- a/Master/texmf-dist/doc/latex/media9/media9.tex +++ b/Master/texmf-dist/doc/latex/media9/media9.tex @@ -92,21 +92,21 @@ This package provides an interface to embed, in the first place, interactive Fla Among the supported media types, video and sound files require an additional Flash (SWF) application for playback, which must be either embedded into the PDF or loaded at runtime from the internet. There are numerous such players, both open-source and commercial, available on the internet. One of them is the highly configurable open-source `StrobeMediaPlayback.swf'~\cite{strobe}, maintained by Adobe and hosted on \href{http://sourceforge.net/projects/osmf.adobe/files/}{SourceForge.net}. Package `media9' comes with an enhanced version of `StrobeMediaPlayback.swf'. In addition, two simple players for video and audio, `VPlayer.swf' and `APlayer.swf' are included, which can be used instead. They provide sufficient functionality for playing embedded files and streamed media. -Flash Player supports the efficient H.264 codec for video compression. MP4/H.264 video files can be encoded from existing video files and from numbered bitmap sequences using the \verb+ffmpeg+ command line tool (\url{http://ffmpeg.org}). In order to allow for precise seeking within video files it is necessary to encode them with a sufficient number of key frames. The command line for recoding an existing video file \verb+video.avi+ into \verb+video.mp4+ reads +Flash Player supports the efficient H.264 codec for video compression. MP4/H.264 video files can be encoded from existing video files and from numbered bitmap sequences using the \verb+ffmpeg+ (\url{http://ffmpeg.org}) or \verb+avconv+ (\url{http://libav.org}) command line tools (Libav is a fork from the FFmpeg code). In order to allow for precise seeking within video files it is necessary to encode them with a sufficient number of key frames. The command line for recoding an existing video file \verb+video.avi+ into \verb+video.mp4+ reads (\verb+ffmpeg+ can be substituted with \verb+avconv+) \begin{Verbatim} - ffmpeg -i video.avi -vcodec libx264 -x264opts keyint=30 -r 30 video.mp4 + ffmpeg -i video.avi -c:v libx264 -g 30 -r 30 video.mp4 \end{Verbatim} From a sequence \verb+frame-0.png+, \verb+frame-1.png+, ... of bitmap files, an MP4 video is produced by \begin{Verbatim} - ffmpeg -i frame-%d.png -vcodec libx264 -x264opts keyint=30 -r 30 video.mp4 + ffmpeg -i frame-%d.png -c:v libx264 -g 30 -r 30 video.mp4 \end{Verbatim} -Both examples insert a key frame at every second since the frame rate is set to 30 fps. +Both examples insert a key frame (option `\verb+-g+') at every second since the frame rate is set to 30 fps. \emph{Note:} `media9' package replaces the now obsolete `movie15' package. `media9' is based on the RichMedia Annotation (Annotations are the interactive elements in a document, in PDF specification parlance.), an Adobe addition to the PDF specification~\cite{supplement}, while `movie15' uses the old multimedia framework (`Screen Annotation') of pre-9 Readers which depends on third-party plug-ins and which does not support recent media file formats. Package `media9' supports the usual PDF making workflows, i.\,e. pdf\LaTeX{}, Lua\LaTeX, \LaTeX{} $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+/Distiller and \pXepLaTeX{} $\rightarrow$ \verb+(x)dvipdfmx+. -The final PDF can be viewed in current Adobe Readers on MS Windows and other platforms. On Unix platforms including Linux, however, support of Flash, video and sound was discontinued at Reader version 9.4.2, probably for security reasons. On tablets and phones running Android or iOS, ezPDF Reader was reported to play video and sound files embedded with `media9'. +The final PDF can be viewed in current Adobe Readers on MS Windows and other platforms. On Unix platforms including Linux, however, support of Flash, video and sound was discontinued at Reader version 9.4.2, probably for security reasons. PDF documents which target \href{ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.4.1/}{Adobe Reader 9.4.1 for Linux} should use `VPlayer9.swf' and `APlayer9.swf' (also included in the `media9' package). These media player components are compatible with the older Flash Player 9 plugin that is bundled with the Reader for Linux. On tablets and phones running Android or iOS, ezPDF Reader was reported to play video and sound files embedded with `media9'. \section{Requirements} \begin{trivlist} @@ -117,7 +117,7 @@ The final PDF can be viewed in current Adobe Readers on MS Windows and other pla \item pdf\TeX{}, version $\ge1.30$ \item Ghostscript, version $\ge8.31$ or Adobe Distiller for PS to PDF conversion \item dvipdfmx, version $\ge 20120420$ for DVI to PDF conversion -\item Adobe Reader, version $\ge9$ +\item Adobe Reader, version $\ge9$, but not greater than 9.4.1 on Linux \end{trivlist} \section{Installation} @@ -766,6 +766,57 @@ http://mirrors.ibiblio.org/pub/mirrors/CTAN/macros/latex/contrib/media9/players/ \caption{Example of (a) embedded sound file, (b) streamed audio and (c) progressively downloaded MP3. ID3 tags `title', `artist' and `album' are displayed if contained in the MP3 stream or file. In (b), the sound player, APlayer.swf, is loaded from a CTAN mirror upon activation.}\label{radio} \end{figure} +\begin{figure}[bp] +\centering +\begin{Verbatim} +\includemedia[ + width=0.4\linewidth,height=0.3\linewidth, + activate=pageopen, + addresource=cube.mp4, + transparent, + flashvars={ + source=cube.mp4 + &loop=true + &scaleMode=letterbox + } +]{}{VPlayer9.swf} +\end{Verbatim} +\vspace{1ex} +\hfill\includemedia[ + width=0.6\linewidth,height=0.45\linewidth, + activate=pageopen, + addresource=cube.mp4, + transparent, + flashvars={ + source=cube.mp4 + &loop=true + &scaleMode=letterbox + } +]{}{VPlayer9.swf}\hfill +\vspace{1ex} +\begin{Verbatim} + \includemedia[ + addresource=bird.mp3, + flashvars={ + source=bird.mp3 + &autoPlay=true + }, + transparent + ]{\color{blue}\framebox[0.4\linewidth][c]{Singing bird}}{APlayer9.swf} +\end{Verbatim} +\vspace{1ex} +\hfill\includemedia[ + addresource=bird.mp3, + flashvars={ + source=bird.mp3 + &autoPlay=true + }, + transparent +]{\color{blue}\framebox[0.5\linewidth][c]{Singing bird}}{APlayer9.swf}\hfill +\vspace{2ex} +\caption{Video and sound examples that should run in Adobe Reader for Linux up to version \href{ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.4.1/}{9.4.1}. Here, players `VPlayer9.swf' and `APlayer9.swf' are used. Both are compatible with Adobe Flash Player 9 plugin that is bundled with the Reader.}\label{ar941ex} +\end{figure} + \clearpage \section[Embedding 3D objects (with examples)]{Embedding 3D objects} \subsection{Introduction}\label{sec:3Dintro} diff --git a/Master/texmf-dist/tex/latex/media9/players/APlayer.swf b/Master/texmf-dist/tex/latex/media9/players/APlayer.swf Binary files differindex 677e6a95f58..3df6c471097 100644 --- a/Master/texmf-dist/tex/latex/media9/players/APlayer.swf +++ b/Master/texmf-dist/tex/latex/media9/players/APlayer.swf diff --git a/Master/texmf-dist/tex/latex/media9/players/APlayer9.swf b/Master/texmf-dist/tex/latex/media9/players/APlayer9.swf Binary files differnew file mode 100644 index 00000000000..fd7689f2935 --- /dev/null +++ b/Master/texmf-dist/tex/latex/media9/players/APlayer9.swf diff --git a/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf b/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf Binary files differindex 9cc2bc1ba75..4e7805e7a20 100644 --- a/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf +++ b/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf diff --git a/Master/texmf-dist/tex/latex/media9/players/VPlayer9.swf b/Master/texmf-dist/tex/latex/media9/players/VPlayer9.swf Binary files differnew file mode 100644 index 00000000000..cc479184835 --- /dev/null +++ b/Master/texmf-dist/tex/latex/media9/players/VPlayer9.swf |