This document describes the Triton Digital Web Player SDK version 2.9. See the Archives page for previous versions. You can find a demo of the current SDK here: https://sdk.listenlive.co/web/2.9/playground/
For updates, see the Change Log.
When using the demo, consider what is the best integration of this SDK for your website, instead of using the playground page "as-is."
The Triton Digital Web Player SDK 2.9 allows you to create an HTML5 embeddable and chromeless media player connected to all Triton Digital services (i.e., Live Streaming, Ads, etc.) via JavaScript. HTML5 rendering mode is supported, so the media player is available on desktop, tablet, and mobile devices.
The Triton Digital Web Player SDK 2.9 does not provide a UI, except for a video projector used to display video ads and live video streams. The player UI interface and skinning have to be done in HTML, CSS, and JavaScript by the developer.
The Triton Digital Web Player SDK 2.9 is designed with a modular approach (AMD), where each module gives you access to a specific player feature (e.g., the MediaPlayer, described below, is a module and is required to play a stream or a preroll).
To Update from a Previous Version
If you were using a previous version of this SDK, your SDK integration will require the following changes to upgrade to version 2.9 :
- Update the JavaScript SDK URL:
<script src="//sdk.listenlive.co/web/2.9/td-sdk.min.js"></script> - Update the player configuration:
In previous versions, the core events where configured with event listeners and you had to call the loadModules() function on the player instance, as follows:var player = new TdPlayerApi( tdPlayerConfig ); player.addEventListener( 'player-ready', onPlayerReady ); player.addEventListener( 'configuration-error', onConfigurationError ); player.addEventListener( 'module-error', onModuleError ); player.loadModules();
In 2.9, the core events callbacks are now passed as configurations and the call to loadModules() is no longer required:
var tdPlayerConfig = {
coreModules: [{
id: 'MediaPlayer',
playerId: 'td_container'
}],
// The callbacks are defined in your source code.
playerReady: onPlayerReady,
configurationError: onConfigurationError,
moduleError: onModuleError,
adBlockerDetected: onAdBlockerDetected
};
// The call to loadModules() as been removed.
player = new TDSdk( tdPlayerConfig );