diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/flashmovie')
-rw-r--r-- | Master/texmf-dist/tex/latex/flashmovie/flashmovie.sty | 136 |
1 files changed, 100 insertions, 36 deletions
diff --git a/Master/texmf-dist/tex/latex/flashmovie/flashmovie.sty b/Master/texmf-dist/tex/latex/flashmovie/flashmovie.sty index 0603e59a3b9..865fa0a2505 100644 --- a/Master/texmf-dist/tex/latex/flashmovie/flashmovie.sty +++ b/Master/texmf-dist/tex/latex/flashmovie/flashmovie.sty @@ -1,9 +1,10 @@ %%%%%%%%%%%%% flashmovie.sty %%%%%%%%%%%%% Copyright 2010 Timo Hartmann (thartmann15 at googlemail.com) % -% Version 0.3 +% Version 0.4 % % changelog: +% 0.4 : 2010-09-13 : better support for jw-player, minor bug fixes % 0.3 : 2010-09-09 : better examples,minor bug fixes, issues with beamer explained % 0.2 : 2010-04-21 : major overhaul: keyval 'engine', flv-player-engine, % efficient multiple embedding of files,... @@ -72,6 +73,13 @@ % directly embedded. This works only for swf-files. % For other possible values of "engine" see the chapter "flash-video-players". % +% supported file formats: +% - flash animations ( ".swf" files) via direct embedding +% - mp4 movies (".mp4" files) via an embedded flash-video-player +% - flv movies (".flv" files) via an embedded flash-video-player +% +% attention: +% - avi videos (".avi" files) don't work ! % % flash-video-players: % There are several flash-video-players available which fit the needs @@ -79,9 +87,11 @@ % 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. +% the flv-player is included in this distribution. But there seems to be some +% incompatibilities of flv-player and beamer. See troubleshooting below. % % 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. @@ -92,16 +102,26 @@ % auto=1 --> auto-play on % image=someimage.jpeg --> start-image (not necessary) % +% - "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. Its released under a creative common license which means its free +% for non-commercial use. +% It is NOT included in this distribution. +% +% supported parameters: +% auto=0 --> auto-play off (default) +% auto=1 --> auto-play on +% image=someimage.jpeg --> start-image (not necessary) +% controlbar=0 --> no control bar shown +% controlbar=1 --> control bar shown (default) +% loop=0 --> do not loop the video (default) +% loop=1 --> loop the video +% % - "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 in 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. @@ -158,6 +178,12 @@ % - superior video codec possible (h.264) % - one can directly embed mp4 and flv files without conversion % +% how to produce swf-files: +% - ffmpeg or mencoder : transform a video file into a flash animation (example: .mp4 --> .swf) +% - png2swf : transform a sequence of png files into a flash animation (example: .png --> .swf) +% - flex sdk : use action script to program your own flash applet +% - mtasc and swfmill : use action script to program your own flash applet (outdated, should not be used) +% % todo: % - make more options of rich-media annotations usable, for example activation by clicking, play-count,... % @@ -182,13 +208,8 @@ % - There seems to be some trouble with the latex package beamer. You can't use % the flv-player reliably with it. It is prone to crash the acrobat reader while % changing pages. -% The only reliable way to use beamer is to directly embed the videos as -% flash animations. -% Another option is to use the JW player. It seems to work with beamer, -% but is only rudimentary supported. -% Any competent help on this issue would be appreciated. This might be -% another open source player which works with beamer or a fix of the flv-player -% or something else. +% The only reliable way to use beamer seems to be directly embedding the videos as +% flash animations or to use the JW player. % % warning: % - It is recommended to use always the latest available version of the Adobe Reader. @@ -214,6 +235,8 @@ \def\flashmovieauto{0} \def\flashmovieengine{} \def\flashmoviekblank{0} + \def\flashmoviecontrolbar{1} + \def\flashmovieloop{0} } \define@key{flashmovieparams}{width} {\def\flashmoviewidth {#1}} @@ -222,6 +245,8 @@ \define@key{flashmovieparams}{auto} {\def\flashmovieauto {#1}} \define@key{flashmovieparams}{engine} {\def\flashmovieengine {#1}} \define@key{flashmovieparams}{blank} {\def\flashmoviekblank {#1}} +\define@key{flashmovieparams}{controlbar} {\def\flashmoviecontrolbar{#1}} +\define@key{flashmovieparams}{loop} {\def\flashmovieloop{#1}} \newlength{\flashmovie@width} \newlength{\flashmovie@height} @@ -253,28 +278,28 @@ % \flashmovieembedfile{somefile} % \edef\flashmovie@e@somefile{\flashmovieembedded} -\def\flashmovieembedfileinternal#1{ - \immediate +\def\flashmovieembedfileinternal#1{% + \immediate% \pdfobj stream attr { /Type/EmbeddedFile } - file {#1} - \immediate - \pdfobj { << + file {#1}% + \immediate% + \pdfobj{ << /Type /Filespec /F (#1) /UF (#1) /EF << /F \the\pdflastobj\space 0 R >> - >>} + >>}% } -\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\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}}}% + }% } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -354,7 +379,7 @@ /Animation << /Subtype /Linear /Speed 1 - /Playcount 1 + /PlayCount 1 >> /Presentation << /PassContextClick false @@ -460,7 +485,7 @@ /Animation << /Subtype /Linear /Speed 1 - /Playcount 1 + /PlayCount 1 >> /Presentation << /PassContextClick false @@ -536,6 +561,13 @@ \def\flashmovieautovari{&autoplay=1} \fi + % looping is initialized here + \ifx\flashmovieloop\flashmoviezero + \def\flashmovieloopvari{&loop=0} + \else + \def\flashmovieloopvari{&loop=1} + \fi + \immediate \pdfobj {<< @@ -545,7 +577,7 @@ /Params << /Binding /Foreground - /FlashVars (flv=#2&margin=0&showvolume=1&showstop=1&showtime=1&videobgcolor=0xFFFFFF&\flashmovieautovari\flashmovieimagevari&loop=1) + /FlashVars (flv=#2&margin=0&showvolume=1&showstop=1&showtime=1&videobgcolor=0xFFFFFF\flashmovieautovari\flashmovieimagevari\flashmovieloopvari) >> >>] /Subtype /Flash @@ -571,7 +603,7 @@ /Animation << /Subtype /Linear /Speed 1 - /Playcount 1 + /PlayCount 1 >> /Presentation << /PassContextClick false @@ -628,6 +660,38 @@ \flashmovieembedfile{player.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{&image=\flashmovieimage} + \def\flashmovieimagevarii{(\flashmovieimage) \flashmovie@e@image\space 0 R} + \fi + + % autoplay is initialized here + \ifx\flashmovieauto\flashmoviezero + \def\flashmovieautovari{} + \else + \def\flashmovieautovari{&autostart=true} + \fi + + % controlbar is initialized here + \ifx\flashmoviecontrolbar\flashmoviezero + \def\flashmoviecontrolbarvari{&controlbar=none} + \else + \def\flashmoviecontrolbarvari{} + \fi + + % looping is initialized here + \ifx\flashmovieloop\flashmoviezero + \def\flashmovieloopvari{} + \else + \def\flashmovieloopvari{&repeat=always} + \fi + \immediate \pdfobj {<< @@ -637,7 +701,7 @@ /Params << /Binding /Foreground - /FlashVars (file=#2) + /FlashVars (file=#2\flashmovieimagevari\flashmovieautovari\flashmoviecontrolbarvari\flashmovieloopvari) >> >>] /Subtype /Flash @@ -648,7 +712,7 @@ \pdfobj {<< /Assets << /Names - [(#2) \flashmovie@e@video\space 0 R (player.swf) \flashmovie@e@player\space 0 R] >> + [(#2) \flashmovie@e@video\space 0 R (player.swf) \flashmovie@e@player\space 0 R \flashmovieimagevarii] >> /Configurations [\the\flashmovie@n@config\space 0 R] >>} \flashmovie@n@content=\pdflastobj @@ -663,7 +727,7 @@ /Animation << /Subtype /Linear /Speed 1 - /Playcount 1 + /PlayCount 1 >> /Presentation << /PassContextClick false @@ -755,7 +819,7 @@ /Animation << /Subtype /Linear /Speed 1 - /Playcount 1 + /PlayCount 1 >> /Presentation << /PassContextClick false |