[Tex/LaTex] Media9 in beamer

beamermedia9

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,
    addresource=lowrey.flv,
    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.

Best Answer

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,
    addresource=cube.mp4,
    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}