summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/flashmovie/flashmovie.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-04-19 22:52:14 +0000
committerKarl Berry <karl@freefriends.org>2010-04-19 22:52:14 +0000
commite8c4502da7b50b697f5ec08532a9d67b64abff0a (patch)
tree74795e45c1612d88c0cb860f2fc24502e3915696 /Master/texmf-dist/tex/latex/flashmovie/flashmovie.sty
parentb774596c0632c5e6b3bb370b24d8e0331ec9baff (diff)
flashmovie 0.2 (19apr10)
git-svn-id: svn://tug.org/texlive/trunk@17930 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/flashmovie/flashmovie.sty')
-rw-r--r--Master/texmf-dist/tex/latex/flashmovie/flashmovie.sty493
1 files changed, 458 insertions, 35 deletions
diff --git a/Master/texmf-dist/tex/latex/flashmovie/flashmovie.sty b/Master/texmf-dist/tex/latex/flashmovie/flashmovie.sty
index 3b8703fc231..051b5971da1 100644
--- a/Master/texmf-dist/tex/latex/flashmovie/flashmovie.sty
+++ b/Master/texmf-dist/tex/latex/flashmovie/flashmovie.sty
@@ -1,7 +1,7 @@
%%%%%%%%%%%%% flashmovie.sty
-%%%%%%%%%%%%% Copyright 2010 Timo Hartmann
+%%%%%%%%%%%%% Copyright 2010 Timo Hartmann (thartmann15 at googlemail.com)
%
-% Version 0.1
+% Version 0.2
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -13,11 +13,29 @@
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
+% This license applies to following files:
+% flashmovie.sty,test.tex,test-flv.tex,README
+%
+%
+%
+% The file "player_flv_maxi.swf" is NOT from me. This is the original flv-player
+% from http://flv-player.net whose developer is neolao.
+% This file is distributed under the MPL-license. See the directory
+% "flv-player-license" for more information. The file "license.txt" in that directory
+% is from the original source-code of the flv-player. A copy of the MPL-license is also
+% included there.
+%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% special thanks to following people for providing tips and improvements:
+% special thanks to following people for providing support, tips and improvements:
% - Elie Roux
% - Marco Aurélio Graciotto Silva
+% - neolao
+%
+% changelog:
+% 0.2 : 2010-04-21 : major overhaul: keyval 'engine', flv-player-engine,...
+% 0.1 : 2010-04-13 : a bunch of bugfixes
+% 0.0 : 2009-12-06 : initial release
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -35,6 +53,55 @@
% disadvantages:
% - You can only play back embedded videos with Adobe Reader 9 and upwards.
%
+% usage:
+% There are two fundamental different ways to embed videos via the
+% flash-component of the Adobe Reader:
+% - One can create a ".swf"-file and insert this directly
+% into the pdf. See example (1) below.
+% - One can create a ".mp4"-file and use that file as an input
+% to a flash-video-player which renders the videos.
+% Both files (the video and the flash-video-player) will be
+% embedded into the pdf. See example(2) below.
+% Different video formats (mp4/flv/whatever-the-flash-video-player-accepts/...)
+% can be used. Controls are available (depends on the player).
+% See example (2) below.
+%
+% flash-video-players:
+% There are several flash-video-players available which fit the needs
+% of flashmovie.sty. The different players can be selected with the key "engine",
+% for example: "\flashmovie[width=10cm,height=10cm,engine=flv-player]{saturn5.mp4}".
+%
+% The use of "engine=flv-player" is recommended, because it is supported best and
+% the flv-player is included in this distribution.
+%
+% List of flash-video-players:
+% - "engine=flv-player". This is an open-source player from http://flv-player.net.
+% It is included with this distribution (the file player_flv_maxi.swf).
+% The developer is neolao. See the directory flv-player-license for the license of it.
+% This is the player which flashmovie.sty supports best.
+%
+% supported parameters:
+% auto=0 --> auto-play off (default)
+% auto=1 --> auto-play on
+% image=some.jpeg --> start-image (not necessary)
+%
+% - "engine=acropro". This is an commercial player which is distributed with
+% Acrobat 9 Pro. You have to obtain VideoPlayer.swf and SkinOverPlaySeekStop.swf
+% from Acrobat 9 Pro and put them into the working directory in order to use that module.
+% It is NOT included in this distribution.
+% For this player flashmovie.sty only provides rudimentary support.
+% - "engine=jw-player". This is the JW player from http://www.longtailvideo.com/players/jw-flv-player.
+% You have to obtain player.swf from that site and put it in the working directory in order
+% to use this module.
+% It is NOT included with this distribution.
+% For this player flashmovie.sty only provides rudimentary support.
+% - "engine=osplayer". This is an open-source player from http://www.osflv.com
+% You have to obtain OSplayer.swf from that site and put it in the working directory in order
+% to use this module.
+% It is NOT included with this distribution.
+% For this player flashmovie.sty only provides rudimentary support.
+%
+%
% example (1)
% - download a video file to use, for example
% http://heasarc.gsfc.nasa.gov/Videos/historical/saturn5.avi
@@ -54,9 +121,6 @@
% - no controls (play,pause,stop,seek,...) possible
%
% example (2)
-% - warning: The following example assumes that you have obtained VideoPlayer.swf
-% and SkinOverPlaySeekStop.swf from Acrobat 9 Pro and put it into the working
-% directory.
% - download a video file to use, for example
% http://heasarc.gsfc.nasa.gov/Videos/historical/saturn5.avi
% - transform this video into the mp4 format with ffmpeg:
@@ -66,24 +130,16 @@
% mencoder saturn5.avi -o saturn5.flv -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=300:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -srate 22050 -ofps 24 -vf harddup -oac mp3lame -lameopts abr:br=56 )
% (or use ffmpeg to do the same thing...)
% - put following line into your tex-file:
-% \flashmoviex[width=10cm,height=10cm]{saturn5.mp4}
+% \flashmovie[width=10cm,height=10cm,engine=flv-player,auto=1]{saturn5.mp4}
% (both width and height are needed! instead of saturn5.mp4 one can also use saturn5.flv but not saturn5.swf)
% - translate with pdflatex
% - advantages:
% - controls (play,pause,stop,seek,...) possible
% - superior video codec possible (h.264)
% - one can directly embed mp4 and flv files without conversion
-% - disadvantages:
-% - use of external non-free components.
%
% todo:
-% - replace VideoPlayer.swf and SkinOverPlaySeekStop.swf by some freely available software.
-% it should be possible to program a simple video player with flexsdk and activescript.
-% the video-player should play mp4 and flv files and should and be capable of play,pause,seek,stop.
-% controls should be hide-able.
% - make more options of rich-media annotations usable, for example activation by clicking, play-count,...
-% - display a picture when the player is deactivated.
-% - efficient multiple inclusion of video files.
%
% warning:
% - Because the file names of the movies are directly embedded into the PDFs please use only
@@ -91,18 +147,59 @@
% There is even a specification what conforming file names are (see the PDF reference).
\RequirePackage{keyval}
+\RequirePackage{ifthen}
\ifnum\pdfminorversion<7 \pdfminorversion=7\fi
+\def\flashmovieempty{}
+\def\flashmoviezero{0}
+\def\flashmovieembedded{}
+
\def\flashmovieparamsclear{
\def\flashmoviewidth {4cm}
\def\flashmovieheight{4cm}
+ \def\flashmovieimage{}
+ \def\flashmovieauto{0}
+ \def\flashmovieengine{}
}
-\define@key{flashmovieparams}{width} {\def\flashmoviewidth {#1}}
-\define@key{flashmovieparams}{height} {\def\flashmovieheight {#1}}
+\define@key{flashmovieparams}{width} {\def\flashmoviewidth {#1}}
+\define@key{flashmovieparams}{height} {\def\flashmovieheight {#1}}
+\define@key{flashmovieparams}{image} {\def\flashmovieimage {#1}}
+\define@key{flashmovieparams}{auto} {\def\flashmovieauto {#1}}
+\define@key{flashmovieparams}{engine} {\def\flashmovieengine {#1}}
-\def\flashmovieembedfile#1{
+\newlength{\flashmovie@width}
+\newlength{\flashmovie@height}
+\newsavebox{\flashmovie@content}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% variable module %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \flashmovieset{a}{b} is equivalent to \def\a{b}
+% \flashmovieget{a} is equivalent to \a if a is defined and otherwise it is empty
+%
+% example:
+% \flashmovieset{aaa}{bla} \flashmovieget{aaa} ------> produces bla
+% \flashmovieget{bbb} ------> produces nothing if bbb is not defined
+
+\def\flashmovieset#1#2{{\expandafter\xdef\csname flashmovie@f@#1\endcsname{#2}}}
+
+% warning: command must be on one line so that there are no spaces generated !
+\def\flashmovieget#1{\expandafter\ifx\csname flashmovie@f@#1\endcsname\relax\expandafter\flashmovieempty\else\csname flashmovie@f@#1\endcsname\fi}
+
+%simpler:
+% \def\flashmovieset#1#2{{\expandafter\xdef\csname#1\endcsname{#2}}}
+% \def\flashmovieget#1{\expandafter\ifx\csname#1\endcsname\relax\expandafter\flashmovieempty\else\csname#1\endcsname\fi}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%% file embedding module %%%%%%%%%%%%%%%%%%%%%%%%
+%
+% usage:
+% \flashmovieembedfile{somefile}
+% \edef\flashmovie@e@somefile{\flashmovieembedded}
+
+\def\flashmovieembedfileinternal#1{
\immediate
\pdfobj stream
attr { /Type/EmbeddedFile }
@@ -116,29 +213,62 @@
>>}
}
-\newlength{\flashmovie@width}
-\newlength{\flashmovie@height}
-\newsavebox{\flashmovie@content}
+\def\flashmovieembedfile#1{
+ \ifthenelse{\equal{\flashmovieget{\pdfmdfivesum file {#1}}}{\flashmovieempty}}{
+ \flashmovieembedfileinternal{#1}
+ \def\flashmovieembedded{\the\pdflastobj}
+ \flashmovieset{\pdfmdfivesum file {#1}}{\flashmovieembedded}
+ }{
+ \def\flashmovieembedded{\flashmovieget{\pdfmdfivesum file {#1}}}
+ }
+}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\flashmovie{\@ifnextchar[\@flashmovie{\@flashmovie[]}}
\def\@flashmovie[#1]#2{\flashmovieparamsclear \setkeys{flashmovieparams}{#1}{
- \newcount\filespecnum
+ \ifx\flashmovieimage\flashmovieengine
+ \flashmovie@pureswf[#1]{#2}
+ \else
+
+ \ifthenelse{\equal{\flashmovieengine}{pure-swf}}
+ {\flashmovie@puresef[#1]{#2}}{}
+
+ \ifthenelse{\equal{\flashmovieengine}{flv-player}}
+ {\flashmovie@flvplayer[#1]{#2}}{}
+
+ \ifthenelse{\equal{\flashmovieengine}{acropro}}
+ {\flashmovie@acropro[#1]{#2}}{}
+
+ \ifthenelse{\equal{\flashmovieengine}{jw-player}}
+ {\flashmovie@jwplayer[#1]{#2}}{}
+
+ \ifthenelse{\equal{\flashmovieengine}{osplayer}}
+ {\flashmovie@osplayer[#1]{#2}}{}
+
+ \fi
+}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% pure swf
+
+\def\flashmovie@pureswf{\@ifnextchar[\@flashmovie@pureswf{\@flashmovie@pureswf[]}}
+
+\def\@flashmovie@pureswf[#1]#2{\flashmovieparamsclear \setkeys{flashmovieparams}{#1}{
\newcount\configurationnum
\newcount\contentnum
\newcount\settingsnum
\flashmovieembedfile{#2}
- \filespecnum=\pdflastobj
+ \edef\flashmovie@e@video{\flashmovieembedded}
\immediate
\pdfobj
{<<
/Instances
[<<
- /Asset \the\filespecnum\space 0 R
+ /Asset \flashmovie@e@video\space 0 R
/Params << /Binding /Foreground >>
>>]
/Subtype /Flash
@@ -148,7 +278,7 @@
\immediate
\pdfobj
{<<
- /Assets << /Names [(#2) \the\filespecnum\space 0 R] >>
+ /Assets << /Names [(#2) \flashmovie@e@video\space 0 R] >>
/Configurations [\the\configurationnum\space 0 R]
>>}
\contentnum=\pdflastobj
@@ -205,32 +335,30 @@
}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% player from adobe acrobat pro
-\def\flashmoviex{\@ifnextchar[\@flashmoviex{\@flashmoviex[]}}
+\def\flashmovie@acropro{\@ifnextchar[\@flashmovie@acropro{\@flashmovie@acropro[]}}
-\def\@flashmoviex[#1]#2{\flashmovieparamsclear \setkeys{flashmovieparams}{#1}{
- \newcount\filespecnum
- \newcount\filespecnumi
- \newcount\filespecnumii
+\def\@flashmovie@acropro[#1]#2{\flashmovieparamsclear \setkeys{flashmovieparams}{#1}{
\newcount\configurationnum
\newcount\contentnum
\newcount\settingsnum
\flashmovieembedfile{#2}
- \filespecnum=\pdflastobj
+ \edef\flashmovie@e@video{\flashmovieembedded}
\flashmovieembedfile{SkinOverPlaySeekStop.swf}
- \filespecnumi=\pdflastobj
+ \edef\flashmovie@e@skin{\flashmovieembedded}
\flashmovieembedfile{VideoPlayer.swf}
- \filespecnumii=\pdflastobj
+ \edef\flashmovie@e@player{\flashmovieembedded}
\immediate
\pdfobj
{<<
/Instances
[<<
- /Asset \the\filespecnumii\space 0 R
+ /Asset \flashmovie@e@player\space 0 R
/Params
<<
/Binding /Foreground
@@ -244,7 +372,7 @@
\immediate
\pdfobj
{<<
- /Assets << /Names [(#2) \the\filespecnum\space 0 R (skinover.swf) \the\filespecnumi\space 0 R (VideoPlayer.swf) \the\filespecnumii\space 0 R] >>
+ /Assets << /Names [(#2) \flashmovie@e@video\space 0 R (skinover.swf) \flashmovie@e@skin\space 0 R (VideoPlayer.swf) \flashmovie@e@player\space 0 R] >>
/Configurations [\the\configurationnum\space 0 R]
>>}
\contentnum=\pdflastobj
@@ -299,3 +427,298 @@
/RichMediaContent \the\contentnum\space 0 R
/RichMediaSettings \the\settingsnum\space 0 R
}}}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% flv-player from http://flv-player.net/players/maxi
+
+\def\flashmovie@flvplayer{\@ifnextchar[\@flashmovie@flvplayer{\@flashmovie@flvplayer[]}}
+
+\def\@flashmovie@flvplayer[#1]#2{\flashmovieparamsclear \setkeys{flashmovieparams}{#1}{
+ \newcount\configurationnum
+ \newcount\contentnum
+ \newcount\settingsnum
+
+ \flashmovieembedfile{#2}
+ \edef\flashmovie@e@video{\flashmovieembedded}
+
+ \flashmovieembedfile{player_flv_maxi.swf}
+ \edef\flashmovie@e@player{\flashmovieembedded}
+
+ % startimage is initialized here
+ \ifx\flashmovieimage\flashmovieempty
+ \def\flashmovieimagevari{}
+ \def\flashmovieimagevarii{}
+ \else
+ \flashmovieembedfile{\flashmovieimage}
+ \edef\flashmovie@e@image{\flashmovieembedded}
+ \def\flashmovieimagevari{&startimage=\flashmovieimage}
+ \def\flashmovieimagevarii{(\flashmovieimage) \flashmovie@e@image\space 0 R}
+ \fi
+
+ % autoplay is initialized here
+ \ifx\flashmovieauto\flashmoviezero
+ \def\flashmovieautovari{}
+ \else
+ \def\flashmovieautovari{&autoplay=1}
+ \fi
+
+ \immediate
+ \pdfobj
+ {<<
+ /Instances
+ [<<
+ /Asset \flashmovie@e@player\space 0 R
+ /Params
+ <<
+ /Binding /Foreground
+ /FlashVars (flv=#2&margin=0&showvolume=1&showstop=1&showtime=1&videobgcolor=0xFFFFFF&\flashmovieautovari\flashmovieimagevari&loop=1)
+ >>
+ >>]
+ /Subtype /Flash
+ >>}
+ \configurationnum=\pdflastobj
+
+ \immediate
+ \pdfobj
+ {<<
+ /Assets << /Names
+ [(#2) \flashmovie@e@video\space 0 R (player_flv_maxi.swf) \flashmovie@e@player\space 0 R \flashmovieimagevarii] >>
+ /Configurations [\the\configurationnum\space 0 R]
+ >>}
+ \contentnum=\pdflastobj
+
+ \immediate
+ \pdfobj
+ {<<
+ /Activation
+ << /Type /RichMediaActivation
+ /Condition /PO
+ /Configuration \the\configurationnum\space 0 R
+ /Animation
+ << /Subtype /Linear
+ /Speed 1
+ /Playcount 1
+ >>
+ /Presentation
+ << /PassContextClick false
+ /Style /Embedded
+ /Toolbar false
+ /NavigationPane false
+ /Transparent true
+ /Window
+ << /Type /RichMediaWindow
+ /Width << /Default 100 /Min 100 /Max 100 >>
+ /Height << /Default 100 /Min 100 /Max 100 >>
+ /Position
+ << /Type /RichMediaPosition
+ /HAlign /Near
+ /VAlign /Near
+ /HOffset 0
+ /VOffset 0
+ >>
+ >>
+ >>
+ >>
+ /Deactivation
+ << /Type /RichMediaDeactivation
+ /Condition /XD
+ >>
+ >>}
+ \settingsnum=\pdflastobj
+
+ \sbox{\flashmovie@content} {{\hbox to \flashmoviewidth {\vbox to \flashmovieheight { }}}}
+
+ \settowidth {\flashmovie@width} {\usebox{\flashmovie@content}}
+ \settoheight{\flashmovie@height}{\usebox{\flashmovie@content}}
+ \usebox{\flashmovie@content}
+
+ \pdfannot width \flashmovie@width height \flashmovie@height depth 0pt {
+ /Subtype /RichMedia
+ /RichMediaContent \the\contentnum\space 0 R
+ /RichMediaSettings \the\settingsnum\space 0 R }
+}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% JW Player from http://www.longtailvideo.com/players/jw-flv-player/
+
+\def\flashmovie@jwplayer{\@ifnextchar[\@flashmovie@jwplayer{\@flashmovie@jwplayer[]}}
+
+\def\@flashmovie@jwplayer[#1]#2{\flashmovieparamsclear \setkeys{flashmovieparams}{#1}{
+ \newcount\configurationnum
+ \newcount\contentnum
+ \newcount\settingsnum
+
+ \flashmovieembedfile{#2}
+ \edef\flashmovie@e@video{\flashmovieembedded}
+
+ \flashmovieembedfile{player.swf}
+ \edef\flashmovie@e@player{\flashmovieembedded}
+
+ \immediate
+ \pdfobj
+ {<<
+ /Instances
+ [<<
+ /Asset \flashmovie@e@player\space 0 R
+ /Params
+ <<
+ /Binding /Foreground
+ /FlashVars (file=#2)
+ >>
+ >>]
+ /Subtype /Flash
+ >>}
+ \configurationnum=\pdflastobj
+
+ \immediate
+ \pdfobj
+ {<<
+ /Assets << /Names
+ [(#2) \flashmovie@e@video\space 0 R (player.swf) \flashmovie@e@player\space 0 R] >>
+ /Configurations [\the\configurationnum\space 0 R]
+ >>}
+ \contentnum=\pdflastobj
+
+ \immediate
+ \pdfobj
+ {<<
+ /Activation
+ << /Type /RichMediaActivation
+ /Condition /PO
+ /Configuration \the\configurationnum\space 0 R
+ /Animation
+ << /Subtype /Linear
+ /Speed 1
+ /Playcount 1
+ >>
+ /Presentation
+ << /PassContextClick false
+ /Style /Embedded
+ /Toolbar false
+ /NavigationPane false
+ /Transparent true
+ /Window
+ << /Type /RichMediaWindow
+ /Width << /Default 100 /Min 100 /Max 100 >>
+ /Height << /Default 100 /Min 100 /Max 100 >>
+ /Position
+ << /Type /RichMediaPosition
+ /HAlign /Near
+ /VAlign /Near
+ /HOffset 0
+ /VOffset 0
+ >>
+ >>
+ >>
+ >>
+ /Deactivation
+ << /Type /RichMediaDeactivation
+ /Condition /XD
+ >>
+ >>}
+ \settingsnum=\pdflastobj
+
+ \sbox{\flashmovie@content} {{\hbox to \flashmoviewidth {\vbox to \flashmovieheight { }}}}
+
+ \settowidth {\flashmovie@width} {\usebox{\flashmovie@content}}
+ \settoheight{\flashmovie@height}{\usebox{\flashmovie@content}}
+ \usebox{\flashmovie@content}
+
+ \pdfannot width \flashmovie@width height \flashmovie@height depth 0pt {
+ /Subtype /RichMedia
+ /RichMediaContent \the\contentnum\space 0 R
+ /RichMediaSettings \the\settingsnum\space 0 R }
+}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% OSFlvPlayer from http://www.osflv.com
+
+\def\flashmovie@osplayer{\@ifnextchar[\@flashmovie@osplayer{\@flashmovie@osplayer[]}}
+
+\def\@flashmovie@osplayer[#1]#2{\flashmovieparamsclear \setkeys{flashmovieparams}{#1}{
+ \newcount\configurationnum
+ \newcount\contentnum
+ \newcount\settingsnum
+
+ \flashmovieembedfile{#2}
+ \edef\flashmovie@e@video{\flashmovieembedded}
+
+ \flashmovieembedfile{OSplayer.swf}
+ \edef\flashmovie@e@player{\flashmovieembedded}
+
+ \immediate
+ \pdfobj
+ {<<
+ /Instances
+ [<<
+ /Asset \flashmovie@e@player\space 0 R
+ /Params
+ <<
+ /Binding /Foreground
+ /FlashVars (movie=#2)
+ >>
+ >>]
+ /Subtype /Flash
+ >>}
+ \configurationnum=\pdflastobj
+
+ \immediate
+ \pdfobj
+ {<<
+ /Assets << /Names
+ [(#2) \flashmovie@e@video\space 0 R (OSplayer.swf) \flashmovie@e@player\space 0 R] >>
+ /Configurations [\the\configurationnum\space 0 R]
+ >>}
+ \contentnum=\pdflastobj
+
+ \immediate
+ \pdfobj
+ {<<
+ /Activation
+ << /Type /RichMediaActivation
+ /Condition /PO
+ /Configuration \the\configurationnum\space 0 R
+ /Animation
+ << /Subtype /Linear
+ /Speed 1
+ /Playcount 1
+ >>
+ /Presentation
+ << /PassContextClick false
+ /Style /Embedded
+ /Toolbar false
+ /NavigationPane false
+ /Transparent true
+ /Window
+ << /Type /RichMediaWindow
+ /Width << /Default 100 /Min 100 /Max 100 >>
+ /Height << /Default 100 /Min 100 /Max 100 >>
+ /Position
+ << /Type /RichMediaPosition
+ /HAlign /Near
+ /VAlign /Near
+ /HOffset 0
+ /VOffset 0
+ >>
+ >>
+ >>
+ >>
+ /Deactivation
+ << /Type /RichMediaDeactivation
+ /Condition /XD
+ >>
+ >>}
+ \settingsnum=\pdflastobj
+
+ \sbox{\flashmovie@content} {{\hbox to \flashmoviewidth {\vbox to \flashmovieheight { }}}}
+
+ \settowidth {\flashmovie@width} {\usebox{\flashmovie@content}}
+ \settoheight{\flashmovie@height}{\usebox{\flashmovie@content}}
+ \usebox{\flashmovie@content}
+
+ \pdfannot width \flashmovie@width height \flashmovie@height depth 0pt {
+ /Subtype /RichMedia
+ /RichMediaContent \the\contentnum\space 0 R
+ /RichMediaSettings \the\settingsnum\space 0 R }
+}} \ No newline at end of file