Tutorials

Fast Media Switch API and the switchMediaPresentation method

HbbTV targeted advertising enables the delivery of digital video adverts over broadband that replace part of linear TV services received by terminals via DVB-T(2)/C(2)/S(2) and perhaps IPTV when based on MPEG-2 transport streams. Thereby, digital video adverts are shown on targeted terminals instead of the original broadcast adverts, which will be seen by viewers on all non-targeted terminals.

It is possible to deliver a targeted advertising experience using the standard features of HbbTV standard (ETSI TS 102 796), e.g. for a broadcast to broadband switch, calling the stop method on a video/broadcast object, waiting for the state change to complete and then calling play on an HTML5 video element, however the HbbTV® targeted advertising standard (ETSI TS 103 736-1) aims to enable a more seamless viewing experience.

For this purpose, HbbTV® targeted advertising defines the Fast Media Switch API and the corresponding switchMediaPresentation method:
 

The switchMediaPresentation method belongs to a non-visual embedded object of type “application/hbbtvMediaSwitcher”, class MediaSwitcher. Applications seeking to use the Fast Media Switch API should first check XML device capabilities for one or more <ta> elements (the xmlCapabilities property of the “application/oipfCapabilities” embedded object) and then obtain the “application/hbbtvMediaSwitcher” embedded object either by fetching it from the DOM or by using MediaSwitcher createMediaSwitcher() method of the Object Factory HbbTV API, as specified in the Annex A1 of the HbbTV® targeted advertising standard (ETSI TS 103 736-1).

 
For example:


// ... the embedded object
<object id="mediaSwitcher" type="application/hbbtvMediaSwitcher" width="300" height="150"></object>
// ... obtain the object from the DOM
<script>
let theMediaSwitcher = document.getElementById("mediaSwitcher")
</script>