? .DS_Store ? 884464-youtube-new-embed.patch ? providers/.DS_Store Index: providers/emvideo/youtube.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/media_youtube/providers/emvideo/Attic/youtube.inc,v retrieving revision 1.1.2.18 diff -u -p -r1.1.2.18 youtube.inc --- providers/emvideo/youtube.inc 12 Nov 2010 15:58:57 -0000 1.1.2.18 +++ providers/emvideo/youtube.inc 31 Jan 2011 20:43:28 -0000 @@ -96,7 +96,7 @@ function emvideo_youtube_data($field, $i xml_parser_free($parser); if (count($vals)) { foreach ($vals as $val) { - if ($val['tag'] == 'MEDIA:THUMBNAIL' && $val['attributes']['HEIGHT'] == '240') { + if ($val['tag'] == 'MEDIA:THUMBNAIL' && $val['attributes']['HEIGHT'] >= 240) { $data['thumbnail']['url'] = $val['attributes']['URL']; break; } @@ -157,7 +157,7 @@ function emvideo_youtube_request($video_ $args['dev_id'] = trim(media_youtube_variable_get('api_key')); $args['method'] = $method; - $request = emfield_request_xml('youtube', MEDIA_YOUTUBE_REST_ENDPOINT .'/'. $code, array('video' => $code, 'v' => '2'), $cached); + $request = emfield_request_xml('youtube', MEDIA_YOUTUBE_REST_ENDPOINT .'/'. $video_id, array('video' => $video_id, 'v' => '2'), $cached); return $request; } @@ -186,8 +186,9 @@ function emvideo_youtube_extract($video_ // src="http://www.youtube.com/v/nvbQQnvxXDk" // http://youtube.com/watch?v=nvbQQnvxXDk // http://www.youtube.com/watch?v=YzFCA-xUc8w&feature=dir + // src="http://www.youtube.com/embed/kge8zlJfwQQ" return array( - '@youtube\.com/v/([^"\&\? ]+)@i', + '@youtube\.com/(?:v|embed)/([^"\&\? ]+)@i', '@youtube\.com/watch\?v=([^"\& ]+)@i', '@youtube\.com/\?v=([^"\& ]+)@i', ); @@ -241,7 +242,7 @@ function emvideo_youtube_convert_color($ * a URL pointing to the thumbnail */ function emvideo_youtube_thumbnail($field, $item, $formatter, $node, $width, $height, $options = array()) { - if ($item['data']['thumbnail']['url']) { + if (isset($item['data']['thumbnail']['url'])) { return $item['data']['thumbnail']['url']; }