summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-06-27 22:03:47 +0000
committerKarl Berry <karl@freefriends.org>2014-06-27 22:03:47 +0000
commit502b3247f7162d722b01b5f0cb89f6c27c12256d (patch)
tree9802be30691b917dfecdcb960443861bad2053ce /Master
parent0ae0c71bf90569f76d7ea67432cee361f79e7593 (diff)
media9 (27jun14)
git-svn-id: svn://tug.org/texlive/trunk@34456 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/media9/ChangeLog9
-rw-r--r--Master/texmf-dist/doc/latex/media9/files/players/APlayer.mxml54
-rw-r--r--Master/texmf-dist/doc/latex/media9/files/players/APlayer9.mxml104
-rw-r--r--Master/texmf-dist/doc/latex/media9/files/players/VPlayer.mxml28
-rw-r--r--Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml46
-rw-r--r--Master/texmf-dist/doc/latex/media9/media9.pdfbin3323616 -> 3326799 bytes
-rw-r--r--Master/texmf-dist/doc/latex/media9/media9.tex64
-rw-r--r--Master/texmf-dist/tex/latex/media9/media9.sty318
-rw-r--r--Master/texmf-dist/tex/latex/media9/players/APlayer.swfbin352533 -> 351961 bytes
-rw-r--r--Master/texmf-dist/tex/latex/media9/players/APlayer9.swfbin205585 -> 205983 bytes
-rw-r--r--Master/texmf-dist/tex/latex/media9/players/VPlayer.swfbin509312 -> 509501 bytes
-rw-r--r--Master/texmf-dist/tex/latex/media9/players/VPlayer9.swfbin218899 -> 219253 bytes
12 files changed, 410 insertions, 213 deletions
diff --git a/Master/texmf-dist/doc/latex/media9/ChangeLog b/Master/texmf-dist/doc/latex/media9/ChangeLog
index 824633d925d..814c551f827 100644
--- a/Master/texmf-dist/doc/latex/media9/ChangeLog
+++ b/Master/texmf-dist/doc/latex/media9/ChangeLog
@@ -1,3 +1,12 @@
+2014-06-25
+ * v0.45
+ * fix: transparency in media button faces drawn with TikZ/PGF didn't work when
+ using the dvipdfmx/xetex driver
+ * new: [AV]Player ActionScript methods `play' and `pause' take optional time
+ offsets, allowing for playing portions of the media file
+ * Change: `depth' option deprecated and ignored if used, added `totalheight'
+ and `keepaspectratio' options
+
2014-06-04
* v0.44
* fix: prevent the play button from being printed to paper or exported to
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 78503bc4695..30ae5de9229 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 20140211 -->
+<!-- version 20140625 -->
<!-- -->
<!-- -->
<!-- The free Apache Flex 4 SDK is required to compile -->
@@ -64,7 +64,9 @@
private var id3:ID3Info;
private var sndCh:SoundChannel;
private var sndTr:SoundTransform;
- private var playResumePosition:Number = 0;
+ private var playResumePos:Number = 0;
+ private var pauseAtPos:Number = -1;
+ private var toBePaused:Boolean = false;
private var plyng:Boolean = false;
private var muted:Boolean = false;
private var lastVol:Number;
@@ -117,12 +119,12 @@
break;
case 36: //home
pause();
- playResumePosition=(0);
+ playResumePos=(0);
break;
case 35: //end
if(playProgress.indeterminate) break;
pause();
- playResumePosition=(snd.length);
+ playResumePos=(snd.length);
break;
case 37: //<--
fadeEffect.end();
@@ -137,11 +139,11 @@
if(plyng)
curTime=sndCh.position;
else
- curTime=playResumePosition;
+ curTime=playResumePos;
}
keyPressed=true;
- playResumePosition=Math.max(0,curTime-deltaSeek);
- if(plyng) seek(playResumePosition/1000);
+ playResumePos=Math.max(0,curTime-deltaSeek);
+ if(plyng) seek(playResumePos/1000);
deltaSeek*=1.1;
break;
case 39: //-->
@@ -157,11 +159,11 @@
if(plyng)
curTime=sndCh.position;
else
- curTime=playResumePosition;
+ curTime=playResumePos;
}
keyPressed=true;
- playResumePosition=Math.min(snd.length-10,curTime+deltaSeek);
- seek(playResumePosition/1000);
+ playResumePos=Math.min(snd.length-10,curTime+deltaSeek);
+ seek(playResumePos/1000);
deltaSeek*=1.1;
break;
case 38:
@@ -233,17 +235,19 @@
private function loadPolicy(p:String):void {policy=p;}
- private function play():void {
+ private function play(p:Number=-1):void {
+ if(p>=0) seek(p);
if(plyng) return;
- try{sndCh = snd.play(playResumePosition, 0, sndTr);}
+ try{sndCh = snd.play(playResumePos, 0, sndTr);}
catch(e:Error){Alert.show(e.message,'Error');}
sndCh.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
plyng = true;
}
- private function pause():void {
+ private function pause(p:Number=-1):void {
+ if(p>=0){pauseAtPos=p*1000;return;}
if(!plyng) return;
- playResumePosition = sndCh.position;
+ playResumePos = sndCh.position;
sndCh.stop();
plyng = false;
}
@@ -253,7 +257,7 @@
}
private function seek(p:Number):void {
- playResumePosition = p*1000;
+ playResumePos = p*1000;
if(!plyng) return;
sndCh.stop();
plyng = false;
@@ -288,7 +292,7 @@
}
private function currentTime():Number {
- return sndCh.position/1000;
+ return sndCh.position/1000;
}
private function playing():Boolean {
@@ -322,7 +326,7 @@
private function onSoundComplete(e:Event):void {
plyng = false;
- playResumePosition = 0;
+ playResumePos = 0;
if(loop) play();
}
@@ -340,8 +344,8 @@
playProgress.setProgress(sndCh.position,snd.length);
caption.text=formatLabel(sndCh.position);
} else {
- playProgress.setProgress(playResumePosition,snd.length);
- caption.text=formatLabel(playResumePosition);
+ playProgress.setProgress(playResumePos,snd.length);
+ caption.text=formatLabel(playResumePos);
}
}else{
if(plyng) {
@@ -349,9 +353,19 @@
caption.text=formatLabel(sndCh.position);
} else {
playProgress.setProgress(snd.bytesLoaded,snd.bytesTotal);
- caption.text=formatLabel(playResumePosition);
+ caption.text=formatLabel(playResumePos);
}
}
+ if(plyng&&pauseAtPos>=0&&sndCh.position<pauseAtPos)
+ toBePaused=true;
+ if(
+ plyng&&pauseAtPos>=0&&
+ sndCh.position>=pauseAtPos&&toBePaused
+ ){
+ pause();
+ pauseAtPos=-1;
+ toBePaused=false;
+ }
}
private function onID3Info(e:Event):void {id3 = e.target.id3;}
diff --git a/Master/texmf-dist/doc/latex/media9/files/players/APlayer9.mxml b/Master/texmf-dist/doc/latex/media9/files/players/APlayer9.mxml
index 35a154ae3fc..1a80f98c921 100644
--- a/Master/texmf-dist/doc/latex/media9/files/players/APlayer9.mxml
+++ b/Master/texmf-dist/doc/latex/media9/files/players/APlayer9.mxml
@@ -4,7 +4,7 @@
<!-- a FlashPlayer-9 compatible component for playing -->
<!-- MP3 audio files and streams. -->
<!-- -->
-<!-- version 20131114 -->
+<!-- version 20140625 -->
<!-- -->
<!-- Copyright (C) 2012-today Alexander Grahn -->
<!-- -->
@@ -50,13 +50,15 @@
private var id3:ID3Info;
private var sndCh:SoundChannel;
private var sndTr:SoundTransform;
- private var playResumePosition:Number = 0;
- private var playing:Boolean = false;
+ private var playResumePos:Number = 0;
+ private var pauseAtPos:Number = -1;
+ private var toBePaused:Boolean = false;
+ private var plyng:Boolean = false;
private var muted:Boolean = false;
private var lastVol:Number;
private var deltaSeek:Number;
- private var currentTime:Number;
+ private var curTime:Number;
private var keyPressed:Boolean=false;
private var mouseIsOver:Boolean=false;
@@ -104,12 +106,12 @@
break;
case 36: //home
pause();
- playResumePosition=(0);
+ playResumePos=(0);
break;
case 35: //end
if(playProgress.indeterminate) break;
pause();
- playResumePosition=(snd.length);
+ playResumePos=(snd.length);
break;
case 37: //<--
fadeEffect.end();
@@ -122,14 +124,14 @@
}
if(!keyPressed){
deltaSeek=Math.max(100,snd.length/10000);
- if(playing)
- currentTime=sndCh.position;
+ if(plyng)
+ curTime=sndCh.position;
else
- currentTime=playResumePosition;
+ curTime=playResumePos;
}
keyPressed=true;
- playResumePosition=Math.max(0,currentTime-deltaSeek);
- if(playing) seek(playResumePosition/1000);
+ playResumePos=Math.max(0,curTime-deltaSeek);
+ if(plyng) seek(playResumePos/1000);
deltaSeek*=1.1;
break;
case 39: //-->
@@ -143,14 +145,14 @@
}
if(!keyPressed){
deltaSeek=Math.max(100,snd.length/10000);
- if(playing)
- currentTime=sndCh.position;
+ if(plyng)
+ curTime=sndCh.position;
else
- currentTime=playResumePosition;
+ curTime=playResumePos;
}
keyPressed=true;
- playResumePosition=Math.min(snd.length-10,currentTime+deltaSeek);
- seek(playResumePosition/1000);
+ playResumePos=Math.min(snd.length-10,curTime+deltaSeek);
+ seek(playResumePos/1000);
deltaSeek*=1.1;
break;
case 38:
@@ -222,30 +224,32 @@
private function loadPolicy(p:String):void {policy=p;}
- private function play():void {
- if(playing) return;
- try{sndCh = snd.play(playResumePosition, 0, sndTr);}
+ private function play(p:Number=-1):void {
+ if(p>=0) seek(p);
+ if(plyng) return;
+ try{sndCh = snd.play(playResumePos, 0, sndTr);}
catch(e:Error){Alert.show(e.message,'Error');}
sndCh.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
- playing = true;
+ plyng = true;
}
- private function pause():void {
- if(!playing) return;
- playResumePosition = sndCh.position;
+ private function pause(p:Number=-1):void {
+ if(p>=0){pauseAtPos=p*1000;return;}
+ if(!plyng) return;
+ playResumePos = sndCh.position;
sndCh.stop();
- playing = false;
+ plyng = false;
}
private function playPause():void {
- if(playing) pause(); else play();
+ if(plyng) pause(); else play();
}
private function seek(p:Number):void {
- playResumePosition = p*1000;
- if(!playing) return;
+ playResumePos = p*1000;
+ if(!plyng) return;
sndCh.stop();
- playing = false;
+ plyng = false;
play();
}
@@ -276,6 +280,22 @@
sndCh.soundTransform=sndTr;
}
+ private function currentTime():Number {
+ return sndCh.position/1000;
+ }
+
+ private function playing():Boolean {
+ return plyng;
+ }
+
+ private function duration():Number {
+ return snd.length/1000;
+ }
+
+ private function ismuted():Boolean {
+ return muted;
+ }
+
private function initCallBacks():void {
ExternalInterface.addCallback("play", play);
ExternalInterface.addCallback("pause", pause);
@@ -287,11 +307,15 @@
ExternalInterface.addCallback("mute", mute);
ExternalInterface.addCallback("setSource", setSource);
ExternalInterface.addCallback("loadPolicy", loadPolicy);
+ ExternalInterface.addCallback("currentTime", currentTime);
+ ExternalInterface.addCallback("duration", duration);
+ ExternalInterface.addCallback("playing", playing);
+ ExternalInterface.addCallback("muted", ismuted);
}
private function onSoundComplete(e:Event):void {
- playing = false;
- playResumePosition = 0;
+ plyng = false;
+ playResumePos = 0;
if(loop) play();
}
@@ -305,22 +329,32 @@
private function onEnterFrame(e:Event):void {
if(!playProgress.indeterminate) {
- if(playing) {
+ if(plyng) {
playProgress.setProgress(sndCh.position,snd.length);
caption.text=formatLabel(sndCh.position);
} else {
- playProgress.setProgress(playResumePosition,snd.length);
- caption.text=formatLabel(playResumePosition);
+ playProgress.setProgress(playResumePos,snd.length);
+ caption.text=formatLabel(playResumePos);
}
}else{
- if(playing) {
+ if(plyng) {
playProgress.setProgress(Math.random(),1);
caption.text=formatLabel(sndCh.position);
} else {
playProgress.setProgress(snd.bytesLoaded,snd.bytesTotal);
- caption.text=formatLabel(playResumePosition);
+ caption.text=formatLabel(playResumePos);
}
}
+ if(plyng&&pauseAtPos>=0&&sndCh.position<pauseAtPos)
+ toBePaused=true;
+ if(
+ plyng&&pauseAtPos>=0&&
+ sndCh.position>=pauseAtPos&&toBePaused
+ ){
+ pause();
+ pauseAtPos=-1;
+ toBePaused=false;
+ }
}
private function onID3Info(e:Event):void {id3 = e.target.id3;}
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 a5f05bbb425..7d73ce43b7d 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 20140306 -->
+<!-- version 20140625 -->
<!-- -->
<!-- -->
<!-- The free Apache Flex 4 SDK is required to compile -->
@@ -57,6 +57,8 @@
private var curTime:Number;
private var newPos:Number;
private var keyPressed:Boolean=false;
+ private var pauseAtPos:Number = -1;
+ private var toBePaused:Boolean = false;
import mx.core.FlexGlobals;
private function initialise(flashVars:Object):void {
@@ -155,11 +157,26 @@
if(stepping&&vidDisp.playing){vidDisp.pause();}
}
- private function play():void {
- if(vidComplete){vidDisp.seek(0);}vidDisp.play();
+ private function onCurrentTimeChange(e:Event):void {
+ if(vidDisp.playing&&pauseAtPos>=0&&vidDisp.currentTime<pauseAtPos)
+ toBePaused=true;
+ if(
+ vidDisp.playing&&pauseAtPos>=0&&
+ vidDisp.currentTime>=pauseAtPos&&toBePaused
+ ){
+ pause();
+ pauseAtPos=-1;
+ toBePaused=false;
+ }
+ }
+
+ private function play(p:Number=-1):void {
+ if(p>=0) seek(p);
+ if(vidComplete){seek(0);}vidDisp.play();
}
- private function pause():void {
+ private function pause(p:Number=-1):void {
+ if(p>=0){pauseAtPos=p;return;}
vidDisp.pause();
}
@@ -262,12 +279,13 @@
id="vidDisp"
width="100%" height="100%" scaleMode="{scaleMode}"
source="{source}" volume="{vol}"
- autoPlay="{autoPlay}" autoRewind="{autoRewind}" loop="{loop}"
+ autoPlay="{autoPlay}" autoRewind="{autoRewind}" loop="{loop}"
mouseDown="if(stepping){vidDisp.play();}else{vidDisp.pause();}this.setFocus();"
mouseUp="if(vidComplete) vidDisp.seek(0);if(!stepping){vidDisp.play();}"
mediaPlayerStateChange="onStateChange(event);"
complete="vidComplete=true;"
durationChange="vidDisp.seek(0);"
+ currentTimeChange="onCurrentTimeChange(event);"
/>
<mx:ProgressBar width="100%" mode="polled" source="vidDisp"
diff --git a/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml b/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml
index 6a405c30145..02c684ffe32 100644
--- a/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml
+++ b/Master/texmf-dist/doc/latex/media9/files/players/VPlayer9.mxml
@@ -4,7 +4,7 @@
<!-- a FlashPlayer-9 compatible component for playing -->
<!-- FLV and MP4/H.264 video files and streams. -->
<!-- -->
-<!-- version 20131114 -->
+<!-- version 20140625 -->
<!-- -->
<!-- Copyright (C) 2012-today Alexander Grahn -->
<!-- -->
@@ -46,6 +46,8 @@
private var keyPressed:Boolean=false;
private var muted:Boolean=false;
private var lastVolume:Number;
+ private var pauseAtPos:Number = -1;
+ private var toBePaused:Boolean = false;
import flash.external.*;
private function initialise(flashVars:Object):void {
@@ -143,11 +145,26 @@
if(stepping&&vidDisp.playing){vidDisp.pause();}
}
- private function play():void {
- if(vidComplete){vidDisp.playheadTime=0;}vidDisp.play();
+ private function onPlayheadUpdate(e:Event):void {
+ if(vidDisp.playing&&pauseAtPos>=0&&vidDisp.playheadTime<pauseAtPos)
+ toBePaused=true;
+ if(
+ vidDisp.playing&&pauseAtPos>=0&&
+ vidDisp.playheadTime>=pauseAtPos&&toBePaused
+ ){
+ pause();
+ pauseAtPos=-1;
+ toBePaused=false;
+ }
+ }
+
+ private function play(p:Number=-1):void {
+ if(p>=0) seek(p);
+ if(vidComplete){seek(0);}vidDisp.play();
}
- private function pause():void {
+ private function pause(p:Number=-1):void {
+ if(p>=0){pauseAtPos=p;return;}
vidDisp.pause();
}
@@ -206,6 +223,22 @@
return fmtd;
}
+ private function currentTime():Number {
+ return vidDisp.playheadTime;
+ }
+
+ private function playing():Boolean {
+ return vidDisp.playing;
+ }
+
+ private function duration():Number {
+ return vidDisp.totalTime;
+ }
+
+ private function ismuted():Boolean {
+ return muted;
+ }
+
private function init():void {
this.setFocus();
this.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
@@ -220,6 +253,10 @@
ExternalInterface.addCallback("mute", mute);
ExternalInterface.addCallback("setSource", setSource);
ExternalInterface.addCallback("stepping", step);
+ ExternalInterface.addCallback("currentTime", currentTime);
+ ExternalInterface.addCallback("duration", duration);
+ ExternalInterface.addCallback("playing", playing);
+ ExternalInterface.addCallback("muted", ismuted);
}
]]>
</mx:Script>
@@ -239,6 +276,7 @@
stateChange="onStateChange(event);"
complete="vidComplete=true;"
rewind="vidDisp.play();"
+ playheadUpdate="onPlayheadUpdate(event);"
/>
<mx:ProgressBar width="100%" mode="polled" source="vidDisp"
diff --git a/Master/texmf-dist/doc/latex/media9/media9.pdf b/Master/texmf-dist/doc/latex/media9/media9.pdf
index 04ad52c1b8c..5d57ba4c45d 100644
--- a/Master/texmf-dist/doc/latex/media9/media9.pdf
+++ b/Master/texmf-dist/doc/latex/media9/media9.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/media9/media9.tex b/Master/texmf-dist/doc/latex/media9/media9.tex
index c000a69ba82..5470962d4e8 100644
--- a/Master/texmf-dist/doc/latex/media9/media9.tex
+++ b/Master/texmf-dist/doc/latex/media9/media9.tex
@@ -189,7 +189,7 @@ The last argument, \verb+<main Flash (SWF) file or URL | 3D (PRC, U3D) file>+, i
Argument \verb+<poster text>+ defines the size of the rectangular region of the document page in which the media will be displayed. Moreover, \verb+<poster text>+ will be shown in case the media has not been activated.
%(Internally, \verb+<poster text>+ is put into a \LaTeX{} box, which is used as the appearance of the PDF annotation, i.\,e. the interactive region created by \verb+\includemedia+, in PDF specification parlance.)
-\verb+<poster text>+ can be anything that \LaTeX{} can typeset, such as an \verb+\includegraphics+ command serving as a poster image, a PGF/TikZ/PSTricks inline graphics or just ordinary text. Alternatively, \verb+<poster text>+ can be left blank in which case the size of the media rectangle should be set with options `\verb+width+', `\verb+height+' and optionally with `\verb+depth+'. If sizing options `\verb+width+' and `\verb+height+' are given \emph{together} with \verb+<poster text>+, \verb+<poster text>+ will be shrunk or stretched to fit exactly into the rectangle defined by the options, possibly changing the original aspect ratio of the poster text. On the other hand, if only one of `\verb+width+' or `\verb+height+' is given, the other dimension of \verb+<poster text>+ is scaled such that the original aspect ratio is preserved.
+\verb+<poster text>+ can be anything that \LaTeX{} can typeset, such as an \verb+\includegraphics+ command serving as a poster image, a PGF/TikZ/PSTricks inline graphics or just ordinary text. Alternatively, \verb+<poster text>+ can be left blank in which case the size of the media rectangle should be set with options `\verb+width+' and `\verb+height+'. If a non-zero size \verb+<poster text>+ was provided, it can be resized using any combination of options `\verb+width+', `\verb+height+' or `\verb+totalheight+', `\verb+keepaspectratio+' and `\verb+scale+'.
A list of directories where \TeX{} searches for media and resource files can be set-up by means of
\begin{verbatim}
@@ -203,16 +203,16 @@ The following section explains all command options provided. They are passed to
A subset of the command options (see Sect. \ref{pkguse}) can also be used as package options, which lets them apply to all embedded media. Some of the options listed here are meaningful only for a specific media type (either Flash or 3D), which will be noted explicitly if not obvious. Dedicated sections covering Flash, video and sound as well as 3D inclusion will follow later on in this document.
\begin{verbatim}
-width=<width>,
-height=<height>,
-depth=<depth>
-\end{verbatim}
-Resize the media playback area, overriding the original dimensions of the {\tt<poster text>} 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+<poster text>+. 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+<poster text>+.
-\begin{verbatim}
label=<label text>
\end{verbatim}
The media annotation is given a label, \verb+<label text>+, which should be unique. Labelled media annotations can be targeted by the media actions of a control button (see description of the \verb+\mediabutton+ command in Sect. ~\ref{mbtn}). Moreover, a reference to the RichMedia Annotation object (of type `\verb+AnnotRichMedia+') is assigned to the JavaScript variable \verb+annotRM['<label text>']+ in order to facilitate its access in JavaScript. Note that the JavaScript reference is known only after the first opening of the page containing the media.
\begin{verbatim}
+width=<h-size>,
+height=<v-size> | totalheight=<v-size>,
+keepaspectratio
+\end{verbatim}
+Resize the media playback area. \verb+<poster text>+, if provided, is squeezed or stretched accordingly. If only one of `\verb+width+' or `\verb+[total]height+' is given, the other dimension is scaled to maintain the aspect ratio of \verb+<poster text>+. If both `\verb+width+' and `\verb+[total]height+' are given together with `\verb+keepaspectratio+', \verb+<poster text>+ is resized to fit within \verb+<h-size>+ and \verb+<v-size>+ while maintaining its original aspect ratio. Any valid \TeX{} dimension is acceptable for \verb+<h-size>+ and \verb+<v-size>+. 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+<poster text>+.
+\begin{verbatim}
scale=<factor>
\end{verbatim}
Scales the playback area by \verb+<factor>+.
@@ -499,13 +499,13 @@ A box with \verb+<tip text>+ is shown when the mouse pointer is moved over the b
Selects a view from the list of predefined views associated with a 3D media inclusion (see option `\verb+3Dviews+'). The target media is specified by \verb+<label text>+, as defined by the `\verb+label+' option of `\verb+\includemedia+'. \verb+<label text>+ alone without a view specification simply activates the 3D object if not yet activated. {\tt<view specification>} which is separated from the label by a colon (\verb+:+) can be one of the following: an integer specifying the zero-based index into the list of views in the 3D views file; one of `\verb+D+', `\verb+F+', `\verb+L+', `\verb+N+', `\verb+P+' indicating the default, first, last, next or previous view in the list of views; a string delimited by `\verb+(+' and `\verb+)+' matching the name of a view as specified by the `\verb+VIEW=...+' entry in the views file. The option can be given several times to simultaneously change the view in more than one 3D inclusion. However, it cannot be used to create an animation effect within the same 3D inclusion, because \verb+3Dgotoview+ actions are executed in parallel.
%For this, one may implement a 3D JavaScript function that is associated with the media button using the `\verb+mediacommand+' option.
\begin{verbatim}
-mediacommand=<label text>[:<command> [<arg1> <arg2> ...]]
+mediacommand=<label text>[:<command> [(<arg1>) (<arg2>) ...]]
\end{verbatim}
-A media command \verb+<command>+, with arguments if required, is sent to a media inclusion identified by \verb+<label text>+, as defined by the `\verb+label+' option of `\verb+\includemedia+'. \verb+<label text>+ alone without a command specification simply activates the media, if not yet activated. The option can be multiply used within the same button to target different media inclusions at the same time or to execute several commands for the same media. Depending on the type of the target media (3D or Flash), \verb+<command>+ is either the name of a JavaScript function defined in a 3D JavaScript file associated with the 3D media (see option `\verb+add3Djscript+') or the name of an ActionScript function that was exposed by the embedded Flash file. ActionScript functions are exposed to the scripting context of the hosting document by using the \verb+ExternalInterface+ call within the Flash file. Arguments to be passed to \verb+<command>+ must be separated by spaces and the whole list be enclosed in `\verb+[+' and `\verb+]+'. Arguments can be of Boolean type (\verb+true+, \verb+false+), numbers (integer, reals) and strings. String arguments must be passed as \verb+(string arg)+, i.\,e. enclosed in parentheses, while numbers and Booleans are passed as they are. Of course, the number of arguments and their types must match the definition of the function to be called. Media players VPlayer.swf and APlayer.swf shipping with media9 expose a number of ActionScript functions that can be used with this option (see Tab. \ref{AVPlayerMethods}). \verb+<command> [<arg1> <arg2> ...]+ must be enclosed in braces if there are embedded equals signs or commas.
+A media command \verb+<command>+, with arguments if required, is sent to a media inclusion identified by \verb+<label text>+, as defined by the `\verb+label+' option of `\verb+\includemedia+'. \verb+<label text>+ alone without a command specification simply activates the media, if not yet activated. The option can be used multiple times within the same button to target different media inclusions at the same time or to execute several commands for the same media. Depending on the type of the target media (3D or Flash), \verb+<command>+ is either the name of a JavaScript function defined in a 3D JavaScript file associated with the 3D media (see option `\verb+add3Djscript+') or the name of an ActionScript function that was exposed by the embedded Flash file. ActionScript functions are exposed to the scripting context of the hosting document by using the \verb+ExternalInterface+ call within the Flash file. Arguments to be passed to \verb+<command>+ must be enclosed in `\verb+(+' and `\verb+)+' and separated by spaces, the whole list be finally enclosed in `\verb+[+' and `\verb+]+', even if there is only a single argument. Arguments can be of Boolean type (\verb+true+, \verb+false+), numbers (integer, reals) and strings. The number of arguments and their types must match the definition of the function to be called. Media players VPlayer.swf and APlayer.swf shipping with `media9' expose a number of ActionScript functions that can be used with this option (see Tab. \ref{AVPlayerMethods}). \verb+<command> [(<arg1>) (<arg2>) ...]+ must be enclosed in braces if there are embedded equals signs or commas. Examples of using `\verb+mediacommand+' are given in Figs.~\ref{videoa} and \ref{radio}c.
\begin{verbatim}
jsaction=[<label text>:]{<JavaScript code>}
\end{verbatim}
-The JavaScript code is executed in the context of the document's instance of the JavaScript engine (there is one instance of the JavaScript engine per open document in Adobe Reader). \verb+<JavaScript code>+ is required and must be enclosed in braces. Unlike media actions defined with options `\verb+mediacommand+' and `\verb+3Dgotoview+', the JavaScript action defined here is not targeted at a particular embedded media and can be used to run arbitrary code. Therefore, \verb+<label text>+ is optional. If provided, it must be separated from \verb+<JavaScript code>+ by a colon. However, it is recommended to provide a label text. It ensures that \verb+annotRM['<label text>']+ is a valid JavaScript reference to the \verb+AnnotRichMedia+ object. \verb+annotRM['<label text>']+ can be used to get access to the global context of the annotation's instance of the 3D JavaScript engine (there is one instance of the 3D JavaScript engine per activated RichMedia Annotation with 3D content). The 3D JavaScript context of a 3D model can be accessed as \verb+annotRM['<label text>'].context3D+. Refer to the Acrobat 3D JavaScript Reference~\cite{jscript3D} for details on built-in JavaScript objects that are available in the 3D context. The \verb+annotRM['<label text>'].callAS()+ method may be used as an alternative to the `\verb+mediacommand+` option in order run exposed ActionScript functions of an embedded Flash file. See~\cite{jscript} for details.
+The JavaScript code is executed in the context of the document's instance of the JavaScript engine (there is one instance of the JavaScript engine per open document in Adobe Reader). \verb+<JavaScript code>+ is required and must be enclosed in braces. Unlike media actions defined with options `\verb+mediacommand+' and `\verb+3Dgotoview+', the JavaScript action defined here is not targeted at a particular embedded media and can be used to run arbitrary code. Therefore, \verb+<label text>+ is optional. If provided, it must be separated from \verb+<JavaScript code>+ by a colon. However, it is recommended to provide a label text. It ensures that \verb+annotRM['<label text>']+ is a valid JavaScript reference to the \verb+AnnotRichMedia+ object. \verb+annotRM['<label text>']+ can be used to get access to the global context of the annotation's instance of the 3D JavaScript engine (there is one instance of the 3D JavaScript engine per activated RichMedia Annotation with 3D content). The 3D JavaScript context of a 3D model can be accessed as \verb+annotRM['<label text>'].context3D+. Refer to the Acrobat 3D JavaScript Reference~\cite{jscript3D} for details on built-in JavaScript objects that are available in the 3D context. The \verb+annotRM['<label text>'].callAS()+ method may be used as an alternative to the `\verb+mediacommand+` option. Both serve as means of running ActionScript functions exposed by embedded Flash files. See~\cite{jscript} for details.
\begin{verbatim}
draft
final
@@ -608,8 +608,8 @@ parameter & description\\\hline\hline
\caption{Exposed ActionScript functions of media players `VPlayer.swf' and `APlayer.swf', that can be called from within media buttons (see Sect. \ref{mbtn}) or from JavaScript using the `{\tt callAS}' method of the `{\tt AnnotRichMedia}' JavaScript object (see~\cite{jscript} for further information).}\label{AVPlayerMethods}
\begin{tabular}[t]{lp{0.25\linewidth}p{0.5\linewidth}}\hline
function & argument &description\\\hline\hline
-{\tt play} & & play media\\
-{\tt pause} & & pause media\\
+{\tt play} & number (optional) & play media, optionally starting at \emph{number} seconds offset into the media file\\
+{\tt pause} & number (optional) & pause media, optionally at the given offset of \emph{number} seconds into the media file\\
{\tt playPause} & & toggle between play and pause\\
{\tt stepping} & & (VPlayer.swf only) toggle stepping mode (one frame per click)\\
{\tt setSource} & string & load another media file (path to file, embedded using option `{\tt addresource}', or URL)\\
@@ -779,20 +779,44 @@ http://mirrors.ibiblio.org/pub/mirrors/CTAN/macros/latex/contrib/media9/players/
\vskip 4ex
\begin{Verbatim}
\includemedia[
- flashvars={
- source=http://www.openbsd.org/songs/song49.mp3
- &autoPlay=true
- },
+ label=song49,
+ flashvars={source=http://www.openbsd.org/songs/song49.mp3},
transparent
- ]{\color{blue}\fbox{Listen to OpenBSD 4.9 release song}}{APlayer.swf}
+ ]{\color{blue}\fbox{Listen to OpenBSD 4.9 release song}}{APlayer.swf}\\
+ \mediabutton[
+ mediacommand=song49:play[(5.5)],
+ mediacommand=song49:pause[(37)]
+ ]{\fbox{First verse}}
+ \mediabutton[
+ mediacommand=song49:play[(39)],
+ mediacommand=song49:pause[(49)]
+ ]{\fbox{The Answer}}
+ \mediabutton[
+ mediacommand=song49:play[(206.5)],
+ mediacommand=song49:pause[(221)]
+ ]{\fbox{Harmonica solo}}
\end{Verbatim}
-\makebox[\linewidth]{c)\hfill\includemedia[
+\makebox[\linewidth]{\rule{0pt}{1.5\baselineskip}\hfill\includemedia[
+ label=song49,
flashvars={
source=http://www.openbsd.org/songs/song49.mp3
- &autoPlay=true
},
transparent
-]{\color{blue}\fbox{Listen to OpenBSD 4.9 release song}}{APlayer.swf}\hfill}
+]{\color{blue}\fbox{Listen to OpenBSD 4.9 release song}}{APlayer.swf}\hfill}\\
+\makebox[\linewidth]{\makebox[0pt][l]{c)}\hfill%
+ \mediabutton[
+ mediacommand=song49:play[(5.5)],
+ mediacommand=song49:pause[(37)]
+ ]{\fbox{First verse}}
+ \mediabutton[
+ mediacommand=song49:play[(39)],
+ mediacommand=song49:pause[(49)]
+ ]{\fbox{The Answer}}
+ \mediabutton[
+ mediacommand=song49:play[(206.5)],
+ mediacommand=song49:pause[(221)]
+ ]{\fbox{Harmonica solo}}%
+\hfill}
\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}
diff --git a/Master/texmf-dist/tex/latex/media9/media9.sty b/Master/texmf-dist/tex/latex/media9/media9.sty
index 5a8a8f33dca..bf54d09ec2e 100644
--- a/Master/texmf-dist/tex/latex/media9/media9.sty
+++ b/Master/texmf-dist/tex/latex/media9/media9.sty
@@ -43,8 +43,8 @@
\RequirePackage{atenddvi}
\RequirePackage{tikz}
-\def\g@mix@date@tl{2014/06/04}
-\def\g@mix@version@tl{0.44}
+\def\g@mix@date@tl{2014/06/25}
+\def\g@mix@version@tl{0.45}
\def\g@mix@liiikerneldate{2013/07/28}
\def\g@mix@liiipkgdate{2013/07/28}
@@ -141,9 +141,9 @@
\cs_new:Npn\mix_parse_winsizearg:w#1x#2\q_stop{
\str_if_eq:nnTF{#1}{default}{
\tl_gset:Nx\tl_mix_fltwd{
- \fp_to_int:n{1.522*\__dim_strip_bp:n{\l_mix_wd_tl}}}
+ \fp_to_int:n{1.522*\__dim_strip_bp:n{\g_mix_wd_tl}}}
\tl_gset:Nx\tl_mix_fltht{
- \fp_to_int:n{1.522*\__dim_strip_bp:n{\l_mix_tt_tl}}}
+ \fp_to_int:n{1.522*\__dim_strip_bp:n{\g_mix_tt_tl}}}
}{
\tl_gset:Nn\tl_mix_fltwd{#1}
\tl_gset:Nn\tl_mix_fltht{#2}
@@ -385,7 +385,8 @@
\tl_gset:Nn\g_mix_scalearg_tl{1.0}
\tl_gset:Nn\g_mix_wdarg_tl{\width}
\tl_gset:Nn\g_mix_htarg_tl{\height}
- \tl_gset:Nn\g_mix_dparg_tl{\depth}
+ \tl_gset:Nn\g_mix_ttarg_tl{\totalheight}
+ \bool_gset_false:N\g_mix_usriso_bool %keepaspectratio
\tl_gset_eq:NN\g_mix_transp_tl\g_mix_pkgtransp_tl
\tl_gset_eq:NN\g_mix_contextclick_tl\g_mix_pkgcontextclick_tl
\bool_gset_eq:NN\g_mix_opt_windowed_bool\g_mix_opt_pkgwindowed_bool
@@ -459,8 +460,10 @@
\group_begin:
\char_set_catcode_active:N\+\let+\space
\tl_gset:Nx\g_mix_dpiwarning_tl{
- {Resolution~1200~gt~VResolution~1200~gt~or~{
- (@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\token_to_str:N\n
+ {Resolution~1200~gt~VResolution~1200~gt~or~product~(Ghostscript)~
+ search~{pop~pop~pop~true}{pop~false}ifelse~and~{
+ (\token_to_str:N\n
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\token_to_str:N\n
@@++++Warning:+DVI+resolution+greater+than+1200+dpi!+++++@@\token_to_str:N\n
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\token_to_str:N\n
@@+++++++++++++++++++++++++++++++++++++++++++++++++++++++@@\token_to_str:N\n
@@ -509,7 +512,7 @@
/OCProperties~<<
/OCGs~\g_mix_ocgarray_tl
/D~<<
- /AS~[
+ /AS~[
<</Event/View /Category[/View] /OCGs~\g_mix_ocgarray_tl>>
<</Event/Print /Category[/Print] /OCGs~\g_mix_ocgarray_tl>>
<</Event/Export/Category[/Export]/OCGs~\g_mix_ocgarray_tl>>
@@ -624,6 +627,12 @@
}
\cs_new:Nn\mix_pdfemc:{\pdfliteral~direct~{EMC}}
}{
+ %pgf + transparency related settings
+ \bool_new:N\g_mix_pgfloaded_bool
+ \bool_gset_false:N\g_mix_pgfloaded_bool
+ \AtBeginDocument{
+ \@ifpackageloaded{pgf}{\bool_gset_true:N\g_mix_pgfloaded_bool}{}
+ }
\int_new:N\g_mix_obj_int % object ID
\bool_if:NTF\g_mix_dvipdfmx_bool{ %dvipdfmx/XeTeX
\cs_new:Nn\mix_pdfobj:nnn{
@@ -677,6 +686,21 @@
depth\space\dim_eval:n{\box_dp:N #1}
}
\begin{picture}(0,0)\put(0,0){\box_use:N #1}\end{picture}
+ \bool_if:NT\g_mix_pgfloaded_bool{ % transparency et al. for PGF
+ \tl_set:Nn\l_mix_temp_tl{}
+ \ifpgf@sys@pdf@extgs@exists
+ \tl_set:Nn\l_mix_temp_tl{/ExtGState~@pgfextgs}
+ \fi
+ \ifpgf@sys@pdf@patterns@exists
+ \tl_put_right:Nn\l_mix_temp_tl{/Pattern~@pgfpatterns}
+ \fi
+ \ifpgf@sys@pdf@colorspaces@exists
+ \tl_put_right:Nn\l_mix_temp_tl{/ColorSpace~@pgfcolorspaces}
+ \fi
+ \tl_if_blank:VF\l_mix_temp_tl{
+ \special{pdf:put~@resources~<<\l_mix_temp_tl>>}
+ }
+ }
\special{pdf:exobj}
\tl_gset:Nx\g_mix_pdflastxform_tl{@mix@obj\int_use:N\g_mix_obj_int}
\int_gincr:N\g_mix_obj_int
@@ -751,7 +775,7 @@
%determine DVI resolution and output warning message if too big
%\AtBeginDocument{\special{ps:\g_mix_dpiwarning_tl}}
- \special{ps:\g_mix_dpiwarning_tl}
+ \AtEndDvi{\special{ps:\g_mix_dpiwarning_tl}}
\cs_new:Nn\mix_pdfobj:nnn{
% #1:objref; if empty, a new object number will be reserved
@@ -989,7 +1013,8 @@
\special{ps:~mark~{Catalog}~<<#1>>~/PUT~pdfmark}
}
- %marked content BDC/EMC operators for playbutton ocg
+ %marked content BDC/EMC operators for playbutton ocg;
+ %require Ghostscript v. >= 9.15
\cs_new:Nn\mix_pdfbdc:nn{\special{ps:~mark~#1~#2~/BDC~pdfmark}}
\cs_new:Nn\mix_pdfemc:{\special{ps:~mark~/EMC~pdfmark}}
}
@@ -1116,16 +1141,16 @@
\cs_new:Nn\mix_draftbox:n{ %#1 text string to be shown in the draft box centre
\hbox_overlap_right:n{
- \hbox_to_wd:nn{\l_mix_wd_tl}{
- \vrule~height~\l_mix_ht_tl~depth~\l_mix_dp_tl\hss
+ \hbox_to_wd:nn{\g_mix_wd_tl}{
+ \vrule~height~\g_mix_ht_tl~depth~\g_mix_dp_tl\hss
\vrule
}
}
- \box_move_down:nn{\l_mix_dp_tl}{
- \hbox_to_wd:nn{\l_mix_wd_tl}{
- \vbox_to_ht:nn{\l_mix_tt_tl}{
- \hrule~width~\l_mix_wd_tl\vss
- \hbox_to_wd:nn{\l_mix_wd_tl}{\ttfamily{\tiny#1}\hss}\vss
+ \box_move_down:nn{\g_mix_dp_tl}{
+ \hbox_to_wd:nn{\g_mix_wd_tl}{
+ \vbox_to_ht:nn{\g_mix_tt_tl}{
+ \hrule~width~\g_mix_wd_tl\vss
+ \hbox_to_wd:nn{\g_mix_wd_tl}{\ttfamily{\tiny#1}\hss}\vss
\hrule
}
}
@@ -1140,102 +1165,123 @@
and~`height'~options.
}
+\msg_set:nnn{media9}{zero~width}{
+ Media~annotation~\msg_line_context:\ has~zero~width.\\\\
+ Provide~a~poster~text~with~non-zero~width~or\\
+ set~a~valid~one~using~the~`width'~option.
+}
+
+\msg_set:nnn{media9}{zero~height}{
+ Media~annotation~\msg_line_context:\ has~zero~height.\\\\
+ Provide~a~poster~text~with~non-zero~height~or\\
+ set~a~valid~height~using~one~of~`height'~or\\
+ `totalheight'~options.
+}
+
%calculates widget dimensions from natural ones, taking resizing options
%into account
\int_new:N\g_mix_resizeflag_int% resizing flags according to options given
\cs_new:Nn\mix_scale:n{% #1 box number
- %natural dimensions \width, \height, \depth, \totalheight
- \tl_set:Nn\width {\box_wd:N#1}
- \tl_set:Nn\height{\box_ht:N#1}
- \tl_set:Nn\depth {\box_dp:N#1}
- \tl_set:Nn\totalheight{(\height+\depth)}
- \tl_set:Nx\l_mix_wd_tl{\dim_eval:n{\g_mix_wdarg_tl}}
- \tl_set:Nx\l_mix_ht_tl{\dim_eval:n{\g_mix_htarg_tl}}
- \tl_set:Nx\l_mix_dp_tl{\dim_eval:n{\g_mix_dparg_tl}}
- \tl_set:Nx\l_mix_tt_tl{\dim_eval:n{\g_mix_htarg_tl+\g_mix_dparg_tl}}
- %resize unspecified dimensions to keep aspect ratio
+ %totalheight overrides height if both height & totalheight options were given
+ \bool_if:nT{
+ \int_compare_p:n{\g_mix_resizeflag_int=\c_three} ||
+ \int_compare_p:n{\g_mix_resizeflag_int=\c_seven}
+ }{\int_gsub:Nn\g_mix_resizeflag_int{\c_two}}
+ \group_begin:
+ %natural dimensions \width, \height, \depth, \totalheight
+ \tl_set:Nn\width {\box_wd:N#1}
+ \tl_set:Nn\height{\box_ht:N#1}
+ \tl_set:Nn\depth {\box_dp:N#1}
+ \tl_set:Nn\totalheight{\dimexpr\height+\depth\relax}
+ \tl_gset:Nx\g_tmpa_tl{\dim_eval:n{\width}}
+ \tl_gset:Nx\g_tmpb_tl{\dim_eval:n{\totalheight}}
+ %evaluate width/height/totalheight options
+ \tl_gset:Nx\g_mix_wd_tl{\dim_abs:n{\g_mix_wdarg_tl}}
+ \tl_gset:Nx\g_mix_ht_tl{\dim_abs:n{\g_mix_htarg_tl}}
+ \tl_gset:Nx\g_mix_tt_tl{\dim_abs:n{\g_mix_ttarg_tl}}
+ \dim_compare:nT{\width=\c_zero_dim}{\box_set_wd:Nn#1{\g_mix_wd_tl}}
+ \dim_compare:nT{\totalheight=\c_zero_dim}{
+ \bool_if:nT{ %height option given
+ \int_compare_p:n{\g_mix_resizeflag_int=\c_six}||
+ \int_compare_p:n{\g_mix_resizeflag_int=\c_two}
+ }{\box_set_ht:Nn#1{\g_mix_ht_tl}}
+ \bool_if:nT{ %totalheight option given
+ \int_compare_p:n{\g_mix_resizeflag_int=\c_five}||
+ \int_compare_p:n{\g_mix_resizeflag_int=\c_one}
+ }{\box_set_ht:Nn#1{\g_mix_tt_tl}}
+ }
+ \group_end:
+ \tl_gset:Nn\g_mix_dp_tl{\c_zero_dim} %to be initialised here
+ %now resize (originally non-zero size) poster box according to the
+ %options given
\bool_if:nF{
- % original poster box must be two dimensional
- \dim_compare_p:n{\width=\c_zero_dim}
- ||\dim_compare_p:n{\totalheight=\c_zero_dim}
+ \dim_compare_p:n{\g_tmpa_tl=\c_zero_dim}||
+ \dim_compare_p:n{\g_tmpb_tl=\c_zero_dim}
}{
- \int_case:nnn{\g_mix_resizeflag_int}{
- {\c_one}{% depth given alone: no rescaling, only vertical movement
- \tl_set:Nx\l_mix_ht_tl{
- \dim_eval:n{
- \totalheight-\l_mix_dp_tl
- }
- }
+ %bit 2^2=width, 2^1=height, 2^0=totalhight given
+ \int_case:nn{\g_mix_resizeflag_int}{
+ {\c_one}{
+ %\hbox_set:Nn#1{\resizebox*{!}{\g_mix_tt_tl}{\box_use_clear:N#1}}
+ \box_resize_to_ht_plus_dp:Nn#1{\g_mix_tt_tl}
}
- {\c_two}{% height given alone
- \tl_set:Nx\l_mix_wd_tl{
- \dim_eval:n{
- \width*\dim_ratio:nn{\l_mix_ht_tl}{\height}
- }
- }
- \tl_set:Nx\l_mix_dp_tl{
- \dim_eval:n{
- \depth*\dim_ratio:nn{\l_mix_ht_tl}{\height}
- }
- }
+ {\c_two}{
+ \hbox_set:Nn#1{\resizebox{!}{\g_mix_ht_tl}{\box_use_clear:N#1}}
}
- {\c_three}{% height and depth given
- \tl_set:Nx\l_mix_wd_tl{
- \dim_eval:n{
- \width*\dim_ratio:nn{\l_mix_tt_tl}{\totalheight}
- }
- }
+ {\c_four}{
+ %\hbox_set:Nn#1{\resizebox{\g_mix_wd_tl}{!}{\box_use_clear:N#1}}
+ \box_resize_to_wd:Nn#1{\g_mix_wd_tl}
}
- {\c_four}{% width given alone
- \tl_set:Nx\l_mix_ht_tl{
- \dim_eval:n{
- \height*\dim_ratio:nn{\l_mix_wd_tl}{\width}
+ {\c_five}{
+ \bool_if:NTF\g_mix_usriso_bool{
+ \dim_set:Nn\l_tmpa_dim{
+ (\box_ht:N#1+\box_dp:N#1)*\dim_ratio:nn{\g_mix_wd_tl}{\box_wd:N#1}
}
- }
- \tl_set:Nx\l_mix_dp_tl{
- \dim_eval:n{
- \depth*\dim_ratio:nn{\l_mix_wd_tl}{\width}
+ \dim_set:Nn\l_tmpa_dim{\dim_abs:n{\l_tmpa_dim}}
+ \dim_set:Nn\l_tmpb_dim{\dim_abs:n{\g_mix_tt_tl}}
+ \dim_compare:nTF{\l_tmpa_dim<\l_tmpb_dim}{
+ %\hbox_set:Nn#1{\resizebox{\g_mix_wd_tl}{!}{\box_use_clear:N#1}}
+ \box_resize_to_wd:Nn#1{\g_mix_wd_tl}
+ }{
+ %\hbox_set:Nn#1{\resizebox*{!}{\g_mix_tt_tl}{\box_use_clear:N#1}}
+ \box_resize_to_ht_plus_dp:Nn#1{\g_mix_tt_tl}
}
+ }{
+ %\hbox_set:Nn#1{
+ % \resizebox*{\g_mix_wd_tl}{\g_mix_tt_tl}{\box_use_clear:N#1}}
+ \box_resize:Nnn#1{\g_mix_wd_tl}{\g_mix_tt_tl}
}
}
- {\c_five}{% width and depth given
- \tl_set:Nx\l_mix_ht_tl{
- \dim_eval:n{
- \totalheight*\dim_ratio:nn{\l_mix_wd_tl}{\width}-\l_mix_dp_tl
+ {\c_six}{
+ \bool_if:NTF\g_mix_usriso_bool{
+ \dim_set:Nn\l_tmpa_dim{
+ \box_ht:N#1*\dim_ratio:nn{\g_mix_wd_tl}{\box_wd:N#1}
}
- }
- }
- {\c_six}{% width and height given
- \tl_set:Nx\l_mix_dp_tl{
- \dim_eval:n{
- \depth*\dim_ratio:nn{\l_mix_ht_tl}{\height}
+ \dim_set:Nn\l_tmpa_dim{\dim_abs:n{\l_tmpa_dim}}
+ \dim_set:Nn\l_tmpb_dim{\dim_abs:n{\g_mix_ht_tl}}
+ \dim_compare:nTF{\l_tmpa_dim<\l_tmpb_dim}{
+ %\hbox_set:Nn#1{\resizebox{\g_mix_wd_tl}{!}{\box_use_clear:N#1}}
+ \box_resize_to_wd:Nn#1{\g_mix_wd_tl}
+ }{
+ \hbox_set:Nn#1{\resizebox{!}{\g_mix_ht_tl}{\box_use_clear:N#1}}
}
+ }{
+ \hbox_set:Nn#1{
+ \resizebox{\g_mix_wd_tl}{\g_mix_ht_tl}{\box_use_clear:N#1}}
}
}
- }{} % 0, 7
+ }
}
%apply scaling factor
- \dim_set:Nn\l_tmpa_dim{\l_mix_wd_tl}
- \tl_set:Nx\l_mix_wd_tl{\dim_eval:n{\g_mix_scalearg_tl\l_tmpa_dim}}
- \dim_set:Nn\l_tmpa_dim{\l_mix_ht_tl}
- \tl_set:Nx\l_mix_ht_tl{\dim_eval:n{\g_mix_scalearg_tl\l_tmpa_dim}}
- \dim_set:Nn\l_tmpa_dim{\l_mix_dp_tl}
- \tl_set:Nx\l_mix_dp_tl{\dim_eval:n{\g_mix_scalearg_tl\l_tmpa_dim}}
- \tl_set:Nx\l_mix_tt_tl{\dim_eval:n{\l_mix_ht_tl+\l_mix_dp_tl}}
- %apply new dimensions (to non-zero size box)
- \bool_if:nF{
- \dim_compare_p:n{\width=\c_zero_dim} ||
- \dim_compare_p:n{\totalheight=\c_zero_dim}
- }{
- \box_resize:Nnn#1{\l_mix_wd_tl}{\l_mix_tt_tl}
- }
- \bool_if:nT{
- \dim_compare_p:n{\l_mix_wd_tl=\c_zero_dim} ||
- \dim_compare_p:n{\l_mix_tt_tl=\c_zero_dim}
- }{
- \msg_warning:nn{media9}{zero~size}
- }
+ \box_scale:Nnn#1{\g_mix_scalearg_tl}{\g_mix_scalearg_tl}
+ %dimensions after resizing
+ \tl_gset:Nx\g_mix_wd_tl{\dim_eval:n{\box_wd:N#1}}
+ \tl_gset:Nx\g_mix_ht_tl{\dim_eval:n{\box_ht:N#1}}
+ \tl_gset:Nx\g_mix_dp_tl{\dim_eval:n{\box_dp:N#1}}
+ \tl_gset:Nx\g_mix_tt_tl{\dim_eval:n{\box_ht:N#1+\box_dp:N#1}}
+ \dim_compare:nT{\g_mix_wd_tl=\c_zero_dim}{\msg_warning:nn{media9}{zero~width}}
+ \dim_compare:nT{\g_mix_tt_tl=\c_zero_dim}{
+ \msg_warning:nn{media9}{zero~height}}
}
\bool_new:N\g_mix_iiid_bool
@@ -1246,29 +1292,26 @@
%play button overlay; two versions: fancy and plain
\box_new:N\l_mix_pbtn_box
\ExplSyntaxOff
+\newdimen\mix@btn@dim
\def\g@mix@pbtn@fancy@tl#1#2{% width, total height
- \ifdim#2<\dimexpr\baselineskip*3\relax%
- \edef\mix@tikzunit{#2}%
- \else%
- \edef\mix@tikzunit{\the\dimexpr\baselineskip*3\relax}%
- \fi%
- \tikz[x=\mix@tikzunit,y=\mix@tikzunit,transparency group]{%
+ \mix@btn@dim=\dimexpr\baselineskip*3\relax%
+ \ifdim#1<\mix@btn@dim\mix@btn@dim=#1\fi%
+ \ifdim#2<\mix@btn@dim\mix@btn@dim=#2\fi%
+ \tikz[x=\mix@btn@dim,y=\mix@btn@dim,transparency group]{%
\shade [opacity=\ifdim#2>\dimexpr\baselineskip*6\relax0.6\else0\fi,
shading angle=-180,even odd rule]
(-\dimexpr#1/2\relax,-0.5) rectangle (\dimexpr#1/2\relax,0.5)
(0,0) circle (0.4);
\shade [ball color=gray,opacity=0.6] (0,0) circle (0.4);
- \fill [color=white,opacity=0.6]
+ \fill [color=white,opacity=0.6] %triangle
(-0.152,0.224)--(-0.152,-0.224)--+(30:0.4844)--cycle;
}%
}
\def\g@mix@pbtn@plain@tl#1#2{% width, total height
- \ifdim#2<\dimexpr\baselineskip*3\relax%
- \edef\mix@tikzunit{#2}%
- \else%
- \edef\mix@tikzunit{\the\dimexpr\baselineskip*3\relax}%
- \fi%
- \tikz[x=\mix@tikzunit,y=\mix@tikzunit,transparency group]{%
+ \mix@btn@dim=\dimexpr\baselineskip*3\relax%
+ \ifdim#1<\mix@btn@dim\mix@btn@dim=#1\fi%
+ \ifdim#2<\mix@btn@dim\mix@btn@dim=#2\fi%
+ \tikz[x=\mix@btn@dim,y=\mix@btn@dim,transparency group]{%
\fill [opacity=\ifdim#2>\dimexpr\baselineskip*6\relax0.5\else0\fi,
color=gray,even odd rule]
(-\dimexpr#1/2\relax,-0.5) rectangle (\dimexpr#1/2\relax,0.5);
@@ -1284,15 +1327,13 @@
\NewDocumentCommand\includemedia{O{}mm}{%#1 options, #2 text/image #3 media file
\group_begin:
\leavevmode
- \mix_reset:
%empty stream as appearance dummy
\cs_if_exist:NF\g_mix_appearance_tl{
\hbox_set:Nn\l_mix_poster_box{\phantom{\rule{1pt}{1pt}}}
\mix_pdfxform:n{\l_mix_poster_box}
\tl_gset:Nx\g_mix_appearance_tl{\g_mix_pdflastxform_tl}
}
- \cs_if_exist:NT\Ginput@path{\cs_set_eq:NN\input@path\Ginput@path}
- \hbox_set:Nn\l_mix_poster_box{#2}
+ \mix_reset:
\mix_uribegin: %treat URI characters correctly
\keys_set:nn{media9/user}{#1}
\mix_uriend:
@@ -1301,12 +1342,16 @@
\tl_greplace_all:Nnn\g_mix_flashvars_tl{~=}{=}
\tl_greplace_all:Nnn\g_mix_flashvars_tl{=~}{=}
\tl_gtrim_spaces:N\g_mix_flashvars_tl
+ %
+ \cs_if_exist:NT\Ginput@path{\cs_set_eq:NN\input@path\Ginput@path}
+ %
+ \hbox_set:Nn\l_mix_poster_box{\group_begin:#2\group_end:}
+ %\hbox_set:Nn\l_mix_poster_box{#2}
\mix_scale:n{\l_mix_poster_box}
\bool_if:nT{
- \dim_compare_p:n{\l_mix_tt_tl=\c_zero_dim}||
- \dim_compare_p:n{\l_mix_wd_tl=\c_zero_dim}
+ \dim_compare_p:n{\g_mix_tt_tl=\c_zero_dim}||
+ \dim_compare_p:n{\g_mix_wd_tl=\c_zero_dim}
}{
- %\bool_gset_false:N\g_mix_usrpbtn_bool
\tl_gset:Nn\g_mix_usrpbtn_tl{none}
}
\bool_if:NTF\g_mix_usrdraft_bool{
@@ -1316,8 +1361,9 @@
\tl_if_blank:oTF{#2}{
\mix_draftbox:n{\tl_to_str:n{#3}}
}{
- \box_move_down:nn{\l_mix_dp_tl-\box_dp:N\l_mix_poster_box}{
- \box_use:N\l_mix_poster_box
+ \hbox_to_wd:nn{\g_mix_wd_tl}{
+ \vrule~width~\c_zero_dim~height~\g_mix_ht_tl~depth~\g_mix_dp_tl
+ \box_use:N\l_mix_poster_box\hss
}
}
}{
@@ -1515,7 +1561,7 @@
\tl_gset_eq:NN\g_mix_label_tl\g_mix_usrlabel_tl
}
% #1:width, #2:height, #3:depth, #4:content (key-value)
- \mix_pdfannot:nnnn{\l_mix_wd_tl}{\l_mix_ht_tl}{\l_mix_dp_tl}{
+ \mix_pdfannot:nnnn{\g_mix_wd_tl}{\g_mix_ht_tl}{\g_mix_dp_tl}{
/Subtype/RichMedia
/F~4
/BS~<</W~0/S/S>>
@@ -1569,22 +1615,18 @@
/AA~<</PO~\g_mix_pdflastobj_tl~/PV~\g_mix_pdflastobj_tl>>
}
\tl_gput_right:Nx\@anim@fields{\space\g_mix_pdflastann_tl\space}
- \hbox_overlap_right:n{
- \box_move_down:nn{\l_mix_dp_tl-\box_dp:N\l_mix_poster_box}{
- \box_use:N\l_mix_poster_box
- }
- }
+ \hbox_overlap_right:n{\box_use:N\l_mix_poster_box}
\str_if_eq_x:nnTF{\g_mix_usrpbtn_tl}{none}{
- \hbox_to_wd:nn{\l_mix_wd_tl}{
- \vrule~width~\c_zero_dim~height~\l_mix_ht_tl~depth~\l_mix_dp_tl\hss
+ \hbox_to_wd:nn{\g_mix_wd_tl}{
+ \vrule~width~\c_zero_dim~height~\g_mix_ht_tl~depth~\g_mix_dp_tl\hss
}
}{%insert play button overlay
\mix_insert_btnocg: %create OCG
\cs_gset_eq:Nc\mix_pbtn:NN{g@mix@pbtn@\g_mix_usrpbtn_tl @tl}
- \hbox_set:Nn\l_mix_pbtn_box{\mix_pbtn:NN\l_mix_wd_tl\l_mix_tt_tl}
- \box_move_down:nn{\l_mix_dp_tl}{
- \hbox_to_wd:nn{\l_mix_wd_tl}{
- \vbox_to_ht:nn{\l_mix_tt_tl}{
+ \hbox_set:Nn\l_mix_pbtn_box{\mix_pbtn:NN\g_mix_wd_tl\g_mix_tt_tl}
+ \box_move_down:nn{\g_mix_dp_tl}{
+ \hbox_to_wd:nn{\g_mix_wd_tl}{
+ \vbox_to_ht:nn{\g_mix_tt_tl}{
\vss
\mix_pdfbdc:nn{/OC}{\g_mix_btnocg_tl}
\box_use:N\l_mix_pbtn_box
@@ -1768,6 +1810,7 @@
}
\bool_new:N\g_mix_usrdraft_bool
+\bool_new:N\g_mix_usriso_bool
\bool_new:N\g_mix_usrattach_bool
\bool_new:N\g_mix_usrpbtn_bool
\bool_new:N\g_mix_opt_iiidview_bool
@@ -1811,11 +1854,28 @@
},
height .value_required:,
- depth .code:n = {
- \tl_gset:Nn\g_mix_dparg_tl{#1}
+ totalheight .code:n = {
+ \tl_gset:Nn\g_mix_ttarg_tl{#1}
\int_gadd:Nn\g_mix_resizeflag_int{\c_one}
},
- depth .value_required:,
+ height .value_required:,
+
+% depth .code:n = {
+% \tl_gset:Nn\g_mix_dparg_tl{#1}
+% \int_gadd:Nn\g_mix_resizeflag_int{\c_one}
+% },
+% depth .value_required:,
+
+ depth .code:n = {
+ \msg_warning:nnnn{media9}{deprecated~option}{depth}{
+ Ignoring~`depth'~option.
+ }
+ },
+
+ keepaspectratio .choice:,
+ keepaspectratio / true .code:n = {\bool_gset_true:N\g_mix_usriso_bool},
+ keepaspectratio / false .code:n = {\bool_gset_false:N\g_mix_usriso_bool},
+ keepaspectratio .default:n = {true},
scale .code:n = {\tl_gset:Nx\g_mix_scalearg_tl{#1}},
scale .value_required:,
diff --git a/Master/texmf-dist/tex/latex/media9/players/APlayer.swf b/Master/texmf-dist/tex/latex/media9/players/APlayer.swf
index 7cd39a8550a..6f1801bfacd 100644
--- a/Master/texmf-dist/tex/latex/media9/players/APlayer.swf
+++ b/Master/texmf-dist/tex/latex/media9/players/APlayer.swf
Binary files differ
diff --git a/Master/texmf-dist/tex/latex/media9/players/APlayer9.swf b/Master/texmf-dist/tex/latex/media9/players/APlayer9.swf
index 306fdbe7550..fccfc07adee 100644
--- a/Master/texmf-dist/tex/latex/media9/players/APlayer9.swf
+++ b/Master/texmf-dist/tex/latex/media9/players/APlayer9.swf
Binary files differ
diff --git a/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf b/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf
index 36c7c8d9d33..0bb9c638c44 100644
--- a/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf
+++ b/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf
Binary files differ
diff --git a/Master/texmf-dist/tex/latex/media9/players/VPlayer9.swf b/Master/texmf-dist/tex/latex/media9/players/VPlayer9.swf
index e2bfb405633..f2b23daedef 100644
--- a/Master/texmf-dist/tex/latex/media9/players/VPlayer9.swf
+++ b/Master/texmf-dist/tex/latex/media9/players/VPlayer9.swf
Binary files differ