asset_youtube.themes.inc in Asset 6
File
asset_youtube/inc/asset_youtube.themes.inc
View source
<?php
function theme_asset_youtube_thumbnail($asset) {
$id = str_replace('.youtube', '', $asset->filename);
$url = "http://img.youtube.com/vi/{$id}/2.jpg";
$alt = $title = $asset->title;
$img = '<img src="' . check_url($url) . '" alt="' . check_plain($alt) . '" title="' . check_plain($title) . '" />';
return $img;
}
function theme_asset_youtube_video($asset, $attr = array()) {
$id = str_replace('.youtube', '', $asset->filename);
return '<object width="' . $attr['width'] . '" height="' . $attr['height'] . '">' . '<param name="movie" value="http://www.youtube.com/v/' . $id . '"></param>' . '<param name="wmode" value="transparent"></param>' . '<embed src="http://www.youtube.com/v/' . $id . '" type="application/x-shockwave-flash" ' . 'wmode="transparent" width="' . $attr['width'] . '" height="' . $attr['height'] . '">' . '</embed></object>';
}