You are here

function _video_scale_video in Video 6

Same name and namespace in other branches
  1. 5 video.module \_video_scale_video()
  2. 6.2 video.module \_video_scale_video()

Scale a video to match the desired width

1 call to _video_scale_video()
theme_video_player in ./video.module
theme function to control which player is presented

File

./video.module, line 1392
video.module

Code

function _video_scale_video(&$node) {
  $def_width = (int) variable_get("video_resolution_width", 400);
  if (!$node->videox || !$node->videoy) {
    $height = $def_width * 3 / 4;
  }
  else {
    $height = $def_width * ($node->videoy / $node->videox);

    // do you remember proportions?? :-)
  }
  $height = round($height);

  // add one if odd
  if ($height % 2) {
    $height++;
  }
  $node->video_scaled_x = $def_width;
  $node->video_scaled_y = $height;
}