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
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 MediaSegment
s 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>>
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>>
Implementations
Returns a builder for MediaPlaylist
.
Computes the Duration
of the MediaPlaylist
, by adding each segment
duration together.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<'a> RefUnwindSafe for MediaPlaylist<'a>
impl<'a> Send for MediaPlaylist<'a>
impl<'a> Sync for MediaPlaylist<'a>
impl<'a> Unpin for MediaPlaylist<'a>
impl<'a> UnwindSafe for MediaPlaylist<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more