예제 #1
0
 function calculatePlayerHeight($type, $width)
 {
     $player = KalturaHelpers::getPlayerByType($type);
     $aspectRatio = @$player["videoAspectRatio"] ? $player["videoAspectRatio"] : "4:3";
     $hSpacer = @$player["horizontalSpacer"] ? $player["horizontalSpacer"] : 0;
     $vSpacer = @$player["verticalSpacer"] ? $player["verticalSpacer"] : 0;
     switch ($aspectRatio) {
         case "4:3":
             $screenHeight = ($width - $hSpacer) / 4 * 3;
             $height = $screenHeight + $vSpacer;
             break;
         case "16:9":
             $screenHeight = ($width - $hSpacer) / 16 * 9;
             $height = $screenHeight + $vSpacer;
             break;
     }
     return round($height);
 }