DataProvider

Represents a data provider for constructing URLs and handling requests.

Constructor

new DataProvider(hostNameopt)

Creates an instance of DataProvider.

Parameters:
NameTypeAttributesDefaultDescription
hostNamestring<optional>
'il.srgssr.ch'

The base host name for constructing URLs

Methods

handleRequest(urlHandler) → {Promise.<MediaComposition>}

Handles requests by constructing URLs and fetching data.

This provides unified error handling, regardless of the urlHandler used.

Parameters:
NameTypeDescription
urlHandlerfunction

A function that constructs the URL

Returns:

A promise with the fetched data

Type: 
Promise.<MediaComposition>

mediaCompositionUrlHandler(urn) → {string}

Gets the media composition URL by URN.

Parameters:
NameTypeDescription
urnstring

The URN for the media composition

Returns:

The constructed URL

Type: 
string

setIlHost(hostName)

Sets the integration layer host name.

Parameters:
NameTypeDescription
hostNamestring

The host name to set