# Trying to embed mp4 in a Beamer presentation

Sample document

\documentclass{beamer}
\usetheme{Amsterdam}
\usepackage{media9}

\title{TITLE}
\author{AUTHOR}
\institute{INSTITUTE}
\date{DATE}

\begin{document}

\frame{\titlepage}

\begin{frame}{Title}
\includemedia[
width=\paperwidth,
height=0.7\linewidth,
activate=pageopen,
flashvars={source=C:/Users/David/Desktop/NF/1.mp4
&loop=true
&scaleMode=letterbox
}
]{}{VPlayer.swf}
\end{frame}

\end{document}


I know this has already been asked. So please before anyone just gets rid of this question, hear me out. I have updated, uninstalled and re-installed MiKTeX2.9 and TeXnicCenter. Hence I do not believe this is an "update packages" fix. I am trying to use the Media9 package to embed a video. (The file format is not relevant I have mp4, avi, & swf of the same video.) I'm a master's student in Mathematics so I use TeX frequently and I've never had such an issue. Every time I compile I get this error

You can't use '\dimexpr' in restricted horizontal mode.
<argument> \dimexpr

line 1.28 \end{frame}


So my first question is what is this error? Why does it occur and of course how can I resolve it? I read one previously removed question that suggested an update. However, I have tried this. Can anyone suggest something? Am I doing something stupid? I'm not even sure where this "dimension expression" is being used.

• Add first sight, there is no error with your code, though I had to use another theme to compile it, since Amsterdam was not found on my system (TL13), and I had to use another file path. – AlexG Apr 18 '14 at 15:03
• @AlexG Thank you, I will try a re-install/update again. I suppose there must be something wrong with MiKTeX or the package... Amsterdam is based on the Dresden theme, may I ask what theme you used? Perhaps the issue lies therein the theme. – Cornelius Mullens Apr 18 '14 at 17:42
• I tried with Dresden. – AlexG Apr 18 '14 at 17:49
• @AlexG Well sadly I have uninstalled and installed MiKTeX2.9/TeXnicCenter twice. I've updated my packages as well as removed and installed Media9 twice. I cannot get it to compile, gives the same error. Last question I swear, may I ask what you used to compile? – Cornelius Mullens Apr 19 '14 at 17:18
• I used TeXLive-2013 and MiKTeX-2.9, both updated today. No problem with the compilation here. – AlexG Apr 22 '14 at 8:10

\documentclass{beamer}
\usetheme{Dresden}
\usepackage{graphicx}
\graphicspath{C:/Users/David/Desktop/NF}
\usepackage{media9}

\title{TITLE}
\author{AUTHOR}
\institute{INSTITUTE}
\date{DATE}

\begin{document}

\begin{center}
\includemedia[
activate=onclick,
width=0.75\textwidth
]{\includegraphics{Pic.png}}{1.swf}
\end{center}

\end{document}


Here is progress update. Something very weird that I do not understand. I was able to get the video to embed and play using the above code. However, there is still a caveat... I get the same error about \dimexpr along with 23 other errors. If anyone has any suggestions/workarounds I would be very grateful, thank you in advance.

• Weirdly, it compiles for me with the same config you have stated. Maybe it is the slashes backslashes? – percusse Aug 17 '14 at 20:26

Try with this code (with \usepackage{media9})

\begin{frame}
\begin{center}
\begin{figure}[ht]