NativeMediaSession
trait · ferroui-media-video · v0.5.0
trait NativeMediaSession
Narrow platform boundary. poll reports native facts, not requested intent.
Implementations must release native resources on Drop and keep returned frame
allocations immutable until the last lease/GPU completion releases them.
Members
has_pending_frame_workstateplaypausestopseekset_audiosupports_playback_rateset_playback_ratesupports_castingcasttracksselect_trackcaption_texttake_frame
has_pending_frame_work
fn has_pending_frame_work(self: &Self) -> bool
A producer/import is still pending, including a ready native image waiting for bounded GPU storage. Presentation must keep polling even while native playback is paused or ended; submission is not readiness.
state
fn state(self: &Self) -> Result<MediaPlaybackSession, MediaError>
play
fn play(self: &Self) -> MediaFuture<()>
pause
fn pause(self: &Self) -> Result<(), MediaError>
stop
fn stop(self: &Self) -> Result<(), MediaError>
Retires pending preview output while preserving source ownership. The player separately resets seekable media and owns frame-zero publication.
seek
fn seek(self: &Self, position: Duration) -> MediaFuture<Duration>
set_audio
fn set_audio(self: &Self, volume: f64, muted: bool) -> Result<(), MediaError>
supports_playback_rate
fn supports_playback_rate(self: &Self) -> bool
set_playback_rate
fn set_playback_rate(self: &Self, _rate: f64) -> Result<(), MediaError>
supports_casting
fn supports_casting(self: &Self) -> bool
cast
fn cast(self: &Self) -> MediaFuture<()>
tracks
fn tracks(self: &Self, _kind: MediaTrackKind) -> Vec<MediaTrack>
select_track
fn select_track(self: &Self, _kind: MediaTrackKind, _id: Option<u32>) -> Result<(), MediaError>
caption_text
fn caption_text(self: &Self) -> Option<String>
take_frame
fn take_frame(self: &Self) -> Result<Option<FrameLease>, MediaError>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.