summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/media4svg/example/beamer-example.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/media4svg/example/beamer-example.tex')
-rw-r--r--macros/latex/contrib/media4svg/example/beamer-example.tex111
1 files changed, 56 insertions, 55 deletions
diff --git a/macros/latex/contrib/media4svg/example/beamer-example.tex b/macros/latex/contrib/media4svg/example/beamer-example.tex
index e5e3b99eda..98bb70f320 100644
--- a/macros/latex/contrib/media4svg/example/beamer-example.tex
+++ b/macros/latex/contrib/media4svg/example/beamer-example.tex
@@ -3,9 +3,11 @@
\usetheme{default}
\makeatletter
\defbeamertemplate*{frametitle}{mydefault}{%
- \nointerlineskip\vspace{1ex}{\usebeamerfont{frametitle}\insertframetitle}%
- \ifx\insertframesubtitle\@empty\else{\usebeamerfont{framesubtitle}\\\insertframesubtitle}\fi%
- \vspace{-0.8ex}%
+ \nointerlineskip%
+ \usebeamerfont{frametitle}\vskip0.8ex\baselineskip=0.9\baselineskip\insertframetitle\par%
+ \ifx\insertframesubtitle\@empty\else\vrule width 0pt height \ht\strutbox%
+ {\usebeamerfont{framesubtitle}\insertframesubtitle\par}\fi%
+ \vskip-0.9ex%
}
\makeatother
\setbeamersize{text margin left=0.0333\paperheight,text margin right=0.0333\paperheight}
@@ -14,7 +16,7 @@
\usepackage[british]{babel}
\usepackage{media4svg}
-\usepackage{menukeys,siunitx,calc}
+\usepackage{menukeys,siunitx,calc,fancyvrb,booktabs}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% slide navigation via keyboard and mouse click/mouse wheel, mouse cursor
@@ -40,6 +42,9 @@
try{clearTimeout(cursorTimer);}catch(err){};%
cursorTimer=setTimeout(function(){e.target.style.cursor='none';},3000);%
});%
+ window.addEventListener('contextmenu', function(e){% capture right click
+ if(!(islink(e.target)||e.target.tagName=='video'||e.target.tagName=='audio')) e.preventDefault();%
+ });%
document.addEventListener('mousedown', function(e){%
if(islink(e.target)) downOnLink=true;%
else downOnRoot=true;%
@@ -47,12 +52,12 @@
document.addEventListener('mouseup', function(e){%
if(downOnLink||!downOnRoot){downOnLink=false;return;}%
downOnRoot=false;%
- \ifnum\thepage<\ztotpages
- if(!e.shiftKey) document.location.replace('\jobname-\zeroPad{\ztotpages}{\the\numexpr\thepage+1\relax}.svg');%
- \fi%
- \ifnum\thepage>1
- if(e.shiftKey) document.location.replace('\jobname-\zeroPad{\ztotpages}{\the\numexpr\thepage-1\relax}.svg');%
- \fi%
+ \ifnum\thepage<\ztotpages
+ if(!e.shiftKey&&e.button==0) document.location.replace('\jobname-\zeroPad{\ztotpages}{\the\numexpr\thepage+1\relax}.svg');%
+ \fi%
+ \ifnum\thepage>1
+ if(e.shiftKey||e.button>1) document.location.replace('\jobname-\zeroPad{\ztotpages}{\the\numexpr\thepage-1\relax}.svg');%
+ \fi%
});%
document.addEventListener('wheel', function(e){%
\ifnum\thepage<\ztotpages
@@ -126,7 +131,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Presentation example with embedded video}
-\subtitle{Use a Web browser and press \keys{F11}}
+\subtitle{---The \Verb+media4svg+ package---}
\author{AlexG}
\date{\today}
@@ -136,77 +141,73 @@
\begin{frame}[fragile]
\titlepage\footnotesize
\makebox[0.3\linewidth]{\hrulefill}\\[1ex]
-Toggle Full-Screen with \keys{F11}, navigate with \keys{PageUp} \& \keys{PageDn}, mouse click or mouse wheel.\\[2ex]
-To build this presentation from the source, run:\vspace{-2ex}
-\begin{verbatim}
+Put the Web browser to fullscreen with \keys{F11}, navigate with \keys{PageDn} \& \keys{PageUp}, left \& right mouse click or mouse wheel.\\[2ex]
+To build this presentation from the source, run:
+\begin{Verbatim}
dvilualatex beamer-example
dvilualatex beamer-example
dvisvgm --bbox=papersize --font-format=woff2 --zoom=-1 --page=- --linkmark=none \
beamer-example
-\end{verbatim}
+\end{Verbatim}
\end{frame}
\begin{frame}[fragile]{Video file}
-embedded local video file from package \emph{mwe}
-\begin{verbatim}
-\includemedia[width=24em,height=13.5em]{}{example-movie.mp4}
-\end{verbatim}
- \begin{center}
- \includemedia[width=24em,height=13.5em]{}{example-movie.mp4}
- \end{center}
+Examples of embedded local video files. Recommended file formats are \Verb+mp4/h264+, \Verb+webm+ and \Verb+ogg+. Some Web browsers require the video to be explicitly muted in order to autoplay.\\[2ex]
+\begin{Verbatim}
+\includemedia[width=26em,height=14.625em]{}{example-movie.mp4}
+\end{Verbatim}
+\begin{Verbatim}
+\includemedia[width=19.5em,height=14.625em,loop,autoplay,muted]{}{random.mp4}
+\end{Verbatim}
+\vspace{2ex}
+\includemedia[width=20em,height=11.25em]{}{example-movie.mp4}\quad
+\includemedia[width=15em,height=11.25em,loop,autoplay,muted]{}{random.mp4}
\end{frame}
\begin{frame}[fragile]{Remote video}
-video streamed from URL and YouTube player with two videos played in a loop
-\begin{verbatim}
-\includemedia[width=16em,height=9em,url,controls]{}{%
+Video streamed from URL and YouTube player with two videos played in a loop.\\[2ex]
+
+\begin{Verbatim}
+\includemedia[width=20em,height=11.25em,url,controls]{}{%
https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm}
-\end{verbatim}
-\begin{verbatim}
-\includemedia[width=16em,height=9em,youtube,controls,loop,
+\end{Verbatim}
+\begin{Verbatim}
+\includemedia[width=20em,height=11.25em,youtube,controls,loop,
autoplay,muted]{}{OSPyXTjIrnk,9HQfauGJaTs}
-\end{verbatim}
-\vspace{1ex}
-\begin{columns}[onlytextwidth,b]
- \begin{column}{0.49\linewidth}
- \includemedia[width=16em,height=9em,url,controls]{}{https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm}
- \end{column}
- \begin{column}{0.49\linewidth}
- \includemedia[width=16em,height=9em,youtube,controls,loop,autoplay,muted]{}{OSPyXTjIrnk,9HQfauGJaTs}
- \end{column}
-\end{columns}
+\end{Verbatim}
+\includemedia[width=18em,height=10.125em,url,controls]{}{https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm}
+\includemedia[width=18em,height=10.125em,youtube,controls,loop,autoplay,muted]{}{OSPyXTjIrnk,9HQfauGJaTs}
\end{frame}
\begin{frame}[fragile]{Player control}
-The standard player controls (option `\verb+controls+') take a lot of space of the media display. Therefore, it is not recommended to enable them. Nevertheless, interactivity is still provided through touch or left mouse button click, and through the keyboard as summarized in the table.
+The standard player controls (option `\Verb+controls+') occupy some space of the media display and should not be enabled for that reason. Nevertheless, interactivity is still provided through touch or left mouse button click, and through the keyboard as summarized in the table.\\[0.5ex]
-Click on the media display to start playback. To pause playback, press the left mouse button on the media display. Release it to resume playback. To pause playback permanently, press the left mouse button on the media display and move the mouse out while keeping the button pressed.
+Click on the media to start playback. To pause playback, press the left mouse button on the media. Release it to resume playback. To pause playback permanently, press the left mouse button on the media and move the mouse out while keeping the button pressed. On mobile devices, tap on the media to toggle between Play and Pause.\\[1ex]
-\begin{minipage}[t]{0.5\linewidth}
- \rule{1ex}{0pt}\\
- \begin{tabular}{ll}\hline
- Command & Shortcut\\\hline
- \rule{0pt}{2.4ex}Toggle Play/Pause & \keys{\SPACE}\\
+\begin{columns}[t,onlytextwidth]
+\begin{column}{0.5\linewidth}
+ \begin{tabular}{ll}\toprule
+ Command & Shortcut\\\midrule
+ Toggle Play/Pause & \keys{\SPACE}\\
Increase volume & \keys{\arrowkeyup}\\
Decrease volume & \keys{\arrowkeydown}\\
Unmute audio & \keys{Ctrl+\arrowkeyup}\\
Mute audio & \keys{Ctrl+\arrowkeydown}\\
- Toggle Full-Screen & \keys{F11}
+ Toggle Full-Screen & \keys{F11}\\\bottomrule
\end{tabular}
-\end{minipage}%
-\begin{minipage}[t]{0.5\linewidth}
- \rule{1ex}{0pt}\\
- \begin{tabular}{ll}\hline
- Command & Shortcut\\\hline
- \rule{0pt}{2.4ex}Seek back \SI{1}{\percent} & \makebox[\widthof{\keys{\SPACE}}][l]{\keys{\arrowkeyleft}}\\
+\end{column}
+\begin{column}{0.5\linewidth}
+ \begin{tabular}{ll}\toprule
+ Command & Shortcut\\\midrule
+ Seek back \SI{1}{\percent} & \makebox[\widthof{\keys{\SPACE}}][l]{\keys{\arrowkeyleft}}\\
Seek forward \SI{1}{\percent} & \keys{\arrowkeyright}\\
Seek back \SI{10}{\percent} & \keys{Ctrl+\arrowkeyleft}\\
Seek forward \SI{10}{\percent} & \keys{Ctrl+\arrowkeyright}\\
Seek to beginning & \keys{Home}\\
- Seek to end & \keys{End}
+ Seek to end & \keys{End}\\\bottomrule
\end{tabular}
-\end{minipage}
-
+\end{column}
+\end{columns}
\end{frame}
\end{document}