summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-04-03 23:40:51 +0000
committerKarl Berry <karl@freefriends.org>2012-04-03 23:40:51 +0000
commit538bf9cb8c628873e9682c8573fe6af45a6304bc (patch)
treea51362f7976c12f1470a977d2bd1ac12f24e3f14 /Master/texmf-dist/doc
parent65dea7bb3a3dfc2b4443ab2175f9e813daeafbcc (diff)
media9 (3apr12)
git-svn-id: svn://tug.org/texlive/trunk@25842 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc')
-rw-r--r--Master/texmf-dist/doc/latex/media9/ChangeLog7
-rw-r--r--Master/texmf-dist/doc/latex/media9/README12
-rw-r--r--Master/texmf-dist/doc/latex/media9/files/players/APlayer.mxml143
-rw-r--r--Master/texmf-dist/doc/latex/media9/files/players/BSD-License32
-rw-r--r--Master/texmf-dist/doc/latex/media9/files/players/SMPfixes.patch156
-rw-r--r--Master/texmf-dist/doc/latex/media9/files/players/StrobeMediaPlayback-license5
-rw-r--r--Master/texmf-dist/doc/latex/media9/files/players/VPlayer.mxml93
-rw-r--r--Master/texmf-dist/doc/latex/media9/media9.pdfbin1004035 -> 1260793 bytes
-rw-r--r--Master/texmf-dist/doc/latex/media9/media9.tex215
9 files changed, 564 insertions, 99 deletions
diff --git a/Master/texmf-dist/doc/latex/media9/ChangeLog b/Master/texmf-dist/doc/latex/media9/ChangeLog
index 8c71cf9651d..594998768aa 100644
--- a/Master/texmf-dist/doc/latex/media9/ChangeLog
+++ b/Master/texmf-dist/doc/latex/media9/ChangeLog
@@ -1,4 +1,9 @@
-2012-03-15
+2012-04-03
+ * v0.3
+ * fix: `deactivate' option did not work
+ * new: enhanced StrobeMediaPlayback.swf video player included
+
+2012-03-16
* v0.2
* new: LuaLaTeX support
* fix: wrong poster dimension in dvi output; fp numbers in PDF objects had
diff --git a/Master/texmf-dist/doc/latex/media9/README b/Master/texmf-dist/doc/latex/media9/README
index 6d6ee2b48d9..907d8d318bb 100644
--- a/Master/texmf-dist/doc/latex/media9/README
+++ b/Master/texmf-dist/doc/latex/media9/README
@@ -12,7 +12,7 @@ Description:
This package provides an interface to embed interactive Flash (SWF)
and 3D objects (Adobe U3D & PRC) as well as video and sound files or
-streams in the popular MP4, FLV and MP3 formats into PDF documents
+streams in the popular MP4, FLV, MP3 and AAC formats into PDF documents
with Acrobat-9/X compatibility. Playback of multimedia files uses the
built-in Flash Player of Adobe Reader and does, therefore, not depend
on external plug-ins. Flash Player supports the efficient H.264 codec
@@ -46,17 +46,15 @@ Requirements:
Installation:
-MiKTeX users should run the package manager for installation.
+MiKTeX and TeXLive users should run the package manager for installation.
-Unfortunately, `media9' is not in TeXLive. It must be installed manually
-into the local TeX-Directory-Structure (TDS) root directory along the
-following steps:
+Otherwise, a manual install into the local TeX-Directory-Structure
+(TDS) root directory can be done along the following steps:
1.) Download the TDS compliant package file
http://tug.ctan.org/tex-archive/install/macros/latex/contrib/media9.tds.zip.
-2.) Find the local TDS root directory which is intended for packages
-that are not maintained by the TeXLive package manager by running
+2.) Find the local TDS root directory by running
kpsewhich -var-value TEXMFLOCAL
diff --git a/Master/texmf-dist/doc/latex/media9/files/players/APlayer.mxml b/Master/texmf-dist/doc/latex/media9/files/players/APlayer.mxml
new file mode 100644
index 00000000000..67375fb6a06
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/media9/files/players/APlayer.mxml
@@ -0,0 +1,143 @@
+<?xml version="1.0"?>
+<!-- -->
+<!-- Adobe Flex 4 source file of APlayer.swf, -->
+<!-- a FlashPlayer-10 compatible component for playing -->
+<!-- MP3 audio files and streams. -->
+<!-- -->
+<!-- version 20120301 -->
+<!-- -->
+<!-- -->
+<!-- The free Adobe Flex 4 SDK is required to compile -->
+<!-- this file. Get it from -->
+<!-- -->
+<!-- http://www.adobe.com/products/flex/ -->
+<!-- -->
+<!-- and run -->
+<!-- -->
+<!-- mxmlc -static-link-runtime-shared-libraries APlayer.mxml -->
+<!-- -->
+<!-- on the command line. -->
+<!-- -->
+<!-- -->
+<!-- Copyright (C) 2012 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. -->
+<!-- -->
+
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ preinitialize="initialise(FlexGlobals.topLevelApplication.parameters);"
+ applicationComplete="initSound();addEventListener(Event.ENTER_FRAME, onEnterFrame);"
+ mouseDown="pause();"
+ mouseUp="play();"
+>
+
+ <fx:Script>
+ <![CDATA[
+ [Bindable] private var source:String;
+ [Bindable] private var autoPlay:Boolean=false;
+ [Bindable] private var loop:Boolean=false;
+ [Bindable] private var volume:Number=0.75;
+ [Bindable] private var balance:Number=0;
+
+ private var snd:Sound;
+ private var sndCh:SoundChannel;
+ private var sndTr:SoundTransform;
+ private var playResumePosition:Number = 0;
+ private var playing:Boolean = false;
+
+ 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.volume){volume=Number(flashVars.volume)}
+ if(flashVars.balance){balance=Number(flashVars.balance)}
+ }
+
+ import mx.controls.Alert;
+ private function initSound():void
+ {
+ snd = new Sound(new URLRequest(source));
+ sndTr = new SoundTransform(volume, balance);
+
+ snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
+ snd.addEventListener(ProgressEvent.PROGRESS, progressHandler);
+ snd.addEventListener(Event.COMPLETE, completeHandler);
+
+ if(autoPlay) play();
+ }
+
+ private function play():void
+ {
+ if (!playing)
+ {
+ try{sndCh = snd.play(playResumePosition, 0, sndTr);}
+ catch(err:Error){Alert.show(err.message,'Error');}
+ sndCh.addEventListener(Event.SOUND_COMPLETE, sndCompleteHandler);
+ playing = true;
+ }
+ }
+
+ private function pause():void
+ {
+ if (playing)
+ {
+ playResumePosition = sndCh.position;
+ sndCh.stop();
+ playing = false;
+ }
+ }
+
+ private function sndCompleteHandler(event:Event):void
+ {
+ playing = false;
+ playResumePosition = 0;
+ if(loop) play();
+ }
+
+ private function completeHandler(event:Event):void
+ {
+ playProgress.indeterminate=false;
+ }
+
+ import flash.events.ProgressEvent;
+ private function progressHandler(event:ProgressEvent):void{
+ playProgress.indeterminate=true;
+ if(playing){
+ playProgress.setProgress(0.5,1);
+ }
+ }
+
+ private function onEnterFrame(event:Event):void{
+ if(playProgress.indeterminate==false && playing){
+ playProgress.setProgress(sndCh.position,snd.length);
+ }
+ }
+
+ import flash.events.IOErrorEvent;
+ private function errorHandler(errorEvent:IOErrorEvent):void{
+ Alert.show(errorEvent.text + '\ncould not be loaded','Error');
+ }
+
+ ]]>
+ </fx:Script>
+
+ <mx:ProgressBar width="100%" mode="manual"
+ horizontalCenter="0" verticalCenter="0" labelPlacement="center"
+ label="" id="playProgress"
+ />
+</s:Application>
diff --git a/Master/texmf-dist/doc/latex/media9/files/players/BSD-License b/Master/texmf-dist/doc/latex/media9/files/players/BSD-License
new file mode 100644
index 00000000000..67b0fe71645
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/media9/files/players/BSD-License
@@ -0,0 +1,32 @@
+The BSD License
+
+Copyright (c) 2010, Adobe Systems Incorporated
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the following
+conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+* Neither the name of Adobe Systems Incorporated, nor the names of its
+contributors may be used to endorse or promote products derived from this
+software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/Master/texmf-dist/doc/latex/media9/files/players/SMPfixes.patch b/Master/texmf-dist/doc/latex/media9/files/players/SMPfixes.patch
new file mode 100644
index 00000000000..f5581f51f9d
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/media9/files/players/SMPfixes.patch
@@ -0,0 +1,156 @@
+######################################################################################################
+#
+# SMPfixes.patch, 20120330, Alexander Grahn
+#
+# Patch for StrobeMediaPlayback version 1.6.328 sources
+# http://sourceforge.net/projects/smp.adobe/files/
+#
+######################################################################################################
+# fix: video could not be restarted after having ended if AS variable `autoRewind' was set to `false'
+# new: show first frame of video as default poster instead of black stage
+# new: play/pause video by clicking on the stage
+######################################################################################################
+--- ./player/StrobeMediaPlayback/src/org/osmf/player/chrome/widgets/PlayButtonOverlay.as.orig 2012-03-23 16:04:41.000000000 +0100
++++ ./player/StrobeMediaPlayback/src/org/osmf/player/chrome/widgets/PlayButtonOverlay.as 2012-03-26 13:23:52.000000000 +0200
+@@ -98,6 +98,11 @@
+ override protected function onMouseClick(event:MouseEvent):void
+ {
+ var playable:PlayTrait = media.getTrait(MediaTraitType.PLAY) as PlayTrait;
++ var seekable:SeekTrait = media.getTrait(MediaTraitType.SEEK) as SeekTrait;
++ if(playable.playState == PlayState.STOPPED)
++ {
++ try{seekable.seek(0);}catch(e:Object){}
++ }
+ playable.play();
+ }
+
+--- ./player/StrobeMediaPlayback/src/org/osmf/player/chrome/widgets/PlayButton.as.orig 2012-03-26 13:22:33.000000000 +0200
++++ ./player/StrobeMediaPlayback/src/org/osmf/player/chrome/widgets/PlayButton.as 2012-03-26 16:03:07.000000000 +0200
+@@ -26,6 +26,7 @@
+ import org.osmf.traits.MediaTraitType;
+ import org.osmf.traits.PlayState;
+ import org.osmf.traits.PlayTrait;
++ import org.osmf.traits.SeekTrait;
+
+ public class PlayButton extends PlayableButton
+ {
+@@ -44,6 +45,11 @@
+ override protected function onMouseClick(event:MouseEvent):void
+ {
+ var playable:PlayTrait = media.getTrait(MediaTraitType.PLAY) as PlayTrait;
++ var seekable:SeekTrait = media.getTrait(MediaTraitType.SEEK) as SeekTrait;
++ if(playable.playState == PlayState.STOPPED)
++ {
++ try{seekable.seek(0);}catch(e:Object){}
++ }
+ playable.play();
+ event.stopImmediatePropagation();
+ }
+--- ./player/StrobeMediaPlayback/src/org/osmf/player/chrome/widgets/Slider.as.orig 2012-03-29 16:54:07.000000000 +0200
++++ ./player/StrobeMediaPlayback/src/org/osmf/player/chrome/widgets/Slider.as 2012-03-29 16:54:15.000000000 +0200
+@@ -106,7 +106,7 @@
+ if (_enabled && _sliding == false)
+ {
+ _sliding = true;
+- stage.addEventListener(MouseEvent.MOUSE_UP, onStageExitDrag);
++ stage.addEventListener(MouseEvent.MOUSE_UP, onStageExitDrag, true);
+ updateFace(down);
+ scrubTimer.start();
+ dispatchEvent(new ScrubberEvent(ScrubberEvent.SCRUB_START));
+--- ./player/StrobeMediaPlayback/src/StrobeMediaPlayback.as.orig 2012-03-23 15:44:09.000000000 +0100
++++ ./player/StrobeMediaPlayback/src/StrobeMediaPlayback.as 2012-03-30 15:00:42.000000000 +0200
+@@ -51,6 +51,7 @@
+ import org.osmf.traits.MediaTraitType;
+ import org.osmf.traits.PlayState;
+ import org.osmf.traits.PlayTrait;
++ import org.osmf.traits.SeekTrait;
+ import org.osmf.utils.OSMFSettings;
+ import org.osmf.utils.OSMFStrings;
+
+@@ -151,6 +152,7 @@
+
+ player.addEventListener(TimeEvent.COMPLETE, onComplete);
+ player.addEventListener(MediaErrorEvent.MEDIA_ERROR, onMediaError);
++ player.addEventListener(MediaPlayerCapabilityChangeEvent.CAN_PLAY_CHANGE, onCanPlayChange);
+
+ // this is used for DVR rolling window
+ // TODO: Add this event only when the resource is DVR rolling window not all the time
+@@ -266,6 +268,8 @@
+ mainContainer.backgroundAlpha = 0;
+ mainContainer.addEventListener(MouseEvent.DOUBLE_CLICK, onFullScreenRequest);
+ mainContainer.addEventListener(MouseEvent.CLICK, onMainClick, false);
++ mainContainer.addEventListener(MouseEvent.MOUSE_DOWN, onMainDown, false);
++ mainContainer.addEventListener(MouseEvent.MOUSE_UP, onMainUp, false);
+ mainContainer.doubleClickEnabled = true;
+
+ addChild(mainContainer);
+@@ -343,6 +347,9 @@
+ }
+
+ player.addEventListener(PlayEvent.PLAY_STATE_CHANGE, onSetAutoHide);
++
++ controlBarContainer.addEventListener(MouseEvent.MOUSE_DOWN, onControlBarAny, false);
++ controlBarContainer.addEventListener(MouseEvent.MOUSE_UP, onControlBarAny, false);
+
+ layout();
+
+@@ -654,6 +661,38 @@
+ }
+ }
+
++ private function onMainDown(event:MouseEvent):void
++ {
++ var playable:PlayTrait = player.media.getTrait(MediaTraitType.PLAY) as PlayTrait;
++ if (playable.playState == PlayState.PLAYING)
++ {
++ playable.pause();
++ }
++ }
++
++ private function onMainUp(event:MouseEvent):void
++ {
++ var playable:PlayTrait = player.media.getTrait(MediaTraitType.PLAY) as PlayTrait;
++ var seekable:SeekTrait = player.media.getTrait(MediaTraitType.SEEK) as SeekTrait;
++ if(playable.playState == PlayState.STOPPED)
++ {
++ if(player.canSeek){seekable.seek(0);}
++ playable.play();
++ }
++ else if(playable.playState == PlayState.PAUSED)
++ {
++ playable.play();
++ }
++ }
++
++ private function onControlBarAny(event:MouseEvent):void
++ {
++ if(event.eventPhase == EventPhase.BUBBLING_PHASE)
++ {
++ event.stopImmediatePropagation();
++ }
++ }
++
+ /**
+ * Toggles full screen state.
+ */
+@@ -928,12 +967,20 @@
+ && configuration.endOfVideoOverlay != ""
+ && player.loop == false
+ && player.playing == false
++ && player.autoRewind == true
+ )
+ {
+ processPoster(configuration.endOfVideoOverlay);
+ }
+ }
+
++ private function onCanPlayChange(event:MediaPlayerCapabilityChangeEvent):void
++ {
++ // Make sure this event gets handled only once:
++ player.removeEventListener(event.type, arguments.callee);
++ player.play(); player.stop();
++ }
++
+ private function onMediaError(event:MediaErrorEvent):void
+ {
+ // Make sure this event gets handled only once:
diff --git a/Master/texmf-dist/doc/latex/media9/files/players/StrobeMediaPlayback-license b/Master/texmf-dist/doc/latex/media9/files/players/StrobeMediaPlayback-license
new file mode 100644
index 00000000000..4a3d2ec8c0d
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/media9/files/players/StrobeMediaPlayback-license
@@ -0,0 +1,5 @@
+Strobe Media Playback is covered under the BSD Licence. See file BSD-License
+
+OSMF and NetMocker are covered under version 1.1 of the MPL Licence. You may obtain a copy of the License at http://www.mozilla.org/MPL/
+
+The font we used by the player, Playback Sans, is released under the SIL Open Font License - see file player/StrobeMediaPlayback/assets/font/PlaybackSansEULA.txt
diff --git a/Master/texmf-dist/doc/latex/media9/files/players/VPlayer.mxml b/Master/texmf-dist/doc/latex/media9/files/players/VPlayer.mxml
new file mode 100644
index 00000000000..9d070ed2d40
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/media9/files/players/VPlayer.mxml
@@ -0,0 +1,93 @@
+<?xml version="1.0"?>
+<!-- -->
+<!-- Adobe Flex 4 source file of VPlayer.swf, -->
+<!-- a FlashPlayer-10 compatible component for playing -->
+<!-- FLV and MP4/H.264 video files and streams. -->
+<!-- -->
+<!-- version 20120301 -->
+<!-- -->
+<!-- -->
+<!-- The free Adobe Flex 4 SDK is required to compile -->
+<!-- this file. Get it from -->
+<!-- -->
+<!-- http://www.adobe.com/products/flex/ -->
+<!-- -->
+<!-- and run -->
+<!-- -->
+<!-- mxmlc -static-link-runtime-shared-libraries VPlayer.mxml -->
+<!-- -->
+<!-- on the command line. -->
+<!-- -->
+<!-- -->
+<!-- Copyright (C) 2011 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. -->
+<!-- -->
+
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ preinitialize="initialise(FlexGlobals.topLevelApplication.parameters);"
+>
+ <fx:Script>
+ <![CDATA[
+ [Bindable] private var source:String;
+ [Bindable] private var autoPlay:Boolean=false;
+ [Bindable] private var loop:Boolean=false;
+ [Bindable] private var volume:Number=0.75;
+ private var vidComplete:Boolean=false;
+
+ 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.volume){volume=Number(flashVars.volume)}
+ }
+
+ import flash.events.ProgressEvent;
+ private function progressHandler(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{
+ vidComplete=false;
+ if(event.state=='playbackError')
+ Alert.show('Unable to play \''+event.target.source+'\'','Error');
+ }
+ ]]>
+ </fx:Script>
+
+ <s:VideoDisplay
+ id="vidDisp"
+ width="100%" height="100%" scaleMode="stretch"
+ source="{source}" volume="{volume}"
+ autoPlay="{autoPlay}" autoRewind="false" loop="{loop}"
+ mouseDown="vidDisp.pause();"
+ mouseUp="if(vidComplete){vidDisp.seek(0);}vidDisp.play();"
+ mediaPlayerStateChange="stateChangeHandler(event);"
+ complete="vidComplete=true;"
+ />
+
+ <mx:ProgressBar width="80%" mode="polled" source="vidDisp"
+ horizontalCenter="0" verticalCenter="0" labelPlacement="center"
+ id="loadingProgress" alpha="0.5"
+ complete="loadingProgress.visible=false;"
+ progress="progressHandler(event)"
+ />
+</s:Application>
diff --git a/Master/texmf-dist/doc/latex/media9/media9.pdf b/Master/texmf-dist/doc/latex/media9/media9.pdf
index 9a469702e9a..260f0b631f4 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 d8c003089b3..9a0f217f8bf 100644
--- a/Master/texmf-dist/doc/latex/media9/media9.tex
+++ b/Master/texmf-dist/doc/latex/media9/media9.tex
@@ -8,8 +8,8 @@
%\pdfobjcompresslevel=0
\documentclass[a4paper]{article}
\frenchspacing
-%\usepackage[draft]{media9}
\usepackage{media9}
+%\usepackage[draft]{media9}
\usepackage{animate}
\usepackage{fancyvrb}
@@ -26,7 +26,7 @@
\usepackage{tabls}
\usepackage{menukeys}
\usepackage{hyperref}
-\def\keywords{embed Flash movie LaTeX PDF 3D include sound swf mp3 video MP4 H.264 FLV audio multimedia streamed media rtmp YouTube animation JavaScript pdfLaTeX dvips ps2pdf dvipdfmx XeLaTeX U3D PRC Adobe Reader RichMedia annotation LuaLaTeX}
+\def\keywords{embed flash movie LaTeX pdf 3d include sound swf mp3 video mp4 h.264 aac flv audio multimedia streamed media rtmp YouTube animation JavaScript pdfLaTeX dvips ps2pdf dvipdfmx XeLaTeX u3d prc Adobe Reader RichMedia annotation LuaLaTeX}
\hypersetup{
bookmarksnumbered,linktocpage,breaklinks,
pdftitle={The media9 Package},
@@ -70,18 +70,18 @@
\maketitle
\begin{abstract}\noindent
-A \LaTeX{} package for embedding interactive Adobe Flash (SWF) and 3D files (Adobe U3D \& PRC) as well as video and sound files or streams (FLV, MP4/H.246, MP3) into PDF documents with Acrobat-9/X compatibility.\\[0.2\baselineskip]
+A \LaTeX{} package for embedding interactive Adobe Flash (SWF) and 3D files (Adobe U3D \& PRC) as well as video and sound files or streams (FLV, MP4/H.246, MP3, AAC) into PDF documents with Adobe Reader-9/X compatibility.\\[0.2\baselineskip]
\emph{Keywords}: \keywords
\end{abstract}
\tableofcontents
\section{Introduction}
-This package provides an interface to embed interactive Flash (SWF) and 3D objects (Adobe U3D \& PRC) as well as video and sound files or streams in the popular MP4, FLV and MP3 formats into PDF documents. Playback of multimedia files uses the built-in Flash Player of Adobe Reader and does, therefore, not depend on external plug-ins. Flash Player supports the efficient H.264 codec for video compression.
+This package provides an interface to embed interactive Flash (SWF) and 3D objects (Adobe U3D \& PRC) as well as video and sound files or streams in the popular MP4, FLV, MP3 and AAC formats into PDF documents. Playback of multimedia files uses the built-in Flash Player of Adobe Reader and does, therefore, not depend on external plug-ins. Flash Player supports the efficient H.264 codec for video compression.
-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 `Strobe Media Playback'~\cite{strobe}, maintained by Adobe and downloadable from SourceForge.net. Package `media9' comes with two simple players for video and audio, `VPlayer.swf' and `APlayer.swf', which can be used instead. They provide sufficient functionality for playing embedded files and streamed media.
+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/smp.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.
-\emph{Note:} `media9' package replaces the now obsolete `movie15' package. `media9' is based on the RichMedia Annotation, 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 external plug-ins and which does not support recent media file formats. Annotations are the interactive parts in a document, in PDF specification parlance.
+\emph{Note:} `media9' package replaces the now obsolete `movie15' package. `media9' is based on the RichMedia Annotation (Annotations are the interactive parts 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 external 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+.
@@ -98,9 +98,9 @@ The final PDF can be viewed in current Adobe Readers on MS Windows and other pla
\end{trivlist}
\section{Installation}
-MiK\TeX{} users should run the package manager for installation.
+MiK\TeX{} and \TeX{}Live users should run the package manager for installation and updates.
-Unfortunately, `media9' is not in TeXLive. It must be installed manually into the \emph{local} TeX-Directory-Structure (TDS) root directory along the following steps:
+Otherwise, a manual installation into the \emph{local} TeX-Directory-Structure (TDS) root directory is done along the following steps:
\begin{enumerate}
\item Download the TDS compliant package file `\href{http://tug.ctan.org/tex-archive/install/macros/latex/contrib/media9.tds.zip}{media9.tds.zip}' from CTAN.
\item Find the local TDS root directory by running\\
@@ -192,7 +192,9 @@ Every invocation of this option embeds another local file that is required to ru
\begin{verbatim}
flashvars={<some_var=some_val&another_var=another_val&...>}
\end{verbatim}
-(Flash only) Usually, Flash applications can be configured via ActionScript variables the programmer of the application has made visible from outside. A typical use would be to set the video source of a media player to point to an embedded MP4 file or to a live stream, or to set the speaker volume for playback of an MP3 file. The argument of the \verb+flashvars+ option is a list of \verb+<variable>=<value>+ pairs separated by `\verb+&+' and enclosed in a pair of braces (\verb+{...}+). Note: If a variable is to be set to point to an embedded resource, the value of the variable must be given in exactly the same way as with the `\verb+addresource+' option. Otherwise the name of the embedded file cannot be resolved. For example,
+(Flash only) Usually, Flash applications can be configured via ActionScript (AS) variables the programmer of the application has made visible from outside. A typical use would be to set the video source of a media player to point to an embedded MP4 file or to a live stream, or to set the speaker volume for playback of an MP3 file. The argument of the \verb+flashvars+ option is a list of \verb+<AS variable>=<value>+ pairs separated by `\verb+&+' and enclosed in a pair of braces (\verb+{...}+). String values of AS variables with embedded space characters must be put in quotes, e.\,g. \verb+string_var="... ..."+.
+
+Note: If a variable is to be set to point to an embedded resource, the value of the variable must be given in exactly the same way as with the `\verb+addresource+' option. Otherwise the name of the embedded file cannot be resolved. For example,
\begin{verbatim}
addresource=path/to/video.mp4
\end{verbatim}
@@ -206,11 +208,11 @@ if, for a particular media player, the video source is set through ActionScript
\begin{verbatim}
activate=onclick | pageopen | pagevisible
\end{verbatim}
-Decides on how to activate the media annotation. `\verb+activate=onclick+' is default behaviour and does not need be given explicitly; embedded media is activated when the user clicks on it or through a JavaScript. It is recommended to provide a poster image with the \verb+<poster text>+ argument in that case. `\verb+pageopen+' and `\verb+pagevisible+' automatically activate the media when the page becomes visible; `{\tt pagevisible}' is better for two-up and continuous page display.
+Decides on how to activate the media annotation. `\verb+activate=onclick+' is default behaviour and does not need be given explicitly; embedded media is activated when the user clicks on it or by a JavaScript. It is recommended to provide a poster image with the \verb+<poster text>+ argument in that case. `\verb+pageopen+' and `\verb+pagevisible+' automatically activate the media when the page becomes visible; `{\tt pagevisible}' is better for two-up and continuous page display.
\begin{verbatim}
deactivate=onclick | pageclose | pageinvisible
\end{verbatim}
-Decides on how to de-activate the media annotation. `\verb+deactivate=onclick+' is default behaviour and does not need be given explicitly; media is de-activated when the user right-clicks on it and selects `Disable Content', or through a JavaScript. `\verb+pageclose+' and `\verb+pageinvisible+' automatically de-activate the media when the user navigates away from the page containing the media; `{\tt page\-in\-visible}' is better for two-up and continuous page display.
+Decides on how to de-activate the media annotation. `\verb+deactivate=pageclose+' is default behaviour and does not need be given explicitly; media is automatically de-activated when the user leaves the page containing the media. `\verb+pageinvisible+' is similar, but may be better for two-up and continuous page display. Setting `\verb+deactivate=onclick+' requires user interaction for de-activating the media, either by right-click and chosing `\emph{\sffamily Disable Content}' or by a JavaScript.
\begin{verbatim}
draft
final
@@ -416,54 +418,81 @@ Things like animation, lighting, background of 3D objects etc. may also be scrip
A YouTube video clip, as shown in Fig.~\ref{alien}, may serve as a basic example of loading Flash content from a URL to be displayed in an embedded fashion in a PDF document. Indeed, a YouTube clip is nothing more than a small SWF file which loads a video stream and other necessary resources, such as user controls and a player skin from a remote server. It can be configured via ActionScript variables, to play several videos in a row, to play a video in a loop etc. Player parameters are documented on \url{http://code.google.com/apis/youtube/player_parameters.html} and can be passed to the player using either the `\verb+flashvars+' option, as in the example, or appended to the URL string after the video ID. A question mark `\verb+?+' must be put between the video ID and the parameter string. Some of the documented parameters, such as `\verb+rel+', seem to have an effect only if they are passed as part of the URL.
\begin{figure}[bp]
+\centering
\begin{Verbatim}
\includemedia[
width=0.6\linewidth,height=0.45\linewidth,
activate=pageopen,
- flashvars={%
- modestbranding=1% no YT logo in control bar
- &autohide=1% % controlbar autohide
- &showinfo=0% % no title and other info before start
- &rel=0% % no related videos after end
- },%
- url % Flash loaded from URL
+ flashvars={
+ modestbranding=1 % no YT logo in control bar
+ &autohide=1 % controlbar autohide
+ &showinfo=0 % no title and other info before start
+ &rel=0 % no related videos after end
+ },
+ url % Flash loaded from URL
]{}{http://www.youtube.com/v/Mdc3o7wOwNA?rel=0}
\end{Verbatim}
-%\begin{minipage}{0.5\linewidth}
-\begin{center}
+\vspace{1ex}
\includemedia[
width=0.6\linewidth,height=0.45\linewidth,
activate=pageopen,
- flashvars={%
- modestbranding=1% no YT logo in control bar
- &autohide=1% controlbar autohide
- &showinfo=0% no title and other info before start
-% &rel=0% no display of related videos
- },
- url
+ flashvars={
+ modestbranding=1 % no YT logo in control bar
+ &autohide=1 % controlbar autohide
+ &showinfo=0 % no title and other info before start
+ &rel=0 % no related videos after end
+ },
+ url % Flash loaded from URL
]{}{http://www.youtube.com/v/Mdc3o7wOwNA?rel=0}
-%]{}{http://www.youtube.com/v/k0BGuONQWUw?loop=1}
-\end{center}
-%\end{minipage}
\caption{A YouTube video as an example of a Flash application loaded from a URL.}\label{alien}
\end{figure}
-Video and sound files are always loaded and then played by a media player application. Two simple players, `VPlayer.swf' for video and `APlayer.swf' for sound, are installed along with the `media9.sty' package file. Although they do not have user controls, minimal interactivity for play, pause and resume is provided via left mouse button press and release. The players support MP4 video and MP3 sound files and streams. They were compiled, using the free Adobe Flex SDK~\cite{flex}, from XML source files which reside in the same directory as the players. More sophisticated players are available, e.\,g.~\cite{strobe}. There is no need to copy `VPlayer.swf' and `APlayer.swf' into the directory of the document source for embedding. They will be found by \LaTeX{} without taking any further action.
+Video and sound files are always loaded and then played by a media player application. Three players are installed along with the `media9.sty' package file: two simple players, `VPlayer.swf' for video and `APlayer.swf' for sound, and a fully blown one, `StrobeMediaPlayback.swf', with some fixes to improve its usability. The simple ones are `chromeless' players, that is, they do not have user controls. Minimal interactivity for play, pause and resume is still provided via left mouse button press and release. They were compiled, using the free Adobe Flex SDK~\cite{flex}, from XML files which reside in the \verb+doc/+ folder of the package installation. For `StrobeMediaPlayback.swf', only a patch file is included, as the sources can be downloaded elsewhere.
+
+The included version of `StrobeMediaPlayback.swf' is preferably to be used, as it is smaller than `VPlayer.swf' in terms of file size and it provides user controls. The improvements of `StrobeMediaPlayback.swf' in comparision to the original version on SourceForge.net are
+\begin{itemize}
+ \item fix: video could not be restarted after end of playback if ActionScript variable `{\tt autoRewind}' is set to `{\tt false}'
+ \item new: first frame of video is shown as default poster instead of black stage
+ \item new: play/pause video by clicking on the stage (as with `VPlayer.swf'), useful in a lecture situation
+\end{itemize}
-Like YouTube videos, media players are configured via ActionScript variables which are passed using option `\verb+flashvars+'. Table~\ref{playerparams} lists parameters available for VPlayer.swf and APlayer.swf.
+There is no need to copy the installed players into the directory of the document source for embedding. They will be found by \LaTeX{} without taking any further action.
-Playback of an embedded video is shown in Fig.~\ref{video}a. Besides embedded files, `VPlayer.swf' also supports video that is streamed from remote servers via HTTP and RTMP protocols, as shown in Fig.~\ref{video}b.
+Like YouTube videos, media players are configured via ActionScript variables which are passed using option `\verb+flashvars+'. Table~\ref{playerparams} lists parameters available for `VPlayer.swf' and `APlayer.swf', table~\ref{smpparams} for `StrobeMediaPlayback.swf'.
-\begin{table}
+Playback of an embedded video is shown in Fig.~\ref{video}a. Besides embedded files, also video streamed from remote servers via HTTP and RTMP protocols is supported, as shown in Fig.~\ref{video}b.
+
+\begin{table}[p]
\centering
-\caption{Parameters for media players VPlayer.swf and APlayer.swf shipping with media9. Parameters must be passed as `{\tt\&}'-separated string using `{\tt flashvars}' option.}\label{playerparams}
+\caption{Parameters (ActionScript variables) for media players `VPlayer.swf' and `APlayer.swf' shipping with media9. Parameters are passed as `{\tt\&}'-separated string using `{\tt flashvars}' option.}\label{playerparams}
\begin{tabular}[t]{p{0.4\linewidth}p{0.5\linewidth}}\hline
parameter & description\\\hline\hline
-{\tt source=<file path or URL>} & (required) path to embedded media file (see option `{\tt addresource}'), or URL (http, rtmp) to stream or online media file\\
+{\tt source=<file path or URL>} & (required) path to embedded media file (see option `{\tt addresource}'), or URL (http, rtmp) to online media file\\
{\tt autoPlay=true|false} & if {\tt=true}, automatically starts playback after activation (see option `{\tt activation})'\\
{\tt loop=true|false} & if {\tt=true}, media is played in a loop\\
-{\tt volume=<value between 0.0 and 1.0>} & sets volume of the sound\\
-{\tt balance=<value between -1.0 and 1.0>} & (APlayer.swf only) sets balance of sound speakers\\\hline
+{\tt volume=<value between 0.0 \phantom{.}\hfill{}and 1.0>} & sets volume of the sound\\
+{\tt balance=<value between \phantom{xxxx} \phantom{.}\hfill{}-1.0 and 1.0>} & (APlayer.swf only) sets balance of sound speakers\\\hline
+\end{tabular}
+\end{table}
+
+\begin{table}[p]
+\centering
+\caption{Parameters (ActionScript variables) for `StrobeMediaPlayback.swf' shipping with media9. Parameters are passed as `{\tt\&}'-separated string using `{\tt flashvars}' option.}\label{smpparams}
+\begin{tabular}[t]{p{0.4\linewidth}p{0.5\linewidth}}\hline
+parameter & description\\\hline\hline
+{\tt src=<file path or URL>} & (required) path to embedded media file (see option `{\tt addresource}'), or URL (http, rtmp) of online media file\\
+{\tt autoPlay=true|false} & default: {\tt false}; if {\tt=true}, automatically starts playback after activation (see option `{\tt activation})'\\
+{\tt autoRewind=true|false} & default: {\tt true}; if {\tt=false}, keep last frame after end of playback\\
+{\tt loop=true|false} & if {\tt=true}, media is played in a loop\\
+{\tt scaleMode=letterbox|none| \phantom{.}\hfill{}stretch|zoom} & default: {\tt letterbox}; determines how to scale the video in order to fit into player\\
+{\tt controlBarMode=docked|\phantom{xxxxxxxxxxxxxx} \phantom{.}\hfill{}floating|none} & default: {\tt docked}; determines position and visibility of control bar\\
+{\tt controlBarAutoHide=\phantom{xxxxxxx} \phantom{.}\hfill{}true|false} & default: {\tt true}; automatically hide or not control bar\\
+{\tt controlBarAutoHideTimeOut= \phantom{.}\hfill{}<number [s]>} & default: {\tt 3}; time span before auto-hide\\
+{\tt volume=<value between 0.0 \phantom{.}\hfill{}and 1.0>} & sets volume of the sound\\
+{\tt audioPan=<value between \phantom{xxxx} \phantom{.}\hfill{}-1.0 and 1.0>} & default: {\tt 0}; sets balance of sound speakers\\
+{\tt muted=true|false} & default: {\tt false}; mute or not sound\\
+{\tt clipStartTime=<number [s]>} & default: {\tt NaN}; time to start from\\
+{\tt clipEndTime=<number [s]>} & default: {\tt NaN}; time to end at\\\hline
\end{tabular}
\end{table}
@@ -474,66 +503,69 @@ parameter & description\\\hline\hline
width=0.4\linewidth,height=0.3\linewidth,
activate=pageopen,
addresource=files/random.mp4,
- flashvars={%
- source=files/random.mp4% same path as in addresource!
- &loop=true% loop video
+ flashvars={
+ source=files/random.mp4 % same path as in addresource!
+ &loop=true % loop video
}
]{}{VPlayer.swf}
\end{Verbatim}
+\vspace{1ex}
\makebox[\linewidth]{a)\hfill\includemedia[
width=0.6\linewidth,height=0.45\linewidth,
activate=pageopen,
addresource=files/random.mp4, %embeds video file
- flashvars={%
- source=files/random.mp4% same path as in addresource!
- &loop=true% % loop video
+ flashvars={
+ source=files/random.mp4 % same path as in addresource!
+ &loop=true % loop video
}
]{}{VPlayer.swf}\hfill}
\vskip 1ex
\begin{Verbatim}
\includemedia[
- width=0.6\linewidth,height=0.45\linewidth,
+ width=0.6\linewidth,height=0.3375\linewidth, % 16:9
activate=pageopen,
- flashvars={%
- autoPlay=true%
- &source=rtmp://streaming.music.indiana.edu:1935/onDemand/%
- mp4:media/20090327_VarRussianTheme-h264-480.m4v%
+ flashvars={
+ src=rtmp://streaming.music.indiana.edu:1935/onDemand/mp4:media/%
+ 20090327_VarRussianTheme-h264-480.m4v
+ &scaleMode=stretch
}
-]{}{VPlayer.swf}
+]{}{StrobeMediaPlayback.swf}
\end{Verbatim}
+\vspace{1ex}
\makebox[\linewidth]{b)\hfill\includemedia[
- width=0.6\linewidth,height=0.45\linewidth,
+ width=0.6\linewidth,height=0.3375\linewidth,
activate=pageopen,
- flashvars={%
- autoPlay=true%
- &source=rtmp://streaming.music.indiana.edu:1935/onDemand/mp4:media/20090327_VarRussianTheme-h264-480.m4v%
+ flashvars={
+ src=rtmp://streaming.music.indiana.edu:1935/onDemand/mp4:media/%
+ 20090327_VarRussianTheme-h264-480.m4v
+ &scaleMode=stretch
}
-]{}{VPlayer.swf}\hfill}
-\caption{Example of (a) an embedded MP4 video file and (b) streamed video from an RTMP server. Both examples use `VPlayer.swf', physically embedded in the PDF.}\label{video}
+]{}{StrobeMediaPlayback.swf}\hfill}
+\caption{Example of (a) an embedded MP4 video file and (b) streamed video from an RTMP server. First example uses `VPlayer.swf', the second one `StrobeMediaPlayBack.swf'. Both are physically embedded in the PDF.}\label{video}
\end{figure}
%\enlargethispage{2ex}
-Sound files and streams in the MP3 format can be played with `APlayer.swf'. Fig.~\ref{radio} contains examples of an audio live stream and a downloaded MP3 sound file. Instead of being embedded, the player is loaded from a CTAN mirror during runtime because an internet connection is required anyway for streaming the audio.
+Sound files and streams in the MP3 and AAC formats can be played with `APlayer.swf'. Fig.~\ref{radio} contains examples of an audio live stream and a downloaded MP3 sound file. Instead of being embedded, the player is loaded from a CTAN mirror during runtime because an internet connection is required anyway for streaming the audio.
\begin{figure}[bp]
%\flushright
\begin{Verbatim}
- \includemedia[
- flashvars={%
- source=http://mp3.live.tv-radio.com/franceculture%
- /all/franceculturehautdebit.mp3%
- &autoPlay=true%
- },
- url %refers to APlayer.swf, not to `source' flashvar!
- ]{\color{blue}\fbox{Listen live to Radio France Culture}}{%
- http://mirrors.ibiblio.org/pub/mirrors/CTAN/macros/latex/%
- contrib/media9/players/APlayer.swf%
- }
+ \includemedia[
+ flashvars={
+ source=http://mp3.live.tv-radio.com/franceculture%
+ /all/franceculturehautdebit.mp3
+ &autoPlay=true
+ },
+ url % refers to APlayer.swf, not to `source' flashvar!
+ ]{\color{blue}\fbox{Listen live to Radio France Culture}}{%
+ http://mirrors.ibiblio.org/pub/mirrors/CTAN/macros/latex/%
+ contrib/media9/players/APlayer.swf%
+ }
\end{Verbatim}
\makebox[\linewidth]{a)\hfill\includemedia[
- flashvars={%
- source=http://mp3.live.tv-radio.com/franceculture/all/franceculturehautdebit.mp3%
- &autoPlay=true%
+ flashvars={
+ source=http://mp3.live.tv-radio.com/franceculture/all/franceculturehautdebit.mp3
+ &autoPlay=true
},
url
]{\color{blue}\fbox{Listen live to Radio France Culture}}{%
@@ -543,25 +575,24 @@ http://mirrors.ibiblio.org/pub/mirrors/CTAN/macros/latex/contrib/media9/players/
}\hfill}
\vskip 4ex
\begin{Verbatim}
- \includemedia[
- flashvars={%
- source=http://www.openbsd.org/songs/song50.mp3%
- &autoPlay=true%
- },
- url
- ]{\color{blue}\fbox{Listen to OpenBSD 4.9 release song.}}{%
- http://mirrors.ibiblio.org/pub/mirrors/CTAN/macros/latex/%
- contrib/media9/players/APlayer.swf%
- }
+ \includemedia[
+ flashvars={
+ source=http://www.openbsd.org/songs/song50.mp3
+ &autoPlay=true
+ },
+ url
+ ]{\color{blue}\fbox{Listen to OpenBSD 4.9 release song.}}{%
+ http://mirrors.ibiblio.org/pub/mirrors/CTAN/macros/latex/%
+ contrib/media9/players/APlayer.swf%
+ }
\end{Verbatim}
\makebox[\linewidth]{b)\hfill\includemedia[
- flashvars={%
- source=http://www.openbsd.org/songs/song49.mp3%
- &autoPlay=true%
+ flashvars={
+ source=http://www.openbsd.org/songs/song50.mp3
+ &autoPlay=true
},
- url
+ url
]{\color{blue}\fbox{Listen to OpenBSD 4.9 release song.}}{%
-%APlayer.swf%
http://mirrors.ibiblio.org/pub/mirrors/CTAN/macros/latex/contrib/media9/players/APlayer.swf%
}\hfill}
\caption{Example of (a) streamed audio and (b) progressively downloaded MP3. The sound player, APlayer.swf, is loaded from a CTAN mirror upon activation.}\label{radio}
@@ -594,6 +625,7 @@ Additional resource files that are needed to render the 3D scene can be embedded
Below, two examples of embedded 3D files are shown. The first one, Fig.~\ref{asyex} is a PRC file generated with Asymptote. Note the text labels always facing the camera thanks to the attached 3D JavaScript file `asylabels.js'. The second example, Fig.~\ref{u3dex}, demonstrates the use of a views file which defines additional named views of the 3D object. Moreover, the possibilities of the extended 3D context menu can be evaluated. They were enabled by adding the `\verb+3Dmenu+' option to \verb+\includemedia+. All part and scene rendering attributes that can be changed via the `\emph{\sffamily Part Options}' and `\emph{\sffamily Viewing Options}' menu entries, as well as a cross section to be added with the `\emph{\sffamily Cross Section}' menu entry can be saved into a new view (`\emph{\sffamily Get Current View}'). Position, orientation and scaling of individual parts and of the cross section can be changed using the keyboard (keys \keys{\arrowkeyleft}, \keys{\arrowkeyright}, \keys{\arrowkeyup}, \keys{\arrowkeydown}, \keys{X}, \keys{\shift+X}, \keys{Y}, \keys{\shift+Y}, \keys{Z}, \keys{\shift+Z}, \keys{S}, \keys{\shift+S}).
\begin{figure}[bp]
+\centering
\begin{Verbatim}
\includemedia[
width=0.8\linewidth,height=0.8\linewidth,
@@ -608,7 +640,7 @@ Below, two examples of embedded 3D files are shown. The first one, Fig.~\ref{asy
3Dc2c=4 2 3
]{}{epix.prc}
\end{Verbatim}
-\centering
+\vspace{1ex}
\includemedia[
width=0.8\linewidth,height=0.8\linewidth,
activate=pageopen,
@@ -635,6 +667,7 @@ Below, two examples of embedded 3D files are shown. The first one, Fig.~\ref{asy
3Dmenu
]{}{dice.u3d}
\end{Verbatim}
+\vspace{1ex}
Contents of `dice.vws':
\begin{Verbatim}
VIEW=Front
@@ -699,9 +732,9 @@ Contents of `dice.vws':
\begin{itemize}
\item[a)] Open a text file, e.\,g. `myviews.vws', to be populated with additional views of the 3D object.
\item[b)] Manipulate the 3D object using the mouse (camera position) and via 3D context menu items `\emph{\sffamily Part Options}' and `\emph{\sffamily Viewing Options}' (visibility, rendering attributes, background etc.); the camera target can be moved into the centre of a single part via `\emph{\sffamily Part Options}'$\rightarrow$`\emph{\sffamily Zoom to Part}'.
- \item[c)] Add a cross section plane, adjust its position using the keyboard, keyboard keys are given \hyperlink{3dmenu}{here}.
- \item[d)] Adjust scaling and position of individual parts using the keyboard, keyboard keys are given \hyperlink{3dmenu}{here}.
- \item[e)] Re-adjust the camera distance using either `\emph{\sffamily Generate Default View}' or `\emph{\sffamily Part Options}'$\rightarrow$`\emph{\sffamily Fit Visible}'.
+ \item[c)] Add a cross section plane, adjust its position using the keyboard; keyboard keys are given \hyperlink{3dmenu}{here}.
+ \item[d)] Adjust scaling and position of individual parts using the keyboard; keyboard keys are given \hyperlink{3dmenu}{here}.
+ \item[e)] Re-adjust the camera distance using either `\emph{\sffamily Generate Default View}' or `\emph{\sffamily Part Options}'$\rightarrow$`\emph{\sffamily Fit Visible}'.
\item[f)] When you are done, select `\emph{\sffamily Get Current View}' to get the {\tt VIEW} section, readily formatted for insertion into the views file. Repeat steps (a)--(f) to get any number of views you want to define. The views file can be edited manually to give meaningful names to the views (change the value of the {\tt VIEW} key), or to further tweak camera settings, opacity, part options etc.
\item[g)] Attach the views file with option `{\tt 3Dviews}':
\begin{Verbatim}
@@ -712,7 +745,7 @@ Contents of `dice.vws':
3Dmenu
]{}{myfile.u3d}
\end{Verbatim}
- If you are satisfied with the predefined views in the views file, the default view first specified through the options of {\tt\string\includemovie} can be deleted. The first view in the views file becomes the default view then.
+ If you are satisfied with the predefined views in the views file, the default view first specified through the options of {\tt\string\includemovie} can be deleted. The first view in the views file becomes the default view then.
\end{itemize}
\item Associate any number of 3D JavaScript files with the 3D object:
\begin{Verbatim}