Quantcast
Viewing all articles
Browse latest Browse all 7410

Access top window element from inside Kaltura kWidget

This can be easily done using dynamic embed and the player API. Here is a code sample:

<!DOCTYPE HTML>
<html>

<head>
</head>

<body>
<script src="http://cdnapi.kaltura.com/p/1645161/sp/164516100/embedIframeJs/uiconf_id/37095171/partner_id/1645161"></script>
<div id="kaltura_player" style="width: 560px; height: 395px;"></div>
<script>
    kWidget.embed({
        "targetId": "kaltura_player",
        "wid": "_1645161",
        "uiconf_id": 37095171,
        "readyCallback": function(playerId){
            var kdp = document.getElementById(playerId);
            kdp.kBind("playerPlayEnd", function(event){
                document.getElementById("output").innerText = "playerPlayEnd event fired!";
            });
        },
        "flashvars": {
            "streamerType": "auto"
        },
        "cache_st": 1484745034,
        "entry_id": "1_rhr59a0y"
    });
</script>

<pre id="output">Waiting for playerPlayEnd event...</pre>
</body>
</html>

Viewing all articles
Browse latest Browse all 7410

Trending Articles