MediaInitializationSegment Class

An initialization segment of a SourceBuffer (https://w3c.github.io/media-source/#init-segment): the tracks of the next media segments.

public sealed class MediaInitializationSegment

Constructors

NameDescription
MediaInitializationSegment(IReadOnlyList<MediaSegmentTrack>, double)Creates an initialization segment.

MediaInitializationSegment(IReadOnlyList<MediaSegmentTrack>, double)

MediaSegmentParser.cs

Creates an initialization segment.

public MediaInitializationSegment(IReadOnlyList<MediaSegmentTrack> tracks, double duration = double.NaN)

Parameters

tracks IReadOnlyList<MediaSegmentTrack>
The audio and video tracks of the segment.
duration double
The duration of the presentation in seconds, or NaN when the segment has none (the duration of the MediaSource is then infinite).

Properties

NameDescription
DurationGets the duration of the presentation in seconds, or NaN.
InitDataGets the Initialization Data of the segment (e.g. the pssh boxes of the movie box of an MP4 file, as one cenc Initialization Data), or an empty list. Each one fires an encrypted event at the media element (https://w3c.github.io/encrypted-media/#initdata-encountered).
TracksGets the audio and video tracks of the segment.

Gets the duration of the presentation in seconds, or NaN.

public double Duration { get; }

Property value

double

Gets the Initialization Data of the segment (e.g. the pssh boxes of the movie box of an MP4 file, as one cenc Initialization Data), or an empty list. Each one fires an encrypted event at the media element (https://w3c.github.io/encrypted-media/#initdata-encountered).

public IReadOnlyList<MediaEncryptionInitData> InitData { get; init; }

Gets the audio and video tracks of the segment.

public IReadOnlyList<MediaSegmentTrack> Tracks { get; }