Tuesday, March 17, 2009

Youtube videos in tt_content (itaw_youtoubeembed)

In order to embed YouTube videos in tt_content, we installed the extension "itaw_youtoubeembed".

We replaced the URL of the Youtube video: “http://www.youtube.com/watch?v=“ and inserted the query string to customize the player of the video in the "pi1/class.tx_itawyoutoubeembed_pi1.php" file

...

$content='
<object width="'.$video_width.'" height="'.$video_height.'">
<param name="movie" value="http://www.youtube.com/v/'.$video.'"> </param>
<embed src="http://www.youtube.com/v/'.$video.'" type="application/x-shockwave-flash" width="'.$video_width.'" height="'.$video_height.'"> </embed>
</object>
';

...

with “http://www.youtube.com/v/“ and the query string "&hl=en&fs=1&color1=0x234900&color2=0x4e9e00&showinfo=0" in these lines of code:

...

$content='
<object width="'.$video_width.'" height="'.$video_height.'">
<param name="movie" value="'.$video.'"> </param>
<embed src="'.str_replace("watch?v=", "v/", $video).'&hl=en&fs=1&color1=0x234900&color2=0x4e9e00&showinfo=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'.$video_width.'" height="'.$video_height.'"> </embed>
</object>
';

...

0 comments: