'metacafe', 'name' => $name, 'url' => VIDEO_CCK_METACAFE_MAIN_URL, 'settings_description' => t('These settings specifically affect videos displayed from !provider.', array('!provider' => l($name, VIDEO_CCK_METACAFE_MAIN_URL, array('target' => '_blank')))), 'supported_features' => $features, ); } function video_cck_metacafe_settings() { $form = array(); return $form; } /** * we're going to handle our own matches, unless someone can come up with a regex that will match this better */ function video_cck_metacafe_extract($embed) { // http://www.metacafe.com/watch/479957/gorilla_prank/ if ($embed && preg_match('@metacafe\.com/watch/(.[^/]*)/(.[^/]*)/@i', $embed, $matches)) { return $matches[1] .'/'. $matches[2]; } else if ($embed && preg_match('@metacafe\.com/watch/(.[^/]*)/(.*)@i', $embed, $matches)) { return $matches[1] .'/'. $matches[2]; } //
Gorilla Prank - Celebrity bloopers here else if ($embed && preg_match('@metacafe\.com/fplayer/(.[^/]*)/(.[^\.]*)\.@i', $embed, $matches)) { return $matches[1] .'/'. $matches[2]; } return false; } function video_cck_metacafe_video_link($video_code) { return 'http://www.metacafe.com/watch/'. $video_code .'/'; } function theme_video_cck_metacafe_flash($embed, $width, $height, $autoplay) { if ($embed) { $autoplay = $autoplay ? '?playerVars=autoPlay=yes' : ''; $output .= ''; } return $output; } function video_cck_metacafe_thumbnail($field, $item, $formatter, $node, $width, $height) { $picturelink=substr($item['value'], 0, 6); return 'http://www.metacafe.com/thumb/'. $picturelink .'.jpg'; } function video_cck_metacafe_video($embed, $width, $height, $field, $item, $autoplay) { $output = theme('video_cck_metacafe_flash', $embed, $width, $height, $autoplay); return $output; } function video_cck_metacafe_preview($embed, $width, $height, $field, $item, $autoplay) { $output = theme('video_cck_metacafe_flash', $embed, $width, $height, $autoplay); return $output; }