Constructor
new DataProvider(hostNameopt)
Creates an instance of DataProvider.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
hostName | string | <optional> | 'il.srgssr.ch' | The base host name for constructing URLs |
Methods
handleRequest(urlHandler, headers, queryParams) → {Promise.<MediaComposition>}
Handles requests by constructing URLs and fetching data.
This provides unified error handling, regardless of the urlHandler used.
Parameters:
| Name | Type | Description |
|---|---|---|
urlHandler | function | A function that constructs the URL |
headers | Object.<string, string> | | An object containing HTTP headers to be sent with the request |
queryParams | Object.<string, string> | The query params to be passed to the request URL |
Returns:
A promise with the fetched data
- Type:
- Promise.<MediaComposition>
mediaCompositionUrlHandler(urn, queryParamsopt) → {URL}
Gets the media composition URL by URN.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
urn | string | The URN for the media composition | |
queryParams | Object.<string, string> | <optional> | The query params to be passed to the request URL |
Returns:
The constructed URL
- Type:
- URL
setIlHost(hostName)
Sets the integration layer host name.
Parameters:
| Name | Type | Description |
|---|---|---|
hostName | string | The host name to set |
pillarbox-web