You are here

function kaltura_calculate_player_size in Kaltura 6

Same name and namespace in other branches
  1. 5 includes/kaltura.themeing.inc \kaltura_calculate_player_size()
  2. 6.2 includes/kaltura.themeing.inc \kaltura_calculate_player_size()
1 call to kaltura_calculate_player_size()
kaltura_get_embed_options in includes/kaltura.themeing.inc

File

includes/kaltura.themeing.inc, line 612

Code

function kaltura_calculate_player_size($type, $size, $width = 0, $height = 0) {
  if ($width > 0 && $height > 0) {
    return array(
      'width' => $width,
      'height' => $height,
      'layout_id' => 'fullLarge',
    );
  }
  switch ($type) {
    case 'entry':
      $variable_width = variable_get('kaltura_entry_width', '410');
      $variable_height = variable_get('kaltura_entry_height', '364');
      break;
    case 'mix':
      $variable_width = variable_get('kaltura_mix_width', '410');
      $variable_height = variable_get('kaltura_mix_height', '364');
      break;
    case 'comment':
      $variable_width = variable_get('kaltura_comment_width', '250');
      $variable_height = variable_get('kaltura_comment_height', '244');
      break;
  }
  return array(
    'width' => $variable_width,
    'height' => $variable_height,
    'layout_id' => 'fullLarge',
  );
}