You are here

function video_filter_youtube in Video Filter 6.3

Same name and namespace in other branches
  1. 5.2 video_filter.codecs.inc \video_filter_youtube()
  2. 5 video_filter.codecs.inc \video_filter_youtube()
  3. 6 video_filter.codecs.inc \video_filter_youtube()
  4. 6.2 video_filter.codecs.inc \video_filter_youtube()
  5. 7.3 video_filter.codecs.inc \video_filter_youtube()

Callback for YouTube codec.

See also

video_filter_codec_info()

1 string reference to 'video_filter_youtube'
video_filter_codec_info in ./video_filter.codecs.inc
Implements hook_codec_info().

File

./video_filter.codecs.inc, line 568
This file contains all codecs provided by Video Filter.

Code

function video_filter_youtube($video) {
  $attributes = array(
    'rel' => $video['related'] ? 'rel=1' : 'rel=0',
    'autoplay' => $video['autoplay'] ? 'autoplay=1' : 'autoplay=0',
    'fs' => 'fs=1',
  );
  $video['source'] = 'http://www.youtube.com/v/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
  $params['wmode'] = 'opaque';
  return video_filter_flash($video, $params);
}