function _video_google_get_id in Video 6.2
Same name and namespace in other branches
- 5 types/video_google/video_google.module \_video_google_get_id()
- 6 types/video_google/video_google.module \_video_google_get_id()
Get the docid from an URL
3 calls to _video_google_get_id()
- theme_video_google_play in types/
video_google/ video_google.module - Play videos hosted on video.google.com Allows users to host videos on video.google.com and then use the video ID to post it in the module.
- video_google_v_auto_thumbnail in types/
video_google/ video_google.module - Implementation of hook_v_auto_thumbnail
- video_google_v_validate in types/
video_google/ video_google.module - implementation of hook_v_validate
File
- types/
video_google/ video_google.module, line 227 - Enable Google Video support for video module.
Code
function _video_google_get_id($url) {
$pattern = '/-?[0-9]+/';
// maybe too weak? some id have a leading -
preg_match_all($pattern, $url, $matches, PREG_PATTERN_ORDER);
return $matches[0][0];
}