You are here

function video_filter_vimeo_html5 in Video Filter 7.3

Same name and namespace in other branches
  1. 6.3 video_filter.codecs.inc \video_filter_vimeo_html5()

HTML5 callback for Vimeo codec.

See also

video_filter_codec_info()

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

File

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

Code

function video_filter_vimeo_html5($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'] = '//player.vimeo.com/video/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
  return video_filter_iframe($video);
}