Quantcast
Channel: Kaltura - Latest posts
Viewing all articles
Browse latest Browse all 7410

Aspect ratio question

$
0
0

"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.

<html>
<body>
<script src="http://cdnapi.kaltura.com/p/1645161/sp/164516100/embedIframeJs/uiconf_id/36343142/partner_id/1645161"></script>
<div id="kaltura_player" style="width: 660px; height: 395px;"></div>

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

</body>
</html>

Viewing all articles
Browse latest Browse all 7410

Trending Articles