function _video_apiclient_google_get_thumbnail_url in Video 5
Same name and namespace in other branches
- 6 types/video_google/video_google.module \_video_apiclient_google_get_thumbnail_url()
- 6.2 types/video_google/video_google.module \_video_apiclient_google_get_thumbnail_url()
1 call to _video_apiclient_google_get_thumbnail_url()
- video_google_v_auto_thumbnail in types/
video_google/ video_google.module - Implementation of hook_v_auto_thumbnail
File
- types/
video_google/ video_google.module, line 115 - Enable Google Video support for video module.
Code
function _video_apiclient_google_get_thumbnail_url($id) {
$xml = _video_apiclient_google_request($id);
// we *should* be able to use media:thumbnail
// but unfortunately, that is stripped out from the request hook
// so instead, we'll parse it from the description, where it's repeated.
// TODO: look into how to fix this...
$desc = $xml['ITEM']['DESCRIPTION'][0];
$regex = '@<img src="([^"]*)"@';
if (preg_match($regex, $desc, $matches)) {
return $matches[1];
}
return null;
}