You are here

function theme_video_flv in Video 6.4

Same name and namespace in other branches
  1. 6.5 video_formatter.inc \theme_video_flv()
  2. 7.2 video.theme.inc \theme_video_flv()
  3. 7 video.theme.inc \theme_video_flv()

Callback to FLV

1 theme call to theme_video_flv()
video_get_player in ./video_formatter.inc
Get the object for the suitable player for the parameter resource

File

./video_formatter.inc, line 179
Video formatter hooks and callbacks.

Code

function theme_video_flv($video, $node) {
  if ($video->flash_player == 'swftools') {
    $options = array(
      'params' => array(
        'width' => $video->player_width,
        'height' => $video->player_height,
      ),
      'othervars' => array(
        //@todo: swftools bug, can't enable this until they fix their pathing for the images.
        'image' => $video->thumbnail->swfthumb,
      ),
    );
    $themed_output = swf($video->files->{$video->player}->url, $options);
  }
  elseif ($video->flash_player == 'flowplayer') {
    $extraspace = intval(variable_get('video_flowplayer_extraplayerheight', 24));

    // kjh: use a playlist to display the thumbnail if not auto playing
    if (!$video->autoplay && $video->thumbnail->url) {
      $options = array(
        'playlist' => array(
          $video->thumbnail->url,
          array(
            'url' => urlencode($video->files->{$video->player}->url),
            'autoPlay' => $video->autoplay,
            'autoBuffering' => $video->autobuffering,
          ),
        ),
      );
    }
    else {
      $options = array(
        'clip' => array(
          'url' => urlencode($video->files->{$video->player}->url),
          'autoPlay' => $video->autoplay,
          'autoBuffering' => $video->autobuffering,
        ),
      );
    }
    $themed_output = theme('flowplayer', $options, $video->formatter, array(
      'style' => 'width:' . $video->player_width . 'px; height:' . ($video->player_height + $extraspace) . 'px;',
    ));
  }
  else {
    $themed_output = t('No flash player has been setup. ' . l(t('Please select a player to play Flash videos.'), 'admin/settings/video/players'));
  }
  return theme('video_play_flv', $video, $node, $themed_output);
}