#[non_exhaustive]pub enum PlaybackEvent {
Loaded,
Ended {
reason: EndReason,
},
PlaybackRestart,
PropertyChanged {
id: ObserveId,
name: String,
value: PropertyValue,
},
Shutdown,
Failed {
code: i32,
message: String,
},
}Expand description
Playback lifecycle notifications drained by Engine::pump_events.
Non-exhaustive: match with a wildcard arm — new variants are additive, not breaking.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Loaded
A file finished loading and playback is starting.
Ended
Playback ended without error. Errored ends arrive as
Failed instead.
Fields
reason: EndReasonWhy it ended — playlist logic usually advances on
EndReason::Eof and holds on EndReason::Stop.
PlaybackRestart
Playback (re)started after a seek completed or a file began
playing: the displayed frame matches time-pos again. Snap
scrubber/position UI here, not while a seek is still in flight.
PropertyChanged
An observed property changed (Engine::observe); also fires
once with the current value right after observation starts.
Fields
id: ObserveIdWhich observation this notification belongs to — matches the
ObserveId returned by Engine::observe, so two
observations of the same property stay distinguishable.
name: StringThe mpv property name, as passed to Engine::observe.
value: PropertyValueThe new value, in the PropertyFormat the observation chose.
Shutdown
The mpv core is shutting down — e.g. a quit issued through
Engine::command, or an input binding if input was enabled.
No further events follow; drop the Engine soon. (A file that
was playing also gets an Ended with
EndReason::Quit first.)
Failed
mpv aborted playback — unreadable, corrupt, empty, or an unrecognized/unsupported format.
Trait Implementations§
Source§impl Clone for PlaybackEvent
impl Clone for PlaybackEvent
Source§fn clone(&self) -> PlaybackEvent
fn clone(&self) -> PlaybackEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more