# Is it possible to embed a YouTube video using LaTeX?

I'd like to embed a YouTube video inside a PDF generated by LaTeX, now I know it is possible to embed videos using the movie15 package but that includes the video in the PDF.

I was hoping there would be some way to embed the video as a flash object that streams it from YouTube when you get to the slide.

Anyone managed to do it before?

-
Are there PDF viewers which support Flash? The embedding is only the first half. The viewer must support it as well. – Martin Scharrer Apr 1 '11 at 19:15
@Martin latest Acrobat can embed flash video, no idea if it can stream it though – Ravi Apr 1 '11 at 19:35

-
Please do not answer questions in question form. Better write it as "This can be done using the ... package: <short code example>". Beside that, y4pdf seems to be the way to go. – Martin Scharrer Apr 1 '11 at 19:31
Oh, this wont work with pdflatex alone: "Rich media annotation is a feature of Acrobat/Adobe Reader version 9. Acrobat Pro and Distiller version 9.0 or later are required to build a document, and Adobe Reader 9.0 or later is needed to activate the annotation and play the media." – Martin Scharrer Apr 1 '11 at 19:34
note that movie15 was superseded by media9, some time back. we (ctan and karl berry) were assured by the author that media9 does do the necessary with pdflatex, and that development for other viewers than acro* is underway. – wasteofspace Feb 5 '13 at 19:37
\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
}

<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.
It might be due to updates of the packages between your post and now, but it gives the error ! Undefined control sequence. <recently read> \__scan_new:N l.54 \__scan_new:N \s__tl – Betohaku Apr 24 '13 at 16:30