Interface SourceDescription

Describes the configuration of a player's source.

interface SourceDescription {
    ads?: AdDescription[];
    analytics?: AnalyticsDescription[];
    blockContentIfAdError?: boolean;
    contentProtection?: DRMConfiguration;
    drm?: DRMConfiguration;
    manifestMetadataTrack?: boolean;
    metadata?: ChromecastMetadataDescription;
    mutedAutoplay?: MutedAutoplayConfiguration;
    playAdsAfterTime?: number;
    poster?: string;
    sources?: Sources;
    textTracks?: TextTrackDescription[];
    timeServer?: string;
    vr?: VRConfiguration;
}

Hierarchy (view full)

Properties

List of AdDescriptions to be queued for playback.

analytics?: AnalyticsDescription[]

List of AnalyticsDescriptions to configure analytics integrations for the media source.

blockContentIfAdError?: boolean

Whether the player should be blocked when an ad-related error occurs.

Remarks


- A blocked player is not usable anymore. This has the same effect as invoking ChromelessPlayer.destroy.

Default Value

false

contentProtection?: DRMConfiguration

Content protection configuration.

Content protection configuration.

Deprecated

Superseded by SourceConfiguration.contentProtection.

manifestMetadataTrack?: boolean

Whether segments in a HLS manifest should be represented by cues in a metadata text track.

Deprecated

Do not use this feature without consulting THEO Technologies.

Chromecast metadata configuration.

Remarks


- Available since v2.21.0.

The muted autoplay policy.

Remarks


- The muted autoplay policy is impacted by this property and PlayerConfiguration.mutedAutoplay.

Default Value

'none'

playAdsAfterTime?: number

If set, only allow ads to play that are scheduled after this time.

Remarks


- This setting is strictly after - e.g. setting playAdsAfterTime to 15 will cause the player to ignore an ad break scheduled to play at 15s.

poster?: string

The poster of the media source.

Remarks


- An empty string ('') clears the current poster.
- This poster has priority over ChromelessPlayer.poster.

sources?: Sources

One or more media resources for playback.

Remarks


- Multiple media sources should be used to increase platform compatibility. See examples below for important use cases.
- The player will try each source in the provided order.

Example

In this example, the player will first try to play the DASH source. This might fail if the browser does not support the Widevine or PlayReady CDM, for example on Safari. In that case, the player will try to play the HLS source instead.

[{
src: 'dash-source-with-drm.mpd'
contentProtection: {
widevine: {
licenseAcquisitionURL: 'https://license.company.com/wv'
},
playready: {
licenseAcquisitionURL: 'https://license.company.com/pr'
}
}
},{
src: 'hls-source-with-drm.m3u8',
contentProtection: {
fairplay: {
certificateURL: 'https://license.company.com/fp'
}
}
}]

Example

In this example, the player will first try to play the DASH source. This might fail if the browser does not support the Media Source Extensions API. In that case, the player will try to play the MP4 source instead, though without features such as adaptive bitrate switching.

[{
src: 'source.mpd'
},{
src: 'source.mp4'
}]
textTracks?: TextTrackDescription[]

List of text tracks to be side-loaded with the media source.

Remarks


- A source change will reset side-loaded text tracks.

timeServer?: string

The URL of a time server used by the player to synchronise the time in DASH sources.

Remarks


- The time server should return time in ISO-8601 format.
- Overrides the time server provided the DASH manifest's <UTCTiming>.
- All sources will use the time server. Alternatively, for one source use BaseSource.timeServer.

Virtual reality configuration.

Generated using TypeDoc