1

The effect I aim to produce can be witnessed by downloading and opening the PDF at the link below.

https://www.dropbox.com/s/8sl9ymcqlr5tfdq/AcroReaderMediaIcons.pdf?dl=0

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,
    addresource=40631.mp4,
    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:

https://www.dropbox.com/sh/nyja912q7zh6xkd/AAD7fP-6F6Cg7TmCBNszWI4Ka?dl=0

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.

1

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,
    addresource=40631.mp4,
    windowed=640x480@tr,
    noplaybutton,
    activate=onclick,
    flashvars={source=40631.mp4&autoPlay=true}
  ]{\includegraphics[width=32px,height=32px]{filmicon32x32.png}}{VPlayer.swf}

\end{document}
  • Thanks, Alex. That solves the screen space problem at the same time. At least when I run it, though, autoPlay=true does not make it play immediately; one has to click in the window. This is not so bad since - contrary to my previous complaints - I now want the overlay controls to appear in the window after all for ease of re-viewing. This is because I stumbled on the technique of simply setting their opacity to a low value, making my subtitles visible after all. Unfortunately, when I edit the controls tab after the PDF is built to make them appear they do not; with the button they did. – Peyton Todd Jul 8 '15 at 17:53
  • @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
  • autoPlay is still not working, even after I tried to update media9 via tlmgr; maybe the reason is that the update failed (the 'date-modified' of media9.tex is 6/12/2015, which is about when I installed it; what happened is, when I tried to update it via tlmgr I got an error message saying "perl.exe has stopped working", and forcing me to close "the program". (= tlmgr or only perl? tlmgr does indeed close.) Doc on google says perl.exe isn't necessary, but there are 84 files with perl in their name in texlive/2014 (2015 was not yet available at install time; I'll try again now) – Peyton Todd Jul 9 '15 at 17:52
  • TeXLive-2014 isn't maintained anymore. You should uninstall 2014 and get the new one. As for overlay buttons, do you really need them? – AlexG Jul 10 '15 at 7:36
  • I tried to install TeXLive 2015 yesterday. After 14 solid hours of waiting for it to finish, I got an error as it tried to install t1utils.win32. So now I'm going to pay more attention to what I believe are options I can choose to reduce the amount of what has to be installed. As to the overlay buttons, yes I do need buttons (overlay or otherwise) since my users will have a need to re-view each video clip to study it carefully, preferably frame-by-frame. It has to do with the eyebrow raises, head tilts, and so on that accompany signs in deaf sign language. – Peyton Todd Jul 11 '15 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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