diff --git a/sites/all/modules/emfield/contrib/emvideo/emvideo.theme.inc b/sites/all/modules/emfield/contrib/emvideo/emvideo.theme.inc index 582e008..aca5b0c 100644 --- a/sites/all/modules/emfield/contrib/emvideo/emvideo.theme.inc +++ b/sites/all/modules/emfield/contrib/emvideo/emvideo.theme.inc @@ -243,6 +243,10 @@ function theme_emvideo_modal_generic($field, $item, $formatter, $node, $options } else if ($options['modal'] == 'colorbox-load') { $attributes['query'] = 'width='. ($width + 4) .'&height='. ($height + 7) .'&iframe=true'; + if ($field['widget']['video_autoplay']) { + $attributes['query'] .= "&autoplay=1"; + } + $destination = $item['data']['embedded_url']; } if (($options['modal'] == 'lightbox2') && function_exists('lightbox2_add_files')) { diff --git a/sites/all/modules/media_vimeo/media_vimeo.module b/sites/all/modules/media_vimeo/media_vimeo.module index 5450b09..f9a4506 100644 --- a/sites/all/modules/media_vimeo/media_vimeo.module +++ b/sites/all/modules/media_vimeo/media_vimeo.module @@ -88,6 +88,19 @@ function media_vimeo_video_url($video_code) { } /** + * Return the embedded URL to this video. + * + * @param string $video_code + * The Vimeo video id. + * + * @return string + * The embedded URL to the video in question. + */ +function media_vimeo_video_embedded_url($video_code) { + return url('http://player.vimeo.com/video/'. $video_code); +} + +/** * The URL to the thumbnail video still for the media. * * @param $string $video_code @@ -125,6 +138,7 @@ function media_vimeo_thumbnail_url($video_code) { function media_vimeo_data($video_code) { $url = url('http://vimeo.com/api/v2/video/'. $video_code .'.php'); $xml = emfield_request_xml('vimeo', $url, array(), TRUE, FALSE, $video_code, TRUE); + $xml[0]['embedded_url'] = media_vimeo_video_embedded_url($video_code); return array_pop($xml); } diff --git a/sites/all/modules/media_youtube/media_youtube.module b/sites/all/modules/media_youtube/media_youtube.module index 505ec9d..298a439 100644 --- a/sites/all/modules/media_youtube/media_youtube.module +++ b/sites/all/modules/media_youtube/media_youtube.module @@ -258,6 +258,19 @@ function media_youtube_video_url($id) { } /** + * Return the embedded URL to this video. + * + * @param string $id + * The YouTube video id. + * + * @return string + * The embedded URL to the video in question. + */ +function media_youtube_video_embedded_url($id) { + return url('http://www.youtube.com/embed/' . $id); +} + +/** * Validation function for Media: YouTube's Media Mover configuration form. * * @see media_youtube_config(). @@ -575,6 +588,7 @@ function media_youtube_emfield_data($video_id) { $data['playlist'] = 0; // Get the large thumbnail. $data['thumbnail']['url'] = 'http://img.youtube.com/vi/'. $video_id .'/0.jpg'; + $data['embedded_url'] = media_youtube_video_embedded_url($video_id); } $response = emfield_request_header('youtube', $url);