interface SourceConfigOptions {
    audioCodecPriority?: string[];
    dashManifestWithCredentials?: boolean;
    dashWithCredentials?: boolean;
    headers?: HttpHeaders;
    hlsManifestWithCredentials?: boolean;
    hlsWithCredentials?: boolean;
    manifestWithCredentials?: boolean;
    persistentPoster?: boolean;
    shouldRecreateSourceBuffersOnPeriodSwitch?: ((sourcePeriodInfo, targetPeriodInfo, suggestion) => boolean);
    startOffset?: number;
    startOffsetTimelineReference?: TimelineReferencePoint;
    startTime?: number;
    videoCodecPriority?: string[];
    withCredentials?: boolean;
}

Properties

audioCodecPriority?: string[]

Specify the priority of audio codecs for this source. If more than one audio codec is available this order will be respected while finding a codec which is supported by the current browser. Default is audioCodecPriority

Since

7.6

dashManifestWithCredentials?: boolean

Send credentials and cookies along with cross origin MPEG-DASH manifest requests. Must be supported by the server. Default is false.

dashWithCredentials?: boolean

Send credentials and cookies along with cross origin MPEG-DASH segment requests. Must be supported by the server. Default is false.

headers?: HttpHeaders
hlsManifestWithCredentials?: boolean

Send credentials and cookies along with cross origin HLS manifest requests. Must be supported by the server. Default is false.

hlsWithCredentials?: boolean

Send credentials and cookies along with cross origin HLS segment requests. Must be supported by the server. Default is false.

manifestWithCredentials?: boolean

Send credentials and cookies along with cross origin manifest (HLS and MPEG-DASH) requests. Must be supported by the server. Default is false.

persistentPoster?: boolean

If set to true, this will keep the poster image visible during playback, e.g. for audio-only streams.

shouldRecreateSourceBuffersOnPeriodSwitch?: ((sourcePeriodInfo, targetPeriodInfo, suggestion) => boolean)

With this callback it's possible to override the player's default behavior regarding the recreation of SourceBuffers when switching periods.

The downside of SourceBuffer recreation is a prolonged transition time with possible black frames between the periods. The upside is increased stability: not recreating SourceBuffers may result in PLAYBACK_VIDEO_DECODING_ERROR, or a stuck video element on many platforms. This also depends on the playing content itself.

The Bitmovin player is taking a fairly offensive approach on SourceBuffer recreation, meaning it will recreate the SourceBuffers when there is any risk that the content might get stuck.

Type declaration

    • (sourcePeriodInfo, targetPeriodInfo, suggestion): boolean
    • Parameters

      • sourcePeriodInfo: PeriodInformation

        The information of the period the player is switching away from.

      • targetPeriodInfo: PeriodInformation

        The information of the period the player is switching into.

      • suggestion: boolean

        The default behavior suggested by the player, true for recreation, false for reusing.

      Returns boolean

Returns

true for SourceBuffer recreation, false for re-using.

Since

8.87.0

startOffset?: number

The position where the stream should be started. Number can be positive or negative depending on the used TimelineReferencePoint. Invalid numbers will be corrected according to the stream boundaries. For VOD this is applied at the time the stream is loaded, for LIVE when the playback starts.

Example:

// Start a VOD stream at 10.5 seconds
{
startOffset: 10.5,
startOffsetTimelineReference: TimelineReferencePoint.Start // also the default value
}

// Start a LIVE stream 20 seconds behind the live edge
{
startOffset: -20,
startOffsetTimelineReference: TimelineReferencePoint.End // also the default value
}

Since

8.9.0

startOffsetTimelineReference?: TimelineReferencePoint

Timeline reference point to calculate startOffset from. Default for live: TimelineReferencePoint.End Default for VOD: TimelineReferencePoint.Start

startTime?: number

The position in fractional seconds to start playback from.

Since

7.1

Deprecated

use StartOffset instead

videoCodecPriority?: string[]

Specify the priority of video codecs for this source. If more than one video codec is available this order will be respected while finding a codec which is supported by the current browser. Default is videoCodecPriority

Since

7.6

withCredentials?: boolean

Send credentials and cookies along with cross origin (HLS and MPEG-DASH) segment requests. Must be supported by the server. Default is false.