Is it possible to embed a YouTube video using LaTeX?

Notice of obsolescence:

YouTube have dropped its Flash-based video player in Sept 2017. For the lack of HTML5 support in the PDF specification (and thus by PDF viewers), YT playback is not possible anymore in an embedded fashion.

\documentclass{article}
\usepackage{media9}             %pdflatex, latex+dvips+ps2pdf, xelatex
%\usepackage[dvipdfmx]{media9}  %latex+dvipdfmx

\begin{document}
\includemedia[
  width=0.6\linewidth,height=0.45\linewidth,
  activate=pageopen,
  flashvars={
    modestbranding=1 % no YT logo in control bar
   &autohide=1       % controlbar autohide
   &showinfo=0       % no title and other info before start
  }
]{}{http://www.youtube.com/v/<video id>?rel=0}   % Flash file
\end{document}

<video id> to be replaced by the video ID, i. e., something like Mdc3o7wOwNA. More FlashVars for configuring the youtube video player are documented here. Some FlashVars, such as rel=0, seem to have effect only if appended to the URL.


The y4pdf package is [no more] what you need !

EDIT : Please note this answer is now obsolete and this package does not seems to be supported anymore, and if you ever manage to compile the package, the resulting PDF won't play the video.