Aspect ratio question

We currently have 2 different players setup, one where the aspect ratio is set to 16:9 videos and one where it is set to a 4:3 aspect ratio. Depending on what size a video is we assign one player or the other.

I also understand that if we set the aspect ratio to “Custom” then it will auto adjust the height to match the width. I am wondering if there is any advantage to setting a specific aspect ratio versus just setting it to custom with a width and have it determined automatically?

“Custom” allows you to set width and height that do not respect the aspect ratio. It uses fixed width and height and doesn’t calculate the height automatically.
If you want the player to resize itself to the exact size of the video, you can use the following script in your embed code.
Note that if you have a fixed control bar you need to add its height (36 is the default unless you have a custom style). If you are using hovering controls – no need to add the control bar height.

<script src=""></script>
<div id="kaltura_player" style="width: 660px; height: 395px;"></div>

        "targetId": "kaltura_player",
        "wid": "_1645161",
        "uiconf_id": 36343142,
        "readyCallback": function(playerId){
            var kdp = document.getElementById(playerId);
            kdp.kBind("SourceSelected", function(source){
       = parseInt(source.width);
       = parseInt(source.height) + 36;
        "flashvars": {},
        "cache_st": 1472965410,
        "entry_id": "1_rhr59a0y"

1 Like

Thank you so much @amir_chervinsky1, this is very helpful. Two quick follow up questions -

1- Can this be implemented into a player in the studio or would it need to be manually added?
2- Is there a way to have a fix width but have the height ratio adjust?

  1. This is currently a manual fix only. The reason for this behavior not being supported in Studio is that it changes the page layout once the video loads and this should be controlled manually.
  2. Using the code I provided you can of course calculate the video aspect ratio (width / height) and implement a fixed width and a calculated height. Please let me know if you need a code sample for that.


1 Like