'; break; case 'window': $wmode = ' wmode="window" allowfullscreen="true"'; $wmode_param = ''; break; } $flashvars = 'file='. $video['file'] . $img_vars . $img_intro . $time_vars . $logo_vars . $logo_link . $repeat . '&autostart='.$video['autostart']; $output .= ''; $output .= ''. $wmode_param .''; $output .= ''; $output = _theme_flashvideo_format_play($video['nodetype'], $output, t('http://www.macromedia.com/go/getflashplayer'), t('Link to Macromedia Flash Player Download Page'), t('Download latest Flash Player')); return $output; } /** * Play Flash .swf files. * * @param $node * object with node information * * @return * string of content to display */ function theme_flashvideo_play_swf($video) { // this will be executed by not Internet Explorer browsers $output .= ''; $output .= ''; $output .= ' '; // this will be executed by Internet Explorer $output .= ''; // params will be passed to both IE or not IE browsers $output .= ''; $output .= _flashvideo_get_parameters($video); $output .= '

'. t('Your browser is not able to display this multimedia content.') .'

'; $output = _theme_flashvideo_format_play($video['nodetype'], $output, t('http://www.macromedia.com/go/getflashplayer'), t('Link to Flash player download'), t('Download the latest Flash player')); return $output; } /** * Play videos hosted on youtube.com * Allows users to host videos on youtube.com and then use the video ID to post it in the module. * In the future it could also use the youtube developer API to get info and comments of the video. * * @param $video * object with node information * * @return * string of content to display */ function theme_flashvideo_play_youtube($video) { // Get the window mode $wmode = ''; $wmode_param = ''; switch(flashvideo_variable_get($video['nodetype'], 'mode', 'window')) { case 'transparent': $wmode = ' wmode="transparent"'; $wmode_param = ''; break; case 'window': $wmode = ' wmode="window" allowfullscreen="true"'; $wmode_param = ''; break; } // this will be executed by not Internet Explorer browsers $output = ''; $output .= ''; $output .= ' '; // this will be executed by Internet Explorer $output .= ''; // params will be passed to both IE or not IE browsers $output .= '' . $wmode_param; $output .= _flashvideo_get_parameters($video); $output .= '

'. t('Your browser is not able to display this multimedia content.') .'

'; $output = _theme_flashvideo_format_play($video['nodetype'], $output, t('http://www.youtube.com/t/help_center'), t('Link to youtube.com'), t('youtube.com')); return $output; } /** * 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. * * @param $video * object with node information * * @return * string of content to display */ function theme_flashvideo_play_googlevideo($video) { // Strip heading "google:" $videoid = substr($video['file'], 7); // Get the window mode $wmode = ''; $wmode_param = ''; switch(flashvideo_variable_get($video['nodetype'], 'mode', 'window')) { case 'transparent': $wmode = ' wmode="transparent"'; $wmode_param = ''; break; case 'window': $wmode = ' wmode="window" allowfullscreen="true"'; $wmode_param = ''; break; } // this will be executed by not Internet Explorer browsers $output = ''; $output .= ''; $output .= ' '; // this will be executed by Internet Explorer $output .= ''; // params will be passed to both IE or not IE browsers $output .= ''; // following a list of params simply copied from old embed tag params. I don't know if this are really needed. $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= $wmode_param; $output .= ''; $output .= ''; $output .= _flashvideo_get_parameters($video); $output .= '

'. t('Your browser is not able to display this multimedia content.') .'

'; $output = _theme_flashvideo_format_play($video['nodetype'], $output, t('http://video.google.com/support'), t('Link to video.google.com'), t('video.google.com')); return $output; } /** * Play videos hosted on Brightcove * Allows users to host videos on brightcove.com and then use the video ID to post it in the module. * * @param $video * object with node information * * @return * string of content to display */ function theme_flashvideo_play_brightcove($video) { // Strip heading "google:" $videoid = substr($video['file'], 11); // Get the window mode $wmode = ''; $wmode_param = ''; switch(flashvideo_variable_get($video['nodetype'], 'mode', 'window')) { case 'transparent': $wmode = ' wmode="transparent"'; $wmode_param = ''; break; case 'window': $wmode = ' wmode="window" allowfullscreen="true"'; $wmode_param = ''; break; } // this will be executed by not Internet Explorer browsers $output = ''; $output .= ''; $output .= _flashvideo_get_parameters($video); $output = ''; $output .= ''; return $output; } /** * Play Director .dcr/.dir files. * * @param $node * object with node information * * @return * string of content to display */ function theme_flashvideo_play_dcr($video) { // this will be executed by not Internet Explorer browsers $output .= ''; $output .= ''; $output .= ' '; // this will be executed by Internet Explorer $output .= ''; // params will be passed to both IE or not IE browsers $output .= ''; $output .= _flashvideo_get_parameters($video); $output .= '

