function emvideo_youtube_preview in Media: YouTube 6
hook emvideo_PROVIDER_video this actually displays the preview-sized video we want, commonly for the teaser
Parameters
$video_id: the video code for the video to embed @param $width the width to display the video @param $height the height to display the video @param $field the field info from the requesting node @param $item the actual content from the field @return the html of the embedded video
File
- providers/
emvideo/ youtube.inc, line 246 - This include processes youtube.com media files for use by emfield.module.
Code
function emvideo_youtube_preview($video_id, $width, $height, $field, $item, $node, $autoplay, $options = array()) {
$options['video_id'] = isset($options['video_id']) ? $options['video_id'] : $video_id;
$options['width'] = isset($options['width']) ? $options['width'] : $width;
$options['height'] = isset($options['height']) ? $options['height'] : $height;
$options['field'] = isset($options['field']) ? $options['field'] : $field;
$options['item'] = isset($options['item']) ? $options['item'] : $item;
$options['node'] = isset($options['node']) ? $options['node'] : $node;
$options['autoplay'] = isset($options['autoplay']) ? $options['autoplay'] : $autoplay;
$options['html5'] = isset($options['html5']) ? $options['html5'] : media_youtube_variable_get('html5_player');
if ($options['html5']) {
$output = theme('media_youtube_html5', $options);
}
else {
$output = theme('media_youtube_flash', $options);
}
return $output;
}