Integration with Shaka Player
First, include your Shaka player scripts. You can do this from the available CDN (see example below) or from your host. Then add the teltoo.js SDK and shaka-teltoo.js scripts from the provided teltoo-scripts-host.
<!-- Include Shaka Player script --> <script src="//cdnjs.cloudflare.com/ajax/libs/shaka-player/2.0.6/shaka-player.compiled.js"></script> <!-- Include Teltoo SDK and the plugin for shaka player --> <script src="//TS_HOST/teltoo.js" data-teltoo-api-key=”TELTOO_API_KEY”></script> <script src="//TS_HOST/shaka-player-teltoo/teltoo-shaka-player.min.js"></script> <!-- Video tag --> <video id="my-video" width="640" controls></video> <script> // initialize the player as usual var video = document.getElementById('my-video'); var player = new shaka.Player('my-video'); </script>
The example above assumes that the <video> tag on your site has the ID my-video. If that is not the case, do not include an extra video tag and replace my-video appearances with the ID of your <video> tag.
Other shaka player versions
The current documentation assumes you are using shaka player version 2.0.
If you are using shaka player version 2.2 or 2.3 replace the script tag that includes the file teltoo-shaka-player.min.js with
If you are using shaka player version 2.4 replace the script tag that includes the file teltoo-shaka-player.min.js with
Older versions of shaka are also supported with the scripts included above. However, if you find any issue with a particular version, please let us know at email@example.com
Currently, the teltoo-shaka.js plugin works only with DASH encoded video streams (either live or on-demand).