From b1675bc8f4c698e26c644cf3f0c67765a66d27c1 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 20 Mar 2014 22:51:54 +0000 Subject: media9 (20mar14) git-svn-id: svn://tug.org/texlive/trunk@33237 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/media9/ChangeLog | 5 + Master/texmf-dist/doc/latex/media9/media9.pdf | Bin 3305538 -> 3319603 bytes Master/texmf-dist/doc/latex/media9/media9.tex | 6 +- Master/texmf-dist/tex/latex/media9/media9.sty | 201 +++++++++++++-------- .../tex/latex/media9/players/APlayer.swf | Bin 345957 -> 352533 bytes .../latex/media9/players/StrobeMediaPlayback.swf | Bin 275730 -> 275731 bytes .../tex/latex/media9/players/VPlayer.swf | Bin 502482 -> 509900 bytes 7 files changed, 136 insertions(+), 76 deletions(-) diff --git a/Master/texmf-dist/doc/latex/media9/ChangeLog b/Master/texmf-dist/doc/latex/media9/ChangeLog index c57a2e713dc..504d34d19de 100644 --- a/Master/texmf-dist/doc/latex/media9/ChangeLog +++ b/Master/texmf-dist/doc/latex/media9/ChangeLog @@ -1,3 +1,8 @@ +2014-03-21 + * v0.42 + * change: refined look for the play button overlay + * fix: minor bugs + 2014-03-06 * v0.41 * new: poster text, if provided, also shown in draft mode (instead of draft diff --git a/Master/texmf-dist/doc/latex/media9/media9.pdf b/Master/texmf-dist/doc/latex/media9/media9.pdf index a51a62414d4..364dcd5e233 100644 Binary files a/Master/texmf-dist/doc/latex/media9/media9.pdf and b/Master/texmf-dist/doc/latex/media9/media9.pdf differ diff --git a/Master/texmf-dist/doc/latex/media9/media9.tex b/Master/texmf-dist/doc/latex/media9/media9.tex index 0b07a0441d7..170ad0d0354 100644 --- a/Master/texmf-dist/doc/latex/media9/media9.tex +++ b/Master/texmf-dist/doc/latex/media9/media9.tex @@ -149,6 +149,7 @@ xetex bigfiles draft final +playbutton=... noplaybutton activate=... deactivate=... @@ -251,9 +252,10 @@ final \end{verbatim} With `\verb+draft+' the media is not embedded. Instead, a box is inserted that has the dimensions of \verb++, subject to the resizing options `\verb+width+', `\verb+height+', `\verb+depth+' and `\verb+scale+'. Option `\verb+final+' does the opposite as it forces the media to be embedded. Both options can be used to reduce compilation time during authoring of a document. To get the most out of them it is recommended to set `\verb+draft+' globally as a package or class option and to set `\verb+final+' locally as a command option of the media annotation that is currently worked on. After the document has been finished, the global `\verb+draft+' option can be removed. \begin{verbatim} - noplaybutton +playbutton[= fancy | plain | none] +noplaybutton \end{verbatim} -Disables the transparent play button normally laid over the inactive media annotation. +By default, a transparent play button is laid over the inactive media annotation to draw the reader's attention to the embedded multimedia content. It is provided in two versions, `\verb+fancy+' and `\verb+plain+', but only `\verb+plain+' is available in the \XeLaTeX{} workflow. The default setting is to try the `\verb+fancy+' version. `\verb+noplaybutton+' or `\verb+playbutton=none+' disable the play button overlay. \begin{verbatim} windowed[= false | [x][@] ] \end{verbatim} diff --git a/Master/texmf-dist/tex/latex/media9/media9.sty b/Master/texmf-dist/tex/latex/media9/media9.sty index 5b099609fd2..9f8e54cff82 100644 --- a/Master/texmf-dist/tex/latex/media9/media9.sty +++ b/Master/texmf-dist/tex/latex/media9/media9.sty @@ -42,8 +42,8 @@ \RequirePackage{atbegshi} \RequirePackage{tikz} -\def\g@mix@date@tl{2014/03/06} -\def\g@mix@version@tl{0.41} +\def\g@mix@date@tl{2014/03/21} +\def\g@mix@version@tl{0.42} \def\g@mix@liiikerneldate{2013/07/28} \def\g@mix@liiipkgdate{2013/07/28} @@ -121,8 +121,7 @@ \tl_gclear:N\g_mix_pkgopt_ls_tl \tl_gclear:N\g_mix_pkgopt_rm_tl \bool_new:N\g_mix_pkgiiidcalc_bool -\bool_new:N\g_mix_pkgpbtn_bool -\bool_gset_true:N\g_mix_pkgpbtn_bool +\tl_gset:Nn\g_mix_pkgpbtn_tl{fancy} %floating window settings \group_begin: @@ -169,10 +168,15 @@ final .default:n = {true}, noplaybutton .choice:, - noplaybutton / true .code:n = {\bool_gset_false:N\g_mix_pkgpbtn_bool}, - noplaybutton / false .code:n = {\bool_gset_true:N\g_mix_pkgpbtn_bool}, + noplaybutton / true .code:n = {\tl_gset:Nn\g_mix_pkgpbtn_tl{none}}, noplaybutton .default:n = {true}, + playbutton .choice:, + playbutton / fancy .code:n = {\tl_gset:Nn\g_mix_pkgpbtn_tl{fancy}}, + playbutton / plain .code:n = {\tl_gset:Nn\g_mix_pkgpbtn_tl{plain}}, + playbutton / none .code:n = {\tl_gset:Nn\g_mix_pkgpbtn_tl{none}}, + playbutton .default:n = {fancy}, + activate .choice:, activate / pagevisible .code:n = {\tl_gset:Nn\g_mix_pkgact_tl{/PV}}, activate / pageopen .code:n = {\tl_gset:Nn\g_mix_pkgact_tl{/PO}}, @@ -366,7 +370,7 @@ \box_clear:N\l_mix_poster_box \tl_clear:N\l_mix_scripts_tl \bool_gset_eq:NN\g_mix_usrdraft_bool\g_mix_pkgdraft_bool - \bool_gset_eq:NN\g_mix_usrpbtn_bool\g_mix_pkgpbtn_bool + \tl_gset_eq:NN\g_mix_usrpbtn_tl\g_mix_pkgpbtn_tl \seq_gclear:N\g_mix_res_seq \seq_gclear:N\g_mix_script_seq \int_gzero:N\g_mix_resizeflag_int @@ -507,16 +511,14 @@ } } \cs_new:Nn\mix_insert_btnocg:{%OCG for play button overlay - \tl_if_exist:NF\g_mix_btnocg_tl{ - \mix_pdfobj:nnn{}{dict}{ - /Type/OCG/Name~(MediaPlayButton) - /Usage<>/Export<>>> - } - \tl_gput_right:Nx\@anim@ocgs{\space\g_mix_pdflastobj_tl} - \tl_gput_right:Nx\@anim@offocgs{\space\g_mix_pdflastobj_tl} - \tl_gset:Nx\g_mix_btnocg_tl{\g_mix_pdflastobj_tl} + \mix_pdfobj:nnn{}{dict}{ + /Type/OCG/Name~(MediaPlayButton\int_use:N\g_mix_rmcnt_int) + /Usage<>/Export<>>> } - \mix_pdfresources:n{/Properties<>} + \tl_gput_right:Nx\@anim@ocgs{\space\g_mix_pdflastobj_tl} + \tl_gput_right:Nx\@anim@offocgs{\space\g_mix_pdflastobj_tl} + \tl_gset:Nx\g_mix_btnocg_tl{\g_mix_pdflastobj_tl} + \mix_pdfresources: } %commands for creating PDF objects, annots etc. @@ -583,13 +585,21 @@ } \cs_new:Nn\mix_pdfcatalog:n{\pdfcatalog{#1}} - \cs_new:Nn\mix_pdfresources:n{ + + \tl_new:N\g_mix_ocgnames_tl + \cs_new:Nn\mix_pdfresources:{ + \tl_gput_right:Nx\g_mix_ocgnames_tl{ + ~/OC@rm@play@\int_use:N\g_mix_rmcnt_int\space\g_mix_btnocg_tl} \group_begin: \tl_set:Nx\l_mix_temp_tl{\group_end: - \global\pdfpageresources{\the\pdfpageresources #1} + \global\pdfpageresources{\the\pdfpageresources + /Properties<<\g_mix_ocgnames_tl>> + } }\l_mix_temp_tl } - \cs_new:Nn\mix_pdfbdc:{\pdfliteral{/OC/OC@rm@play~BDC}} + \cs_new:Nn\mix_pdfbdc:{ + \pdfliteral{/OC/OC@rm@play@\int_use:N\g_mix_rmcnt_int\space BDC} + } \cs_new:Nn\mix_pdfemc:{\pdfliteral{EMC}} }{ \int_new:N\g_mix_obj_int % object ID @@ -673,8 +683,13 @@ } \cs_new:Nn\mix_pdfcatalog:n{\special{pdf:put~@catalog~<<#1>>}} - \cs_new:Nn\mix_pdfresources:n{\special{pdf:put~@resources~<<#1>>}} - \cs_new:Nn\mix_pdfbdc:{\special{pdf:~content~/OC/OC@rm@play~BDC}} + \cs_new:Nn\mix_pdfresources:{\special{pdf:put~@resources~<< + /Properties<> + >>}} + \cs_new:Nn\mix_pdfbdc:{ + \special{pdf:~content~/OC/OC@rm@play@\int_use:N\g_mix_rmcnt_int\space BDC} + } \cs_new:Nn\mix_pdfemc:{\special{pdf:~content~EMC}} }{ % dvips @@ -950,7 +965,7 @@ \special{ps:~mark~{Catalog}~<<#1>>~/PUT~pdfmark} } - \cs_new:Nn\mix_pdfresources:n{} %no-op + \cs_new:Nn\mix_pdfresources:{} %no-op, Distiller does it automatically \cs_new:Nn\mix_pdfbdc:{\special{ps:~mark~/OC~\g_mix_btnocg_tl~/BDC~pdfmark}} \cs_new:Nn\mix_pdfemc:{\special{ps:~mark~/EMC~pdfmark}} } @@ -1036,14 +1051,10 @@ } %add FileSpec to assets tree of current annot \cs_if_exist:cF{fileAsset_\int_use:c{g_mix_rmcnt_int}_#1}{ - \tl_gput_right:Nx\g_mix_assets_tl{ - ~(#1)~\tl_use:c{ImgFileSpecFor3D_#1} - } + \tl_gput_right:Nx\g_mix_assets_tl{~(#1)~\tl_use:c{ImgFileSpecFor3D_#1}} \tl_new:c{fileAsset_\int_use:c{g_mix_rmcnt_int}_#1} } - \tl_gset:Nx\g_mix_lastasset_tl{ - \tl_use:c{ImgFileSpecFor3D_#1} - } + \tl_gset:Nx\g_mix_lastasset_tl{\tl_use:c{ImgFileSpecFor3D_#1}} }{ %remaining file types in 3D context and any file type in case of Flash %context will be embedded as ordinary fstreams; @@ -1056,23 +1067,17 @@ %create FileSpec for current file name if not yet existent \cs_if_exist:cF{fileSpec_#1}{ \mix_pdfobj:nnn{}{dict}{ - /Type/Filespec - /F~(#1) - /UF~(#1) + /Type/Filespec/F~(#1)/UF~(#1) /EF~<> } \tl_gset:cx{fileSpec_#1}{\g_mix_pdflastobj_tl} } %add FileSpec to assets tree of current annot \cs_if_exist:cF{fileAsset_\int_use:c{g_mix_rmcnt_int}_#1}{ - \tl_gput_right:Nx\g_mix_assets_tl{ - ~(#1)~\tl_use:c{fileSpec_#1} - } + \tl_gput_right:Nx\g_mix_assets_tl{~(#1)~\tl_use:c{fileSpec_#1}} \tl_new:c{fileAsset_\int_use:c{g_mix_rmcnt_int}_#1} } - \tl_gset:Nx\g_mix_lastasset_tl{ - \tl_use:c{fileSpec_#1} - } + \tl_gset:Nx\g_mix_lastasset_tl{\tl_use:c{fileSpec_#1}} } } } @@ -1206,19 +1211,42 @@ \NewDocumentCommand\addmediapath{m}{\file_path_include:n{#1/}} -%play button overlay +%play button overlay; two versions: fancy and plain \box_new:N\l_mix_pbtn_box \ExplSyntaxOff -\def\g@mix@pbtn@tl{% - \tikz[opacity=.7,transparency group]{% - \useasboundingbox (-5,-5) rectangle (5,5); - \fill [color=gray,even odd rule] (0,0) circle (2.5) - (-0.95,1.4)--(-0.95,-1.4)--+(30:2.8)--cycle; - \fill [color=white] (-0.95,1.4)--(-0.95,-1.4)--+(30:2.8)--cycle; +\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]{% + \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] + (-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]{% + \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); + (0,0) circle (0.4); + \fill [color=black,opacity=0.5] (0,0) circle (0.4); + \fill [color=white,opacity=0.8] + (-0.152,0.224)--(-0.152,-0.224)--+(30:0.4844)--cycle; }% } \ExplSyntaxOn -\tl_set_eq:NN\g_mix_pbtn_tl\g@mix@pbtn@tl \ior_new:N\l_mix_vfile_stream %file stream for 3D views files \NewDocumentCommand\includemedia{O{}mm}{%#1 options, #2 text/image #3 media file @@ -1246,7 +1274,8 @@ \dim_compare_p:n{\l_mix_tt_tl=\c_zero_dim}|| \dim_compare_p:n{\l_mix_wd_tl=\c_zero_dim} }{ - \bool_gset_false:N\g_mix_usrpbtn_bool + %\bool_gset_false:N\g_mix_usrpbtn_bool + \tl_gset:Nn\g_mix_usrpbtn_tl{none} } \bool_if:NTF\g_mix_usrdraft_bool{ \tl_if_empty:NF\g_mix_usrlabel_tl{ @@ -1260,6 +1289,24 @@ } } }{ + \bool_if:nF{\str_if_eq_p:Vn\g_mix_usrpbtn_tl{none}}{ + %attach script that switches off play button overlay upon activation + \mix_pdfobj:nnn{}{stream}{ + var~ocgs=host.getOCGs(host.pageNum); + for(var~i=0;i> + } + \tl_gset:Nx\g_mix_assets_tl{(btnoff)~\g_mix_pdflastobj_tl} + \tl_set:Nx\l_mix_scripts_tl{\g_mix_pdflastobj_tl} + %enforce plain playbutton overlay for XeTeX + \xetex_if_engine:T{\tl_gset:Nn\g_mix_usrpbtn_tl{plain}} + } %embed main asset \mix_uribegin: \mix_embedasset:n{#3} @@ -1288,7 +1335,7 @@ %attach 3D calculation script \bool_if:nT{\g_mix_iiid_bool && \g_mix_iiidcalc_bool}{ \mix_embedasset:n{3Dmenu.js} - \tl_put_left:Nx\l_mix_scripts_tl{~\g_mix_lastasset_tl} + \tl_put_left:Nx\l_mix_scripts_tl{\g_mix_lastasset_tl~} } %create 3D views from file (option 3Dviews) \bool_if:nT{\g_mix_iiid_bool && !(\tl_if_blank_p:V\g_mix_vfile_tl)}{ @@ -1454,21 +1501,28 @@ \mix_pdfobj:nnn{}{dict}{ /S/JavaScript/JS~( try{ - var~ocgAll=this.getOCGs(this.pageNum); - for(var~i=0;i=9 - )ocgAll[i].state=true; - } - \tl_if_empty:NF\g_mix_usrlabel_tl{ - if(typeof(annotRM)=='undefined'){annotRM=new~Array();} - if(typeof(annotRM['\g_mix_label_tl'])=='undefined'){ - annotRM['\g_mix_label_tl']= - this.getAnnotRichMedia(this.pageNum,'\g_mix_label_tl'); + ){ + ocgBtn\int_use:N\g_mix_rmcnt_int.state=true; } } }catch(e){} @@ -1489,33 +1543,25 @@ \box_use:N\l_mix_poster_box } } - \bool_if:NTF\g_mix_usrpbtn_bool{ - %scale and insert play button overlay + \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 + } + }{%insert play button overlay \mix_insert_btnocg: %create OCG \mix_insert_ocprops: - \hbox_set:Nn\l_mix_pbtn_box{\g_mix_pbtn_tl} - \dim_compare:nTF{\l_mix_tt_tl>\l_mix_wd_tl}{ - \box_resize_to_wd:Nn\l_mix_pbtn_box{\l_mix_wd_tl} - }{ - \box_resize_to_ht_plus_dp:Nn\l_mix_pbtn_box{\l_mix_tt_tl} - } + \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}{ - \hss \vbox_to_ht:nn{\l_mix_tt_tl}{ \vss \mix_pdfbdc: \box_use:N\l_mix_pbtn_box \mix_pdfemc: - \vss } - \hss } } - }{ - \hbox_to_wd:nn{\l_mix_wd_tl}{ - \vrule~width~\c_zero_dim~height~\l_mix_ht_tl~depth~\l_mix_dp_tl\hss - } } \int_gincr:N\g_mix_rmcnt_int } @@ -1781,10 +1827,15 @@ final .default:n = {true}, noplaybutton .choice:, - noplaybutton / true .code:n = {\bool_gset_false:N\g_mix_usrpbtn_bool}, - noplaybutton / false .code:n = {\bool_gset_true:N\g_mix_usrpbtn_bool}, + noplaybutton / true .code:n = {\tl_gset:Nn\g_mix_usrpbtn_tl{none}}, noplaybutton .default:n = {true}, + playbutton .choice:, + playbutton / fancy .code:n = {\tl_gset:Nn\g_mix_usrpbtn_tl{fancy}}, + playbutton / plain .code:n = {\tl_gset:Nn\g_mix_usrpbtn_tl{plain}}, + playbutton / none .code:n = {\tl_gset:Nn\g_mix_usrpbtn_tl{none}}, + playbutton .default:n = {fancy}, + transparent .choice_code:n = {\tl_gset:Nx\g_mix_transp_tl{\l_keys_choice_tl}}, transparent .generate_choices:n = {true,false}, transparent .default:n = {true}, @@ -2371,6 +2422,7 @@ \cs_generate_variant:Nn\regex_match:nnTF{nV} \cs_generate_variant:Nn\regex_match:nnT{nV} \cs_generate_variant:Nn\tl_if_blank:nF{c} +\cs_generate_variant:Nn\tl_if_eq:NNTF{Vn} \bool_new:N\g_mix_btndraft_bool \keys_define:nn{media9/mbtndraft}{ @@ -2620,3 +2672,4 @@ } \group_end: } +\bool_if:NF\g_mix_pdfoutput_bool{\mix_insert_ocprops:\mix_insert_acroform:} diff --git a/Master/texmf-dist/tex/latex/media9/players/APlayer.swf b/Master/texmf-dist/tex/latex/media9/players/APlayer.swf index c2dfb45b19f..7cd39a8550a 100644 Binary files a/Master/texmf-dist/tex/latex/media9/players/APlayer.swf and b/Master/texmf-dist/tex/latex/media9/players/APlayer.swf differ diff --git a/Master/texmf-dist/tex/latex/media9/players/StrobeMediaPlayback.swf b/Master/texmf-dist/tex/latex/media9/players/StrobeMediaPlayback.swf index 384db3fd03c..185759fd39c 100644 Binary files a/Master/texmf-dist/tex/latex/media9/players/StrobeMediaPlayback.swf and b/Master/texmf-dist/tex/latex/media9/players/StrobeMediaPlayback.swf differ diff --git a/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf b/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf index fc97ef42730..fe396187a56 100644 Binary files a/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf and b/Master/texmf-dist/tex/latex/media9/players/VPlayer.swf differ -- cgit v1.2.3