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?

  • 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, 2013 at 8:58
  • What do you need the media buttons for?
    – AlexG
    Mar 15, 2013 at 10:06

1 Answer 1


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.

  • I'm using Linux, can I specify a player other than VPlayer.swf? Dec 11, 2015 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, 2015 at 12:30
  • @YanKingYin : For further instructions, see: tex.stackexchange.com/a/70931
    – AlexG
    Dec 11, 2015 at 12:58
  • 1
    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, 2015 at 13:33
  • 2
    I don't want to use the old Acrobat Reader, anyway I switched to movie15, and it's still not supported by AR, but it works in evince in Linux. Dec 11, 2015 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .