0

I create slides using latex beamer which as about 180 slides in total with over 40 videos.

I inserted the videos using this command:

\begin{frame}
 \framesubtitle{Demo}
    \begin{figure}
      \newcommand{\iheight}{\textheight}
      \newcommand{\iwidth}{\textwidth}
      \centering
      \movie[label=show1,width=\iwidth, poster,
      autostart, loop] {
        \includegraphics[width=\iwidth, trim={0 0 0 0},
        clip]{../videos/cover/demo32}
      } {../videos/demo32.mpg}
    \end{figure}
  }
\end{frame}

In all the videos I embedded, I used the above style. Playing videos during presentation is really difficult as presentation software Okular unexpectedly crashes. It also takes ages for it to load.

I figured out that if I use evince and use external media player like VLC solves the problem. To do that I have to update the snippet above as follows by adding externalviewer to the properties.

\begin{frame}
 \framesubtitle{Demo}
    \begin{figure}
      \newcommand{\iheight}{\textheight}
      \newcommand{\iwidth}{\textwidth}
      \centering
      \movie[label=show1,width=\iwidth, poster,
      autostart, loop, externalviewer] {
        \includegraphics[width=\iwidth, trim={0 0 0 0},
        clip]{../videos/cover/demo32}
      } {../videos/demo32.mpg}
    \end{figure}
  }
\end{frame}

For your reference, the you can find documentation for Movie15 CTAN package.

My question is instead of manually added exteralviewer, is there a way I can just set the externalviewer and it has a global effect on all the \movie[]{} macros.

For example: To set all the frame-title to bold we do

\setbeamerfont{frametitle}{series=\bfseries} 

Can similar be done for the movie?

1

You could probably redefine the \movie command to set the external viewer to true as default:

\makeatletter
\renewcommand\movie[3][]{%
  \leavevmode%
  % Sanity check
  \IfFileExists{\@currdir #3}{}{%
    \PackageWarning{multimedia}{The movie file ``#3'' could not be
      found in the current directory, where it must reside for
      viewing.}%
  }%
  {%
    % Calculate size of the poster
    \setbox\@tempboxa=\hbox{#2}%
    \@tempdima=\wd\@tempboxa%
    \@tempdimb=\ht\@tempboxa%
    \@tempdimc=\dp\@tempboxa%
    \global\advance\mm@movie by1\relax%
    \edef\mm@label{mmdefaultlabel\the\mm@movie}%
    \def\mm@playmode{}%
    \def\mm@duration{}%
    \def\mm@start{}%
    \def\mm@poster{}%
    \def\mm@controls{}%
    \mm@autostartfalse%
    \mm@externaltrue% %%%%%%%%%%%%%%%%%%%%%%% <- change made here
    \def\mm@bw{0}%
    \setkeys{multimedia}{#1}%
    \wd\@tempboxa=\@tempdima%
    \ht\@tempboxa=\@tempdimb%
    \dp\@tempboxa=\@tempdimc%
    \ifmm@external%
      \href{run:#3}{\box\@tempboxa}%
    \else%
      \mm@psorpdf{%
        \pdfmark[{\box\@tempboxa}]{%
          pdfmark=/ANN,%
          Subtype=/Movie,%
          Movie=<< /F (#3) \mm@poster\space >>,%
          Annotations=<< \mm@start\space \mm@duration\space \mm@playmode\space \mm@controls\space>>,%
          T=(\mm@label),
          Border={0 0 \mm@bw}}%
       }{%
        \pdfannot width \@tempdima height \@tempdimb depth \@tempdimc
        {
          /Subtype /Movie
          /T (\mm@label)
          /Border [0 0 \mm@bw]
          /Movie << /F (#3) \mm@poster\space >>
          /A << \mm@start\space \mm@duration\space \mm@playmode\space \mm@controls\space >>
        }%
      }%
      \mm@psorpdf{}{\box\@tempboxa}%
      \ifmm@autostart%
      \mm@psorpdf%
      {%
        \pdfmark{pdfmark=/PUT,%
           Raw={{ThisPage} << /AA << /O << /S /Movie
         /T (\mm@label) /Operation /Play >> >> >>}%
      }}%
      {%
        \immediate\pdfobj {<< /S /Movie /T (\mm@label) /Operation /Play >>}%
        \pdfannot width 0pt height 0pt depth 0pt {%
          /Subtype/Widget
          /FT/Btn/Ff 65537
          /T (wid@\mm@label)
          /AA <</PO \the\pdflastobj\space 0 R>>% attention: /O --> /PO for Widget annots
        }%  
      }%
      \fi%
    \fi%
  }%
}
\makeatother

or use xpatch for a shorter code.

(untested, as the question does not include a compilable example)

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.