Integration with JW Player

There are several available options available to embed JW Player on your website, as explained on JW Player’s site. The easiest way to setup JW Player to work with Teltoo is using the cloud-hosted player ; it assumes you have the content hosted externally. If you are using JW Platform, we will cover the setup differences later. Teltoo also works with a self-hosted JW Player. Although that option won’t be included in this document, the setup is almost the same.

To setup JW Player to work with Teltoo, include the player script, teltoo.js, and jwplayer-teltoo.js in the order below. The code example below is based on actual snippets from JW Player documentation .



<!-- Include jwplayer script -->
<script src="//content.jwplatform.com/players/PLAYERID.js">
</script>
<!-- Include Teltoo SDK and the adapter for jwplayer  -->
<script src="//TS_HOST/teltoo.js" data-teltoo-api-key=”TELTOO_API_KEY”></script>
<script src="//TS_HOST/jwplayer-teltoo/jwplayer-teltoo-cloud.min.js"></script>

<!-- Instantiate and setup player -->
<div id="myElement">Loading the player...</div>
<script type="text/javascript">
    var playerInstance = jwplayer("myElement");
    playerInstance.setup({
        file: "//example.com/uploads/myVideo.m3u8",
        image: "//example.com/uploads/myPoster.jpg",
    });
</script>

In the previous snippet, PLAYERID is replaced with the ID of the cloud player being referenced, as noted in JW player documentation .

If you are serving the media from JW Platform, you will need to provide the player script for the particular media or set the mediaid in the setup call: mediaid: “MEDIAID” .



<!-- Include jwplayer script -->
<script src="//content.jwplatform.com/players/MEDIAID-PLAYERID.js"></script>
<!-- ... -->

Supported Protocols

Currently, Teltoo works with HLS encoded video streams (either live or on demand). If you use a different type of encoding, the stream will be delivered as usual through your server or CDN.

Copied to Clipboard