# How click an icon to open a video?

As you can see if you download it, clicking the orange 'film' icon opens a window for showing a video clip. But you must download it and run it locally for this to work since the legacy media that it uses is now blocked in browsers for security reasons, and that's one of the problems I'm hoping LaTeX will solve for me. (The other problem is that my current workflow of rebuilding PDFs from MS Word requires laboriously re-entering all my numerous videos and their parameters individually.)

One strategy I'm experimenting with is to use the orange icon as poster text, by means of code like that just below. (Notice that it uses VideoPlayer.swf instead of VPlayer.swf since that makes the video play right away, at least with this code.)

\documentclass{article}
\usepackage{media9}
\begin{document}

\includemedia[
label=firsttry,
%    width=0.4\linewidth,
%    height=0.3\linewidth,
windowed,
noplaybutton,
activate=onclick,
%    scale=2.5,
flashvars={source=40631.mp4}
]{\includegraphics[width=32px,height=32px]{filmicon32x32.png}}{VideoPlayer.swf}

\end{document}


The MP4 file, orange film icon, and resulting PDF can be found here:

The problem with the above code, and variants which reinstate the commented-out lines, is that the sizes of the poster and the video itself are linked. If I don't specify the width and height of the video, I get a tiny video to match the poster; if I do specify the width and height of the video, I get a huge poster to match the video.

A media command button strategy has led to other problems, but I will place attempts with that strategy in separate post so this one will keep its focus.

The video size is 640x480 pixels which can be passed to the windowed option.

To make the video play right away in VPlayer.swf, add FlashVar autoPlay=true.

The code below plays the video at its original size in the top right corner of the Reader window:

\documentclass{article}
\usepackage{media9}
\usepackage{graphicx}

\begin{document}

\includemedia[
%label=firsttry,

• @Peyton : The autoPlay issue has been solved in a recent update of the media9 package. Run the TeXLive package manager to update the installed packages, either by running the graphical interface, or on the command line: tlmgr update --all --self. This should be done regularly, as LaTeX packages evolve quickly. – AlexG Jul 9 '15 at 6:29