Examples

Available since
HbbTV 1.0 (ETSI TS 102 796 V1.1.1, OIPF DAE V1.1)

This section provides examples of the usage of the methods.

The first example shows  how to query whether an instance of the A/V Control object for a specified MIME type can be created without the application having to attempt to instantiate the object.

var videoPlayer;
if (window.oipfObjectFactory.isObjectSupported("video/mpeg")) {
 videoPlayer = window.oipfObjectFactory.createVideoMpegObject();
 // append object to document
 document.getElementById('playerDiv').appendChild(videoPlayer);
 videoPlayer.data = "rtsp://server/barker_channel";
}

If the OITF does not support the created object the OITF SHALL throw an error with the error.name set to the value “TypeError”. The example below shows how this can be used by applications:

try {
 configuration = window.oipfObjectFactory.createConfigurationObject();
}
catch (error) {
 alert("application/oipfConfiguration object could not be created - error name: " +
 error.name + " - error message: " + error.message);
}