I am trying to insert a .mp4 file in beamer, I got it work but two issues arising:
- the "play/pause" button doesn't work;
- I want to set a timer that the video only plays a specified time length, e.g. 10s with no looping.
Can anyone help fix my issues? Video attached. Thanks!
\usepackage{media9}
\begin{document}
\begin{frame}{Video example}
\includemedia[label=largecell,
width=\textwidth,height=0.5625\textwidth,
activate=onclick,
addresource=largecell.mp4,
flashvars={
source=largecell.mp4
&sclaeMode=letterbox
}
]{}{VPlayer.swf}
\mediabutton[
mediacommand=largecell:playPause,
jsaction=largecell:{
try{app.clearTimeOut(tout)}catch(e){} % kill pending timers
var tout=app.setTimeOut('annotRM.largecell.callAS("pause")', 10000);
}
]{\fbox{Play/Pause}}
\end{frame}
\end{document}
media9
depends on FlashPlayer that was removed from the web and from Adobe products at the beginning of 2021. Controlling video and audio playback with separate buttons, as in the example, does not work anymore.