summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/media4svg/media4svg.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-04-15 03:02:52 +0000
committerNorbert Preining <norbert@preining.info>2020-04-15 03:02:52 +0000
commite768cc604852d6fe8821592cea67835f67eab0db (patch)
tree06dc26d3571570f9578f59825f6ecc2186dfb47c /macros/latex/contrib/media4svg/media4svg.sty
parentc7235aafe4ddb8f9800cdf784212d4c53bb53e32 (diff)
CTAN sync 202004150302
Diffstat (limited to 'macros/latex/contrib/media4svg/media4svg.sty')
-rw-r--r--macros/latex/contrib/media4svg/media4svg.sty53
1 files changed, 48 insertions, 5 deletions
diff --git a/macros/latex/contrib/media4svg/media4svg.sty b/macros/latex/contrib/media4svg/media4svg.sty
index f0451ae7ec..5738846318 100644
--- a/macros/latex/contrib/media4svg/media4svg.sty
+++ b/macros/latex/contrib/media4svg/media4svg.sty
@@ -38,8 +38,8 @@
\RequirePackage{xparse}
\RequirePackage{atbegshi}
-\def\g@msvg@date@tl{2020/04/13}
-\def\g@msvg@version@tl{0.2}
+\def\g@msvg@date@tl{2020/04/14}
+\def\g@msvg@version@tl{0.3}
\ProvidesExplPackage{media4svg}{\g@msvg@date@tl}{\g@msvg@version@tl}
{acrobat-9/X compatible media}
@@ -275,7 +275,7 @@
}else{
$("\g_msvg_id_tl").pause();
}
- return;% <-- this prevents download-video? dialogue in Chrome
+ return;% <-- this prevents download-video-? dialogue in Chrome
'~
cursor='pointer'
}
@@ -284,9 +284,52 @@
x="0"~y="0"~
id='msvg@\g_msvg_id_tl'~
width='100\msvg_percent:'~height='100\msvg_percent:'~
- \g_msvg_controls_tl \g_msvg_autoplay_tl \g_msvg_loop_tl \g_msvg_muted_tl
+ \g_msvg_controls_tl\g_msvg_autoplay_tl\g_msvg_loop_tl\g_msvg_muted_tl
\tl_if_blank:VT\g_msvg_controls_tl{
- onplaying='$("kbdCtrl@\g_msvg_id_tl").focus();'~
+ onplaying=' % in Chrome, keyboard control
+ $("kbdCtrl@\g_msvg_id_tl").focus();% via separate <svg> element
+ event.target.focus(); % Firefox
+ '~
+ onkeydown='
+ if(event.target.controls){return;}
+ switch(event.key){
+ case "~":
+ if(event.target.paused){
+ event.target.play();
+ }else{
+ event.target.pause();
+ }
+ break;
+ case "ArrowUp":
+ if(event.ctrlKey){event.target.muted=false;}else{
+ try{event.target.volume+=0.02;}catch(e){}}
+ break;
+ case "ArrowDown":
+ if(event.ctrlKey){event.target.muted=true;}else{
+ try{event.target.volume-=0.02;}catch(e){}}
+ break;
+ case "ArrowLeft":
+ if(event.ctrlKey){
+ event.target.currentTime-=event.target.duration/10;
+ }else{
+ event.target.currentTime-=event.target.duration/100;
+ }
+ break;
+ case "ArrowRight":
+ if(event.ctrlKey){
+ event.target.currentTime+=event.target.duration/10;
+ }else{
+ event.target.currentTime+=event.target.duration/100;
+ }
+ break;
+ case "Home":
+ event.target.currentTime=0;
+ break;
+ case "End":
+ event.target.currentTime=event.target.duration;
+ break;
+ }
+ '~
onmouseup='event.preventDefault();event.stopPropagation();
event.target.play();'~
onmousedown='event.preventDefault();event.stopPropagation();