You are here

function theme_video_play_flash in Video 6.3

Same name and namespace in other branches
  1. 5 includes/common.inc \theme_video_play_flash()
  2. 6 includes/common.inc \theme_video_play_flash()
  3. 6.2 includes/common.inc \theme_video_play_flash()

Play videos from in FLV Flash video format

Parameters

$node: object with node information

Return value

string of content to display

1 theme call to theme_video_play_flash()
_video_common_get_player in includes/common.inc
Get the object for the suitable player for the parameter resource

File

includes/common.inc, line 90
Add some common functions for the various video types supported

Code

function theme_video_play_flash($element) {

  //TODO : remove item height set in here
  $video = file_create_url($element['#item']['filepath']);

  //  echo file_create_url($element['#item']['filepath']);
  $width = isset($element['#item']['data']['width']) ? $element['#item']['data']['width'] : '';
  $height = isset($element['#item']['data']['height']) ? $element['#item']['data']['height'] : '';
  $width = empty($width) ? '350px' : $width . 'px';
  $height = empty($height) ? '285px' : $height . 'px';
  $id = $element['#formatter'];
  if (module_exists('flowplayer')) {
    $output = theme('flowplayer', array(
      'clip' => array(
        'url' => $video,
        //TODO: Make settings for this
        'autoPlay' => variable_get('video_autoplay', TRUE),
        // Turn autoplay off
        'autoBuffering' => variable_get('video_autobuffering', TRUE),
      ),
    ), $id, array(
      'style' => "width: {$width}; height: {$height}",
    ));
  }
  else {
    $output = '<p>Use <b>SwfTools Module</b> to play FLV files if you only convert/upload FLV videos or <b>FlowPlayer Module</b> must be enabled in order to play FLV videos with other types.</p>';
  }
  return $output;
}