'guba', 'name' => $name, 'url' => VIDEO_CCK_GUBA_MAIN_URL, 'settings_description' => t('These settings specifically affect videos displayed from !guba. You can learn more about its !api here.', array('!guba' => l($name, VIDEO_CCK_GUBA_MAIN_URL, array('target' => '_blank')), '!api' => l(t('API'), VIDEO_CCK_GUBA_API_INFO, array('target' => '_blank')))), 'supported_features' => $features, ); } function video_cck_guba_settings() { $form['guba']['api'] = array( '#type' => 'fieldset', '#title' => t('GUBA API'), '#description' => t('If you wish to be able to display GUBA thumbnails automatically, you will first need to apply for an API Developer Key from the !guba. Note that you do not need this key to display GUBA videos themselves.', array('!guba' => l('GUBA Developer Profile page', VIDEO_CCK_GUBA_API_APPLICATION_URL, array('target' => '_blank')))), '#collapsible' => true, '#collapsed' => true, ); $form['guba']['api']['video_cck_guba_api_key'] = array( '#type' => 'textfield', '#title' => t('GUBA API Key'), '#default_value' => variable_get('video_cck_guba_api_key', ''), '#description' => t('Please enter your GUBA Developer Key here.'), ); $form['guba']['api']['video_cck_guba_api_secret'] = array( '#type' => 'textfield', '#title' => t('GUBA API Secret'), '#default_value' => variable_get('video_cck_guba_api_secret', ''), '#description' => t('If you have a secret for the GUBA API, enter it here.'), ); return $form; } function video_cck_guba_request($method, $args = array(), $cached = TRUE) { //$args = array('docid' => $embed); return module_invoke('emfield', 'request_xml', 'guba', "http://www.guba.com/rest/video/". $method ."/details", $args, $cacheable); } function video_cck_guba_extract($embed = '') { return array( '@http://www\.guba\.com/watch/([^"\?]+)@i', '@http://www\.guba\.com/f/root\.swf\?video_url=http://free\.guba\.com/uploaditem/([^"\?/]*)@i', ); } function video_cck_guba_embedded_link($video_code) { return 'http://www.guba.com/watch/'. $video_code; } function theme_video_cck_guba_flash($embed, $width, $height, $autoplay) { $autoplay = $autoplay ? '&autoPlay=true' : '&autoPlay=false'; $output .= ''; return $output; } function video_cck_guba_thumbnail($field, $item, $formatter, $node, $width, $height) { $thumbid = $item['value']; $thm = 'http://img.guba.com/public/video/f/58/'. $thumbid .'-m.jpg'; return $thm; } function video_cck_guba_video($embed, $width, $height, $field, $item, $autoplay) { $output = theme('video_cck_guba_flash', $embed, $width, $height, $autoplay); return $output; } function video_cck_guba_preview($embed, $width, $height, $field, $item, $autoplay) { $output = theme('video_cck_guba_flash', $embed, $width, $height, $autoplay); return $output; }