summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/media9/media9.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-03-27 21:42:31 +0000
committerKarl Berry <karl@freefriends.org>2013-03-27 21:42:31 +0000
commit02aa64ea1b6cd28f8217d06507a941c70d39dd9a (patch)
treeadf9d2cdba672ede96760270fa056c19518c53af /Master/texmf-dist/doc/latex/media9/media9.tex
parent086cac171c683caf6fa19aa9e4c3bbbaa06ceeb4 (diff)
media9 (27mar13)
git-svn-id: svn://tug.org/texlive/trunk@29530 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/media9/media9.tex')
-rw-r--r--Master/texmf-dist/doc/latex/media9/media9.tex41
1 files changed, 30 insertions, 11 deletions
diff --git a/Master/texmf-dist/doc/latex/media9/media9.tex b/Master/texmf-dist/doc/latex/media9/media9.tex
index af7e936e45a..0bbd61553b5 100644
--- a/Master/texmf-dist/doc/latex/media9/media9.tex
+++ b/Master/texmf-dist/doc/latex/media9/media9.tex
@@ -497,7 +497,7 @@ jsaction=[<label key>:]{<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 key>+ is optional. If provided, it must be separated from \verb+<JavaScript code>+ by a colon. However, it is recommended to provide a label key. It ensures that \verb+annotRM['<label key>']+ is a valid JavaScript reference to the \verb+AnnotRichMedia+ object. \verb+annotRM['<label key>']+ 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 key>'].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 key>'].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.
-%\clearpage
+\clearpage
\section[Embedding Flash, video and sound (with examples)]{Embedding Flash, video and sound}
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.
@@ -563,7 +563,7 @@ keys & action\\\hline\hline
\end{tabular}
\end{table}
-\begin{table}[p]
+\begin{table}[bp]
\centering
\caption{Parameters (ActionScript variables) for media players `VPlayer.swf' and `APlayer.swf' shipping with media9. Parameters are passed as a `{\tt\&}'-separated string using `{\tt flashvars}' option.}\label{playerparams}
\begin{tabular}[t]{p{0.4\linewidth}p{0.5\linewidth}}\hline
@@ -579,7 +579,7 @@ parameter & description\\\hline\hline
\end{tabular}
\end{table}
-\begin{table}[p]
+\begin{table}[bp]
\centering
\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
@@ -597,7 +597,7 @@ function & argument &description\\\hline\hline
\end{tabular}
\end{table}
-\begin{table}[p]
+\begin{table}[bp]
\centering
\caption{Parameters (ActionScript variables) for `StrobeMediaPlayback.swf' shipping with media9. Parameters are passed as a `{\tt\&}'-separated string using `{\tt flashvars}' option.}\label{smpparams}
\begin{tabular}[t]{p{0.4\linewidth}p{0.5\linewidth}}\hline
@@ -619,7 +619,7 @@ parameter & description\\\hline\hline
\end{tabular}
\end{table}
-\begin{figure}[p]
+\begin{figure}[bp]
\centering
\begin{Verbatim}
\includemedia[
@@ -676,7 +676,7 @@ parameter & description\\\hline\hline
\caption{Example of playing back two different embedded MP4 video files in the same video player instance. The player, `VPlayer.swf', is also embedded in the PDF. Exposed ActionScript functions `{\tt playPause}' and `{\tt setSource}' of `VPlayer.swf' (Table~\ref{AVPlayerMethods}) are used to set-up media control buttons. Different button faces have been defined for the Play/Pause button.}\label{videoa}
\end{figure}
-\begin{figure}[p]
+\begin{figure}[bp]
\centering
\begin{Verbatim}
\includemedia[
@@ -706,6 +706,25 @@ parameter & description\\\hline\hline
%\flushright
\begin{Verbatim}
\includemedia[
+ addresource=bird.mp3,
+ flashvars={
+ source=bird.mp3
+ &autoPlay=true
+ },
+ transparent
+ ]{\color{blue}\framebox[0.4\linewidth][c]{Singing bird}}{APlayer.swf}
+\end{Verbatim}
+\makebox[\linewidth]{a)\hfill\includemedia[
+ addresource=bird.mp3,
+ flashvars={
+ source=bird.mp3
+ &autoPlay=true
+ },
+ transparent
+]{\color{blue}\framebox[0.5\linewidth][c]{Singing bird}}{APlayer.swf}
+\hfill}
+\vskip 4ex\begin{Verbatim}
+ \includemedia[
flashvars={
source=http://mp3.live.tv-radio.com/franceculture%
/all/franceculturehautdebit.mp3
@@ -717,7 +736,7 @@ parameter & description\\\hline\hline
contrib/media9/players/APlayer.swf%
}
\end{Verbatim}
-\makebox[\linewidth]{a)\hfill\includemedia[
+\makebox[\linewidth]{b)\hfill\includemedia[
flashvars={
source=http://mp3.live.tv-radio.com/franceculture/all/franceculturehautdebit.mp3
&autoPlay=true
@@ -736,16 +755,16 @@ http://mirrors.ibiblio.org/pub/mirrors/CTAN/macros/latex/contrib/media9/players/
&autoPlay=true
},
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}
\end{Verbatim}
-\makebox[\linewidth]{b)\hfill\includemedia[
+\makebox[\linewidth]{c)\hfill\includemedia[
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}
-\caption{Example of (a) streamed audio and (b) progressively downloaded MP3. In (a), the sound player, APlayer.swf, is loaded from a CTAN mirror upon activation.}\label{radio}
+]{\color{blue}\fbox{Listen to OpenBSD 4.9 release song}}{APlayer.swf}\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}
\clearpage