---
title: "Embed the TD Web Player"
slug: "embedding-the-td-web-player-sdk"
updated: 2026-02-20T15:12:20Z
published: 2026-02-20T15:12:20Z
canonical: "help.tritondigital.com/embedding-the-td-web-player-sdk"
---
> ## Documentation Index
> Fetch the complete documentation index at: https://help.tritondigital.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Embed the TD Web Player
You can embed a Triton Digital Web Player in a web page. You configure it with a JSON object that specifies the modules to load. Each module provides features for the player.
## Include the Web Player SDK
Include the following JavaScript library files in the body of your HTML page. For details, see [SDK Endpoints](/user/docs/sdk-endpoints).
```xml
...
```
## Configure and Embed the Media Player
This example configures and embeds a player in a web page:
- The web player is configured with a JSON object, **tdPlayerConfig.** The main property of this JSON object is **coreModules** and contains the list of modules to load.
- In this example, only the **MediaPlayer** module is defined, which specifies the **div** element **td_container** as the player’s container. For details, see [JSON Configuration Object](/user/docs/json-configuration-object).
- The media player instance is ready to be used when the function **onPlayerReady** is called.
- To attach other listeners on the SDK, use the function **addEventListener( eventName, callback )**.
```xml
TD Web Player SDK 2.9 - Simple implementation demo
```
## Module: MediaPlayer
Live playback of audio and video with cue points and ads features.
Example:
```javascript
{
id: 'MediaPlayer',
playerId: 'td_container'
}
```
### playerId
String. Required.
DOM Element used to embed the media player.
To be able to display video ads (preroll or video mid-rolls), you must define the CSS stylesheet on the **playerId** div element in the page. The SDK itself does not change any CSS stylesheet on the **playerId** div element, it is your responsibility to define the CSS stylesheet corresponding to your own integration. Example: when a preroll is playing, show the **playerId** element in the page, then when the live audio is playing, you can hide the **playerId** div element.
Register callbacks on the SDK events (ad-playback-start, ad-playback-complete, stream-start) to define the CSS styles at the right time.
**playerId: 'td_container'**
### platformId
String.
Platform environment.
Default: **'prod01'**
### sbm
Object.
Sideband Metadata configuration object.
If your station does not support Sideband metadata technology, set it to **false**. Then, stream data will be received via **aSyncCuePoint** technology (polling). If you don't want to receive data at all, set **aSyncCuePointFallback** to **false**.
**sbm: { active:true|false, aSyncCuePointFallback:true|false }**
### hls
Boolean.
Default value: **true**.
Activate / Deactivate HLS technology support (iOS only).
**hls: true/false**
### forceHls
Boolean. Default value: **false**.
Force HLS technology support on all platforms.
**forceHls: true/false**
### audioAdaptive
Boolean.
Activate / Deactivate Adaptive Audio support.
Default value: **false**.
**audioAdaptive: true/false**
### idSync
Object. Required.
Cookie synchronization configuration object.
Five options are available to support Cookie synchronization: **station**, **stationId**, **mount**, **gdpr**, and **gdpr_consent**. Each option automatically appends a Javascript script to the page’s **** element.
| Example option | Appended script |
| --- | --- |
| **idSync: {station:'ABCDFM'}** | **** |
| **idSync:{stationId:12345}** | **** |
| **idSync:{mount:'ABCFMAAC'}** | **** |
| **idSync: {gdpr: 0 \| 1}** **idSync: {gdpr_consent: 'consent string goes here'}** | Encodes the consented-to purposes and vendor consent string, as obtained from the [IAB Transparency and Consent Framework](https://advertisingconsent.eu/) CMP JS API. The result of the scripts that are to be loaded would be the above station identification followed by the two GDPR parameters: **