new SrgSsr()
- Source
Methods
(static) addBlockedSegments(player, segmentsopt)
Adds blocked segments to the player.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
player | module:video. | |||
segments | Array.<Segment> | <optional> | [] |
- Source
(static) addChapters(player, chapterUrn, chaptersopt)
Adds chapters to the player.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
player | module:video. | |||
chapterUrn | string | The URN of the main chapter. | ||
chapters | Array.<Chapter> | <optional> | [] |
- Source
(static) addIntervals(player, intervalsopt)
Adds intervals to the player.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
player | module:video. | |||
intervals | Array.<TimeInterval> | <optional> | [] |
- Source
(static) addRemoteTextTracks(player, subtitlesopt)
Adds remote text tracks from an array of subtitles.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
player | module:video. | |||
subtitles | Array.<Subtitle> | <optional> | [] |
- Source
(static) addTextTrackCue(textTrack, data)
Add a new cue to a text track with the given data.
Name | Type | Description |
---|---|---|
textTrack | TextTrack | |
data | Segment | | SRG SSR's cue-like representation |
- Source
(static) addTextTracks(player, srcMediaObj)
Add multiple text tracks to the player.
Name | Type | Description |
---|---|---|
player | module:video. | |
srcMediaObj | ComposedSrcMediaData |
- Source
(static) blockingReason(player, srcMediaObj) → {undefined|Boolean}
Set a blocking reason according to the block reason returned by mediaData.
Name | Type | Description |
---|---|---|
player | module:video. | |
srcMediaObj | ComposedSrcMediaData |
- Source
- Type:
- undefined |
Boolean
(async, static) composeAkamaiResources(resources) → {Promise.<Array.<MainResourceWithKeySystems>>}
Add the Akamai token to all resources if at least one of them has tokenType set to Akamai.
Name | Type | Description |
---|---|---|
resources | Array.<MainResourceWithKeySystems> |
- Source
- Type:
- Promise.<Array.<MainResourceWithKeySystems>>
(static) composeKeySystemsResources(resources) → {Array.<MainResourceWithKeySystems>}
Add the keySystems property to all resources if at least one of them has DRM.
Name | Type | Description |
---|---|---|
resources | Array.<MainResource> |
- Source
- Type:
- Array.<MainResourceWithKeySystems>
(static) composeMainResources(mediaComposition) → {Promise.<Array.<MainResourceWithKeySystems>>}
Get the main resources from a mediaComposition. May add an Akamai token or key systems if required by the resource.
Name | Type | Description |
---|---|---|
mediaComposition | MediaComposition |
- Source
- Type:
- Promise.<Array.<MainResourceWithKeySystems>>
(static) composeSrcMediaData(srcObj, resource) → {ComposedSrcMediaData}
Compose source options with media data. MediaData properties from source options overwrite mediaData from IL.
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
srcObj | any | Properties
| |||||||||
resource | MainResourceWithKeySystems |
- Source
- Type:
- ComposedSrcMediaData
(static) createTextTrack(player, trackId) → {Promise.<TextTrack>}
Create a new metadata text track.
Name | Type | Description |
---|---|---|
player | module:video. | |
trackId | String | Text track unique ID |
- Source
- Type:
- Promise.<TextTrack>
(static) cuechangeEventProxy(player)
Proxy SRG SSR chapters and intervals cuechange events at player level.
Name | Type | Description |
---|---|---|
player | module:video. |
- Source
(static) dataProvider(player) → {DataProvider}
SRG SSR data provider singleton.
Name | Type | Description |
---|---|---|
player | module:video. |
- Source
- Type:
- DataProvider
(static) dataProviderError(player, error) → {undefined|true}
Set an error if something goes wrong with the data provider.
Name | Type | Description |
---|---|---|
player | module:video. | |
error | Object |
- Source
- Type:
- undefined |
true
(static) error(player, error)
Set player error.
Name | Type | Description |
---|---|---|
player | module:video. | |
error | Object |
- Source
(static) filterIncompatibleResources(resources) → {Array.<MainResource>}
Filter out incompatible resources such as RTMP
and HDS
.
Name | Type | Description |
---|---|---|
resources | Array.<MainResource> | Resources to filter |
- Source
The filtered resources
- Type:
- Array.<MainResource>
(static) getBlockedSegment(player) → {VTTCue|undefined}
Get the current blocked segment from the player.
Name | Type | Description |
---|---|---|
player | module:video. |
- Source
The blocked segment cue object, or undefined
- Type:
- VTTCue |
undefined
(static) getBlockedSegmentByTime(player, currentTime) → {VTTCue|undefined}
Get the VTT cue of a blocked segment.
Name | Type | Description |
---|---|---|
player | module:video. | |
currentTime | Number |
- Source
The VTT cue of a blocked segment, or undefined
- Type:
- VTTCue |
undefined
(async, static) getMediaComposition(urn, requestHandler) → {Promise.<MediaComposition>}
Get mediaComposition from an URN.
Name | Type | Description |
---|---|---|
urn | String | |
requestHandler | function |
- Source
- Type:
- Promise.<MediaComposition>
(static) getMediaData(resources) → {MainResourceWithKeySystems}
Get the mediaData most likely to be compatible depending on the browser.
Name | Type | Description |
---|---|---|
resources | Array.<MainResourceWithKeySystems> |
- Source
By default, the first entry is used if none is compatible.
(async, static) getSrcMediaObj(player, srcObj) → {Promise.<ComposedSrcMediaData>}
Get the source media object.
Name | Type | Description |
---|---|---|
player | module:video. | |
srcObj | any |
- Source
- The composed source media data.
- Type:
- Promise.<ComposedSrcMediaData>
(static) handleCurrentTime(player, currentTime) → {number}
Handles the middleware's currentTime function.
- If the current time is between the start and end of a blocked segment, the blocked portion will be skipped.
Note: This function should disappear as soon as this behavior is supported on the packaging side.
Name | Type | Description |
---|---|---|
player | module:video. | |
currentTime | number |
- Source
- Type:
- number
(static) handleSetCurrentTime(player, currentTime) → {number}
Handles the middleware's setCurrentTime function.
- Modify the current time if the value is between the start and end of a blocked segment.
Note: This function should disappear as soon as this behavior is supported on the packaging side.
Name | Type | Description |
---|---|---|
player | module:video. | |
currentTime | number |
- Source
- Type:
- number
(async, static) handleSetSource(player, srcObj, next) → {Promise.<any>}
Handles the middleware's setSource function.
This function allows to:
- resolve a URN into media that can be played by the player
- initialize media playback tracking
- update the title bar
- handle blocking reasons
- add remote subtitles
Name | Type | Description |
---|---|---|
player | module:video. | |
srcObj | any | |
next | function |
- Source
- Type:
- Promise.<any>
(static) middleware(player) → {Object}
Middleware to resolve SRG SSR URNs into playable media.
Name | Type | Description |
---|---|---|
player | module:video. |
- Source
- Type:
- Object
(static) pillarboxMonitoring(player) → {PillarboxMonitoring}
PillarboxMonitoring monitoring singleton.
Name | Type | Description |
---|---|---|
player | module:video. |
- Source
instance of PillarboxMonitoring
- Type:
- PillarboxMonitoring
(static) srgAnalytics(player)
SRG SSR analytics singleton.
Name | Type | Description |
---|---|---|
player | module:video. |
- Source
(static) updatePoster(player, srcMediaObj, imageService)
Update player's poster.
Name | Type | Description |
---|---|---|
player | module:video. | |
srcMediaObj | ComposedSrcMediaData | |
imageService | Image |
- Source
(static) updateTitleBar(player, srcMediaObj)
Update player titleBar with title and description.
Name | Type | Description |
---|---|---|
player | module:video. | |
srcMediaObj | ComposedSrcMediaData |
- Source