diff options
author | Karl Berry <karl@freefriends.org> | 2021-01-26 21:45:57 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-01-26 21:45:57 +0000 |
commit | 23a8540040356892def7beb4a4febdf111a8eac7 (patch) | |
tree | e0df3a3632b2cf8d0b1515d773b3c7cb6292dc97 /Master/texmf-dist/tex/latex | |
parent | ea1957a75364df664dd654d58227b0313167ac7e (diff) |
media4svg (26jan21)
git-svn-id: svn://tug.org/texlive/trunk@57528 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/media4svg/media4svg.sty | 58 |
1 files changed, 21 insertions, 37 deletions
diff --git a/Master/texmf-dist/tex/latex/media4svg/media4svg.sty b/Master/texmf-dist/tex/latex/media4svg/media4svg.sty index 3690ce2b318..f5460deed67 100644 --- a/Master/texmf-dist/tex/latex/media4svg/media4svg.sty +++ b/Master/texmf-dist/tex/latex/media4svg/media4svg.sty @@ -23,44 +23,26 @@ % % The Current Maintainer of this work is A. Grahn. -\RequirePackage{iftex} -\ifpdf - \PackageError{media4svg}{% - Wrong output format (PDF).\MessageBreak - This package only works with the `dvisvgm' backend.\MessageBreak - A TeX engine must be used that produces\MessageBreak - DVI or XDV output% - }{}% -\fi - -\RequirePackage{expl3} \RequirePackage{l3keys2e} -\RequirePackage{xparse} -\RequirePackage{atbegshi} -\def\g@msvg@date@tl{2020/04/16} -\def\g@msvg@version@tl{0.4} +\def\g@msvg@date@tl{2021/01/25} +\def\g@msvg@version@tl{0.5} \ProvidesExplPackage{media4svg}{\g@msvg@date@tl}{\g@msvg@version@tl} -{acrobat-9/X compatible media} +{multimedia inclusion with dvisvgm} + +\sys_if_output_pdf:T{ + \PackageError{media4svg}{ + Wrong~output~format~(PDF).\MessageBreak + This~package~only~works~with~the~`dvisvgm'~backend.\MessageBreak + A~TeX~engine~must~be~used~that~produces\MessageBreak + DVI~or~XDV~output + }{}% +} \tl_gset_eq:NN\g_msvg_date_tl\g@msvg@date@tl \tl_gset_eq:NN\g_msvg_version_tl\g@msvg@version@tl -\msg_set:nnnn{media4svg}{support~outdated}{ - Support~package~`#1'~too~old. -}{ - Update~your~installation~of~`#1'.~Aborting. -} -\@ifpackagelater{expl3}{2020/04/06}{}{ - \msg_fatal:nnn{media4svg}{support~outdated}{l3kernel} - \tex_endinput:D -} -\@ifpackagelater{l3keys2e}{2020/03/06}{}{ - \msg_fatal:nnn{media4svg}{support~outdated}{l3packages} - \tex_endinput:D -} - %package options \msg_set:nnnn{media4svg}{unknown~package~option}{Unknown~package~option~`#1'.}{ Package option~`#1'~is~unknown;\\ @@ -272,6 +254,7 @@ transform='translate({?x},{?(y-(\dim_to_decimal_in_bp:n{\g_msvg_ht_tl}))})' width='\dim_to_decimal_in_bp:n{\g_msvg_wd_tl}'~ height='\dim_to_decimal_in_bp:n{\g_msvg_tt_tl}'~ + style='cursor:~pointer;'~ \tl_if_blank:VT\g_msvg_controls_tl{ ontouchstart=' event.preventDefault();event.stopPropagation(); @@ -281,8 +264,7 @@ $("\g_msvg_id_tl").pause(); } return;% <-- this prevents download-video-? dialogue in Chrome - '~ - cursor='pointer' + ' } >{?nl} <video~ @@ -340,10 +322,12 @@ break; } '~ + onclick='event.stopPropagation();'~ + oncontextmenu='event.stopPropagation();'~ onmouseup='event.preventDefault();event.stopPropagation(); - event.target.play();'~ + if(event.button==0) event.target.play();'~ onmousedown='event.preventDefault();event.stopPropagation(); - event.target.pause();'~ + if(event.button==0) event.target.pause();'~ } \tl_if_blank:VF\g_msvg_time_tl{ onloadstart='event.target.currentTime=\g_msvg_time_tl;'~ @@ -785,9 +769,9 @@ \int_new:N\g@msvg@page@int %abs. page counter (zero based) \int_gset:Nn\g@msvg@page@int{-1} -\AtBeginShipout{ - \int_gincr:N\g@msvg@page@int - \AtBeginShipoutUpperLeft{ +\AddToHook{shipout/before}{\int_gincr:N\g@msvg@page@int} +\AddToHook{shipout/background}{ + \put(0,0){ \special{dvisvgm:rawdef {?nl} <script~type="text/javascript">{?nl} <![CDATA[{?nl} |