MediaTailor on Web
AWS Elemental MediaTailor is a service that provides scalable ad insertion and channel assembly. It is able to serve targeted ad content to viewers and create linear streams while maintaining broadcast quality in over-the-top (OTT) video applications. It supports HLS and DASH for both VOD and live workflows.
At the moment of writing only linear ads are supported, but it is possible to expand it to non-linear and companion ads as well.
Configuration
There are three requirements to use a MediaTailor stream with THEOplayer:
- Have a THEOplayer build with the
mediatailorfeature flag set. - The
srcis set to the session initialization URL. - The integration parameter is set with the value
mediatailor.
If everything is set up correctly, THEOplayer will play the stream and send the necessary tracking beacons.
const player = new THEOplayer.Player(element, {
libraryLocation: 'path/to/theoplayer',
license: 'your-license-here',
...
});
player.source = {
sources: [
{
src: '<mediatailorURL>/v1/session/<hashed-account-id>/<origin-id>/<asset-id>',
integration: 'mediatailor'
}
]
}
Optionally, you can pass parameters regarding e.g. session data and device type by using the adsParams property, as
described in the MediaTailor documentation.
player.source = {
sources: [
{
src: '...',
integration: 'mediatailor',
adsParams: {
param1: 'value1', // key is not case sensitive
param2: 'value2', // Values can contain spaces. For example, 'value 2' is an allowed value.
},
},
],
};
Limitations
The scope of the MediaTailor integration for now is limited to sending the tracking beacons. This encapsulates only the events that can be sent with the default implementation of THEOplayer. For example skipping an ad is not yet supported so the events that correspond to skipping an ad will never occur.
Seeking is only disabled during an ad, no logic is in place for playing an ad if the user seeked past it.