# Media9 in beamer

When I run below code in my Linux system, there are some errors which I cannot understand where they come from.

Here is my code:

\documentclass{beamer}
\usepackage{media9}
\usepackage{graphicx}
\begin{document}
\begin{frame}{embed a movie}
\begin{center}
\includemedia[
width=0.4\linewidth,height=0.3\linewidth,
activate=pageopen,
flashvars={
source=lowrey.flv}
]{\includegraphics[height=0.3\linewidth]{}{VPlayer9.swf}
\end{center}
\end{frame}
\end{document}


And here are the errors:

File ended while scanning use of \frame.

No file document.nav.


Can anyone help me to solve the errors? They made me frustrated.

• There is a opening brace before \includegraphics which isn't closed anywhere. – Ulrike Fischer Feb 3 at 15:56
• Welcome to TeX.SE! {\includegraphics[height=0.3\linewidth]{}{VPlayer9.swf} cant be wright. Should it be {\includegraphics[height=0.3\linewidth]{VPlayer9.pdf}}? \includegraphics does not handle .swf, it handles images ... – Kurt Feb 3 at 15:57
• Thank you for your comment. @Kurt I am using PartIII of this guide: bobbielf2.github.io/blog/2017/01/12/beamer-video-tutorial – Holger Mate Feb 3 at 15:59
• Well, such video tutorials often contain errors. Better follow the documentation of used packages ... You can try {\includegraphics[height=0.3\linewidth]{example-image}}{VPlayer9.swf}} – Kurt Feb 3 at 16:18

I do not have your used file lowrey.flv but with using the standard file cube.mp4 from media9 package I can compile this code without errors:

\documentclass{beamer}
\usepackage{media9}
\usepackage{graphicx}
\begin{document}
\begin{frame}{embed a movie}
\begin{center}
\includemedia[%
width=0.4\linewidth,height=0.3\linewidth,
activate=pageopen,
flashvars={source=cube.mp4}
]{\includegraphics[height=0.3\linewidth]{cubeposter.png}}{VPlayer9.swf}% <=============
\end{center}
\end{frame}
\end{document}


Please see that I used the corrected line:

{\includegraphics[height=0.3\linewidth]{cubeposter.png}}{VPlayer9.swf}

• your code can be compiled in my laptop, but doesn't show the movie! – Holger Mate Feb 4 at 13:40
• it shows the poster and there is a part in which it is written: embed a movie – Holger Mate Feb 4 at 13:42
• @HolgerMate Depends on the pdf viewer you are using, some can display the movie, some (more of them) not. Acrobat reader should do it. – Kurt Feb 4 at 13:53
• I am using Linux – Holger Mate Feb 4 at 14:47
• @HolgerMate sorry, I am an windows user, I do not know the pdf viewers for linux :-( – Kurt Feb 4 at 14:49