You are here

function video_filter_vimeo in Video Filter 7.3

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

Callback for Vimeo codec.

See also

video_filter_codec_info()

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

File

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

Code

function video_filter_vimeo($video) {
  $attributes = array(
    'autopause' => isset($video['autopause']) ? 'autopause=' . (int) $video['autopause'] : 'autopause=1',
    'autoplay' => isset($video['autoplay']) ? 'autoplay=' . (int) $video['autoplay'] : 'autoplay=0',
    'badge' => isset($video['badge']) ? 'badge=' . (int) $video['badge'] : 'badge=1',
    'byline' => isset($video['byline']) ? 'byline=' . (int) $video['byline'] : 'byline=1',
    'loop' => isset($video['loop']) ? 'loop=' . (int) $video['loop'] : 'loop=0',
    'portrait' => isset($video['portrait']) ? 'portrait=' . (int) $video['portrait'] : 'portrait=1',
    'title' => isset($video['title']) ? 'autopause=' . (int) $video['title'] : 'autopause=1',
    'fullscreen' => isset($video['fullscreen']) ? 'fullscreen=' . (int) $video['fullscreen'] : 'fullscreen=1',
  );
  if (!empty($video['color'])) {
    $attributes['color'] = (string) $video['color'];
  }
  $video['source'] = '//www.vimeo.com/moogaloop.swf?clip_id=' . $video['codec']['matches'][1] . '&server=www.vimeo.com&' . implode('&', $attributes);
  return video_filter_flash($video);
}