# Media9 compiles but embedded video gives “Unable to connect to content” “TypeError - Error #1009”

I have a beamer presentation that I am creating and I'm trying to embed a video clip. I'm using the media9 package and having a ton of issues with it. I've gone through the documentation with a fine-toothed comb but I'm still striking out. Here's what I have done so far:

First, I modified the video file into MP4/H.264 using ffmpeg as the media9 documentation instructs. The code I used is directly from the documentation:

ffmpeg -i /filepath/file.mp4 -vf scale="trunc(iw/2)*2:trunc(ih/2)*2" -c:v
libx264 -profile:v high -pix_fmt yuv420p -g 30 -r 30 /filepath/file2.mp4


Then, I added this code to my beamer presentation:

\includemedia[
width=0.7\linewidth,
height=0.5\linewidth,
activate=onclick,
flashvars={source=/filepath/file2.MP4}
]{}{StrobeMediaPlayback.swf}


After doing this, the presentation compiles fully with no errors or notes in the console about media9, the file, or anything related to the video.

However, when I open it in Adobe Acrobat Pro x (Mac OS X 10.10.3), I get the error We are unable to connect to the content you've requested. We apologize for the inconvenience. After clicking around the video, the message will change and display TypeError - Error #1009

I've tried using VPlayer.swf instead and that didn't work. I've tried using different settings on ffmpeg to convert the video differently, and I'm just not sure if I'm missing something.

• Two errors: (1) In Strobe, the correct FlashVar is src not source (which is VPlayer). (2) The ffmpeg generated file is file2.mp4, but you try to embed file2.MP4. Case matters. – AlexG Jul 7 '15 at 6:51
• Use .flv format rather than .mp4. I also had exactly the same issue, and this solution worked for me. – Bhanuday Sharma Mar 29 at 18:11

The correct FlashVar for setting the video source in StrobeMediaPlayback.swf is

src=/filepath/file2.MP4


otherwise, the reported error occurs.

The following MWE should work:

\documentclass{beamer}
\usepackage{media9}

\begin{document}
\begin{frame}

\includemedia[
width=0.7\linewidth,
height=0.5\linewidth,
%    activate=onclick, %this is default
flashvars={src=/filepath/file2.MP4}
]{}{StrobeMediaPlayback.swf}

\end{frame}
\end{document}


I had the same issue you're describing. I was only able to successfully embed the video when filepath is in the same directory as my beamer.tex file.

This is particularly confusing because I'm not aware that this limitation is spelled out in the media9 documentation.

• This statement is not true. – AlexG Jul 7 '15 at 6:34
• This probably should be a comment rather than an answer, since it isn't an answer, really. – Daniel Lyons Jul 7 '15 at 6:44
• This is indeed true on my system (MacTeX-2015, OS X 10.10.3). I should have clarified that the movie files can be in a separate directory, that directory just needs to be at the level of the main Beamer file. Specifying ./path/file.mp4 for addresource and flashvars={src works while using ../path/file.mp4 does not. – Tim Jul 7 '15 at 11:26
• For this particular case you can use \addmediapath{../filepath} to add a non-sublevel dir to the search path and omit the path within \includemedia. FlashPlayer doesn't allow relative paths outside the current directory for security reasons. Absolute paths to media files, even outside the current directory tree, should work as expected. – AlexG Jul 7 '15 at 11:46