title: Insert video clip in a lyx presentation and play it in GNU/Linux
body: <p>How can I insert a video clip into a presentation created in Lyx?</p>
  
  <p>Have seen <a href="http://www.latex-community.org/forum/viewtopic.php?f=19&amp;t=48" rel="nofollow noreferrer">http://www.latex-community.org/forum/viewtopic.php?f=19&amp;t=48</a>. It works, but there the video starts in the background in an external player.</p>
  
  <p>I would prefer it to be played in the presentation itself. If an external player is used it it should at least start in the foreground. But the presentation takes the foreground. Using evince in GNU/linux as pdf viewer. Beamer is used as a presentation template.</p>
  
  <p>Is it possible to play a video file in an embedded player in the presentation itself?</p>
  
  <p>Created an example presentation. The code is found below.</p>
  
  <pre><code>\documentclass[english]{beamer}
  \usepackage{mathptmx}
  \usepackage[T1]{fontenc}
  \usepackage[latin9]{inputenc}
  \usepackage{amsmath}
  \usepackage{amssymb}
  
  \makeatletter
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
   % this default might be overridden by plain title style
   \newcommand\makebeamertitle{\frame{\maketitle}}%
   \AtBeginDocument{
     \let\origtableofcontents=\tableofcontents
     \def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
     \def\gobbletableofcontents#1{\origtableofcontents}
   }
   \makeatletter
   \long\def\lyxframe#1{\@lyxframe#1\@lyxframestop}%
   \def\@lyxframe{\@ifnextchar&lt;{\@@lyxframe}{\@@lyxframe&lt;*&gt;}}%
   \def\@@lyxframe&lt;#1&gt;{\@ifnextchar[{\@@@lyxframe&lt;#1&gt;}{\@@@lyxframe&lt;#1&gt;[]}}
   \def\@@@lyxframe&lt;#1&gt;[{\@ifnextchar&lt;{\@@@@@lyxframe&lt;#1&gt;[}{\@@@@lyxframe&lt;#1&gt;[&lt;*&gt;][}}
   \def\@@@@@lyxframe&lt;#1&gt;[#2]{\@ifnextchar[{\@@@@lyxframe&lt;#1&gt;[#2]}{\@@@@lyxframe&lt;#1&gt;[#2][]}}
   \long\def\@@@@lyxframe&lt;#1&gt;[#2][#3]#4\@lyxframestop#5\lyxframeend{%
     \frame&lt;#1&gt;[#2][#3]{\frametitle{#4}#5}}
   \makeatother
   \def\lyxframeend{} % In case there is a superfluous frame end
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
  \usetheme{Warsaw}
  \usepackage{hyperref}
  
  \makeatother
  
  \usepackage{babel}
  
  \begin{document}
  
  \title{Testing video}
  
  \makebeamertitle
  
  \lyxframeend{}\section{Testing video}
  
  
  \lyxframeend{}\subsection{Testing video}
  
  
  \lyxframeend{}\lyxframe{Testing video}
  
  \href{run:video.wmv}{Movie}
  
  \appendix
  
  \lyxframeend{}
  \end{document}
  </code></pre>