You are here

function theme_video_google_play in Video 6.2

Same name and namespace in other branches
  1. 5 types/video_google/video_google.module \theme_video_google_play()
  2. 6 types/video_google/video_google.module \theme_video_google_play()

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.

Parameters

$node: object with node information

Return value

string of content to display

1 theme call to theme_video_google_play()
video_google_v_play in types/video_google/video_google.module
Implementation of hook_v_play

File

types/video_google/video_google.module, line 181
Enable Google Video support for video module.

Code

function theme_video_google_play($node) {
  $width = $node->video_scaled_x ? $node->video_scaled_x : '425';
  $height = $node->video_scaled_y ? $node->video_scaled_y : '350';

  // Strip heading "google:"
  $videoid = _video_google_get_id(check_plain($node->vidfile));

  //$videoid = substr($node->vidfile, 7);

  // this will be executed by not Internet Explorer browsers
  $output = '<!--[if !IE]> <-->
<object type="application/x-shockwave-flash" width="' . $width . '" height="' . $height . '"
data="http://video.google.com/googleplayer.swf?docId=' . check_plain($videoid) . '">
<!--> <![endif]-->' . "\n";

  // this will be executed by Internet Explorer
  $output .= '<!--[if IE]>
<object type="application/x-shockwave-flash" width="' . $width . '" height="' . $height . '"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">
<![endif]-->' . "\n";

  // params will be passed to both IE or not IE browsers
  $output .= '<param name="movie" value="http://video.google.com/googleplayer.swf?docId=' . check_plain($videoid) . '" />' . "\n";

  // following a list of params simply copied from old embed tag params. I don't know if this are really needed.
  $output .= '<param name="quality" value="best" />
  <param name="bgcolor" value="#ffffff" />
  <param name="allowScriptAccess" value="sameDomain" />
  <param name="scale" value="noScale" />
  <param name="wmode" value="transparent" />
  <param name="salign" value="TL" />
  <param name="FlashVars" value="playerMode=embedded" />' . _video_get_parameters($node) . '<p>' . t('Your browser is not able to display this multimedia content.') . '</p>
</object>';
  $output = theme('video_format_play', $output, t('http://video.google.com/support'), t('Link to video.google.com'), t('video.google.com'));
  return $output;
}