'. t('Your browser is not able to display this multimedia content.') .'

'; $output = _theme_flashvideo_format_play($video['nodetype'], $output, t('http://www.macromedia.com/shockwave/download/'), t('Link to Macromedia Shockwave Player Download Page'), t('Download latest Shockwave Player')); return $output; } /** * Play videos from in Quicktime format * * @see http://developer.apple.com/internet/ieembedprep.html * @param $node * object with node information * * @return * string of content to display */ function theme_flashvideo_play_quicktime($video) { //Increase the height to accommodate the player controls on the bottom. // this will be executed by not Internet Explorer browsers $output = ''; $output .= ''; $output .= ' '; // this will be executed by Internet Explorer $output .= ''; // params will be passed to both IE or not IE browsers $output .= ''; $output .= ''; $output .= ''; $output .= _flashvideo_get_parameters($video); $output .= '

'. t('Your browser is not able to display this multimedia content.') .'

'; // only one needed becouse only one opening tag has been parsed by browsers /* Removed for now... $output = ''; */ $output = _theme_flashvideo_format_play($video['nodetype'], $output, t('http://www.apple.com/quicktime/download'), t('Link to QuickTime Download Page'), t('Download latest Quicktime Player')); return $output; } /** * Play videos from in Realmedia format * * @param $node * object with node information * * @return * string of content to display */ function theme_flashvideo_play_realmedia($video) { // Real's embeded player includes the controls // in the height // this will be executed by not Internet Explorer browsers $output = ''; $output .= ''; $output .= ' '; // this will be executed by Internet Explorer $output .= ''; // params will be passed to both IE or not IE browsers $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= _flashvideo_get_parameters($video); $output .= '

'. t('Your browser is not able to display this multimedia content.') .'

'; // only one needed becouse only one opening tag has been parsed by browsers $output = _theme_flashvideo_format_play($video['nodetype'], $output, t('http://www.real.com/'), t('Link to Real'), t('Download latest Realmedia Player')); return $output; } /** * Play videos from in WindowsMediaVideo format * * @param $video * object with node information * * @return * string of content to display */ function theme_flashvideo_play_windowsmedia($video) { // Windows Media's embeded player includes the controls in the height // this will be executed by not Internet Explorer browsers $output = ''; $output .= ''; $output .= ' '; // this will be executed by Internet Explorer $output .= ''; // params will be passed to both IE or not IE browsers $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= _flashvideo_get_parameters($video); $output .= '

'. t('Your browser is not able to display this multimedia content.') .'

'; // only one needed becouse only one opening tag has been parsed by browsers $output = _theme_flashvideo_format_play($video['nodetype'], $output, t('http://windowsupdate.microsoft.com/'), t('Link to Windows Update'), t('Download latest Windows Media Player')); return $output; } /** * Play Ogg Theora videos with Cortado Applet * * @param $node * object with node information * * @return * string of content to display */ function theme_flashvideo_play_ogg_theora($video) { global $base_url; $cortado_location = variable_get('video_cortado', $base_url . '/cortado.jar'); $output = ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= 'This browser does not have a Java Plug-in.
'; $output .= 'Get the latest Java Plug-in here.
'; $output .= '
'; $output = _theme_flashvideo_format_play($video['nodetype'], $output, t('http://java.com/download/'), t('Link to java.com'), t('Download Java')); return $output; } /** * Cut down on redundant link text * * @param $url * string URL to link to * * @param $title * string title of link to show on mouseover * * @param $link_text * string text of the link * * @return * string HTML link */ function _theme_flashvideo_format_play($node_type, $output, $url, $title, $link_text) { $output = '
' . $output; if(flashvideo_variable_get($node_type, 'download', 0)) { $output .= '

'. t('Problems viewing videos?'); $output .= '
'; $output .= l($link_text, $url, array('title' => $title), NULL, NULL, TRUE) . '

'; } return $output . '
'; } /** * Import the video.js script */ function theme_flashvideo_get_script() { drupal_set_html_head(''); } /** * Takes an associative array of $fields with 'title' and 'body' keys and outputs the HTML. * This theme function allows the same HTML code to generate all the custom and metadata fields. * * @param $fields * array with 'title' and 'body' keys * * @return * string of content to display */ function theme_flashvideo_fields($fields) { $output = ''; $odd_even = 'odd'; foreach ($fields as $field) { $output .= '
' . check_plain($field['title']) . ' ' . check_plain($field['body']) . '
'; $odd_even = ($odd_even == 'odd') ? 'even' : 'odd'; //Always switch its value. } return $output; } ?>