$variables['video_code'], 'server' => 'www.vimeo.com', ); foreach (array('fullscreen', 'show_title', 'show_byline', 'show_portrait', 'color', 'autoplay') as $key) { if (isset($variables[$key])) { $variables['query'][$key] = $variables[$key]; } } $variables['data'] = url('http://www.vimeo.com/moogaloop.swf', array('query' => $variables['query'])); } } /** * Display the video in an iFrame with HTML5. */ function template_preprocess_media_vimeo_universal(&$variables) { _media_vimeo_options($variables); if ($variables['video_code']) { $variables['query'] = isset($variables['query']) ? $variables['query'] : array(); foreach (array('fullscreen', 'show_title', 'show_byline', 'show_portrait', 'color', 'autoplay') as $key) { if (isset($variables[$key])) { $variables['query'][$key] = $variables[$key]; } } $variables['iframe_url'] = url('http://player.vimeo.com/video/' . $variables['video_code'], array('query' => $variables['query'])); } } /** * Strip any beginning #'s from the color hex code. */ function _media_vimeo_convert_color($color = NULL) { if (!isset($color)) { $color = media_vimeo_variable_get('color'); } if ($color{0} == '#') { return substr($color, 1); } return $color; } function _media_vimeo_options(&$variables) { foreach ($variables['options'] as $key => $value) { $variables[$key] = $value; } unset($variables['options']); }