Struct hls_m3u8::MediaPlaylist[][src]

#[non_exhaustive]
pub struct MediaPlaylist<'a> { pub target_duration: Duration, pub media_sequence: usize, pub discontinuity_sequence: usize, pub playlist_type: Option<PlaylistType>, pub has_i_frames_only: bool, pub has_independent_segments: bool, pub start: Option<ExtXStart>, pub has_end_list: bool, pub segments: StableVec<MediaSegment<'a>>, pub allowable_excess_duration: Duration, pub unknown: Vec<Cow<'a, str>>, }
Expand description

Media playlist.

Fields (Non-exhaustive)

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
target_duration: Duration

Specifies the maximum MediaSegment::duration. A typical target duration is 10 seconds.

Note

This field is required.

media_sequence: usize

The MediaSegment::number of the first MediaSegment that appears in a MediaPlaylist.

Note

This field is optional and by default a value of 0 is assumed.

discontinuity_sequence: usize

Allows synchronization between different renditions of the same VariantStream.

Note

This field is optional and by default a vaule of 0 is assumed.

playlist_type: Option<PlaylistType>

Provides mutability information about a MediaPlaylist.

  • PlaylistType::Vod indicates that the playlist must not change.

  • PlaylistType::Event indicates that the server does not change or delete any part of the playlist, but may append new lines to it.

Note

This field is optional.

has_i_frames_only: bool

Indicates that each MediaSegment in the playlist describes a single I-frame. I-frames are encoded video frames, whose decoding does not depend on any other frame. I-frame Playlists can be used for trick play, such as fast forward, rapid reverse, and scrubbing.

Note

This field is optional.

has_independent_segments: bool

This indicates that all media samples in a MediaSegment can be decoded without information from other segments.

Note

This field is optional and by default false. If the value is true it applies to every MediaSegment in this MediaPlaylist.

start: Option<ExtXStart>

Indicates a preferred point at which to start playing a playlist. By default, clients should start playback at this point when beginning a playback session.

Note

This field is optional.

has_end_list: bool

Indicates that no more MediaSegments will be added to the MediaPlaylist file.

Note

This field is optional and by default false. A false indicates that the client should reload the MediaPlaylist from the server, until a playlist is encountered, where this field is true.

segments: StableVec<MediaSegment<'a>>

A list of all MediaSegments.

Note

This field is required.

allowable_excess_duration: Duration

The allowable excess duration of each media segment in the associated playlist.

Error

If there is a media segment of which duration exceeds #EXT-X-TARGETDURATION + allowable_excess_duration, the invocation of MediaPlaylistBuilder::build() method will fail.

Note

This field is optional and the default value is Duration::from_secs(0).

unknown: Vec<Cow<'a, str>>

A list of unknown tags.

Note

This field is optional.

Implementations

Returns a builder for MediaPlaylist.

Computes the Duration of the MediaPlaylist, by adding each segment duration together.

Makes the struct independent of its lifetime, by taking ownership of all internal Cows.

Note

This is a relatively expensive operation.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.