TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm really new to LaTeX and I'm not very good with computers. I'm trying to put videos into my PDF's. I'm using media9 and I've got the following going so far.



\mediabutton[ mediacommand=some_dice:playPause, overface=\color{blue}{\fbox{\strut Play/Pause}}, downface=\color{red}{\fbox{\strut Play/Pause}}
]{\fbox{\strut Play/Pause}} \mediabutton[
mediacommand=some_dice:setSource [(random.mp4)] ]{\fbox{\strut random.mp4}} \mediabutton[
mediacommand=some_dice:setSource [(cube.mp4)] ]{\fbox{\strut cube.mp4}}

I merely copied and pasted the mediabutton stuff. When I hit "Typeset" it runs without any errors. But when I click the play button nothing happens. I want the video embedded in the PDF so other people can see the video without having to have the file locally. Help?

share|improve this question
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). – Corentin Mar 14 '13 at 18:27
Your media file Ruinn.MP4 resides at an uncommon place, probably within the TeX installation. Don't clutter a TeX installation with user generated documents and related files. Keep user data separate from software. – AlexG Mar 15 '13 at 8:58
What do you need the media buttons for? – AlexG Mar 15 '13 at 10:06

Media files to be played back are usually embedded into the PDF (although playing files from remote URLs via http and rtmp protocols is supported too).

Media9 implements playback of media files inside PDF documents using the FlashPlayer plugin in Adobe Reader. This feature is currently available on the Windows and OSX platforms.

Two prerequisites are necessary: The media file (a video in the MP4/H.264 or FLV formats) and a media player in the Flash format (e. g. VPlayer.swf provided by Media9).

The latter is embedded by setting it as the last argument of \includemedia, while option addresource=... instructs LaTeX to physically embed a video file into the PDF.

Furthermore, VPlayer.swf needs to be told what to play. Flash applications are configured via FlashVars. For this, \includemedia provides the flashvars option. The most important FlashVar of VPlayer.swf is source=... which sets the media source. More FlashVars exist, e. g. for setting the sound volume, or loop which tells VPlayer.swf to infinitely replay the video. Refer to the Media9 documentation for other configuration options.

It is a good idea to place media files for embedding into the directory of the document you are about to write, or into a sub-directory of it. Lets assume Ruinn.MP4 is in the subdirectory videos. A minimal working example would read:





Note that the paths to the video file used with the addresource option and with the source FlashVar must be identical. Further note, that MP4 is only a container file format for video. The video data inside the file must be encoded with the H.264 codec. Another option is the FLV file format.

share|improve this answer
I'm using Linux, can I specify a player other than VPlayer.swf? – Yan King Yin Dec 11 '15 at 12:21
You will need the older AdobeReader version 9.4.1, the last one with embedded FlashPlayer. The you can use VPlayer9.swf. – AlexG Dec 11 '15 at 12:30
@YanKingYin : For further instructions, see: tex.stackexchange.com/a/70931 – AlexG Dec 11 '15 at 12:58
Can I skip the VPlayer9.swf if I convert my video to SWF format? I use Adobe Reader 9.5.5 and it fails, but I don't want to be stuck with an older version. – Yan King Yin Dec 11 '15 at 13:04
Yes, but you won't have playback control (play, pause, stop, fast forward, volume increase, etc., etc.). In any case, if you want playback of SWF inside Adobe Reader you need the old version 9.4.1 . – AlexG Dec 11 '15 at 13:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.