Skip to main content

PlayerItem

Struct PlayerItem 

Source
pub struct PlayerItem { /* private fields */ }
Expand description

Re-exports the AVPlayer framework surface for this item. Safe wrapper around AVPlayerItem.

Implementations§

Source§

impl PlayerItem

Source

pub fn from_file_path(path: impl AsRef<Path>) -> Result<Self, AVPlayerError>

Create a player item from a file path.

Source

pub fn from_remote_url(url: impl AsRef<str>) -> Result<Self, AVPlayerError>

Create a player item from a remote URL.

Source

pub fn from_asset(asset: &Asset) -> Result<Self, AVPlayerError>

Create a player item from an existing asset.

Source

pub fn status(&self) -> Result<PlayerItemStatus, AVPlayerError>

Calls the AVPlayer framework counterpart for status.

Source

pub fn error(&self) -> Result<Option<String>, AVPlayerError>

Calls the AVPlayer framework counterpart for error.

Source

pub fn duration(&self) -> Result<Time, AVPlayerError>

Calls the AVPlayer framework counterpart for duration.

Source

pub fn presentation_size(&self) -> Result<Size, AVPlayerError>

Calls the AVPlayer framework counterpart for presentation_size.

Source

pub fn metadata(&self) -> Result<Vec<MetadataItem>, AVPlayerError>

The current macOS SDK does not expose externalMetadata; this returns the underlying asset metadata instead.

Source

pub fn observe<F>( &self, callback: F, ) -> Result<PlayerItemObserver, AVPlayerError>
where F: Fn(PlayerItemEvent) + Send + 'static,

Calls the AVPlayer framework counterpart for observe.

Source§

impl PlayerItem

Source

pub fn automatically_loaded_asset_keys( &self, ) -> Result<Vec<String>, AVPlayerError>

Calls the AVPlayer framework counterpart for automatically_loaded_asset_keys.

Source

pub fn seekable_time_ranges(&self) -> Result<Vec<TimeRange>, AVPlayerError>

Calls the AVPlayer framework counterpart for seekable_time_ranges.

Source

pub fn loaded_time_ranges(&self) -> Result<Vec<TimeRange>, AVPlayerError>

Calls the AVPlayer framework counterpart for loaded_time_ranges.

Source

pub fn can_use_network_resources_for_live_streaming_while_paused( &self, ) -> Result<bool, AVPlayerError>

Calls the AVPlayer framework counterpart for can_use_network_resources_for_live_streaming_while_paused.

Source

pub fn set_can_use_network_resources_for_live_streaming_while_paused( &self, enabled: bool, )

Calls the AVPlayer framework counterpart for set_can_use_network_resources_for_live_streaming_while_paused.

Source

pub fn preferred_forward_buffer_duration(&self) -> Result<f64, AVPlayerError>

Calls the AVPlayer framework counterpart for preferred_forward_buffer_duration.

Source

pub fn set_preferred_forward_buffer_duration(&self, duration: f64)

Calls the AVPlayer framework counterpart for set_preferred_forward_buffer_duration.

Source

pub fn preferred_peak_bit_rate(&self) -> Result<f64, AVPlayerError>

Calls the AVPlayer framework counterpart for preferred_peak_bit_rate.

Source

pub fn set_preferred_peak_bit_rate(&self, value: f64)

Calls the AVPlayer framework counterpart for set_preferred_peak_bit_rate.

Source

pub fn preferred_peak_bit_rate_for_expensive_networks( &self, ) -> Result<f64, AVPlayerError>

Calls the AVPlayer framework counterpart for preferred_peak_bit_rate_for_expensive_networks.

Source

pub fn set_preferred_peak_bit_rate_for_expensive_networks(&self, value: f64)

Calls the AVPlayer framework counterpart for set_preferred_peak_bit_rate_for_expensive_networks.

Source

pub fn preferred_maximum_resolution(&self) -> Result<Size, AVPlayerError>

Calls the AVPlayer framework counterpart for preferred_maximum_resolution.

Source

pub fn set_preferred_maximum_resolution(&self, value: Size)

Calls the AVPlayer framework counterpart for set_preferred_maximum_resolution.

Source

pub fn preferred_maximum_resolution_for_expensive_networks( &self, ) -> Result<Size, AVPlayerError>

Calls the AVPlayer framework counterpart for preferred_maximum_resolution_for_expensive_networks.

Source

pub fn set_preferred_maximum_resolution_for_expensive_networks( &self, value: Size, )

Calls the AVPlayer framework counterpart for set_preferred_maximum_resolution_for_expensive_networks.

Source

pub fn audio_time_pitch_algorithm( &self, ) -> Result<AudioTimePitchAlgorithm, AVPlayerError>

Calls the AVPlayer framework counterpart for audio_time_pitch_algorithm.

Source

pub fn set_audio_time_pitch_algorithm( &self, algorithm: &AudioTimePitchAlgorithm, ) -> Result<(), AVPlayerError>

Calls the AVPlayer framework counterpart for set_audio_time_pitch_algorithm.

Source

pub fn output_count(&self) -> Result<usize, AVPlayerError>

Calls the AVPlayer framework counterpart for output_count.

Source

pub fn track_count(&self) -> Result<usize, AVPlayerError>

Calls the AVPlayer framework counterpart for track_count.

Source

pub fn variant_preferences(&self) -> Result<VariantPreferences, AVPlayerError>

Calls the AVPlayer framework counterpart for variant_preferences.

Source

pub fn set_variant_preferences( &self, preferences: VariantPreferences, ) -> Result<(), AVPlayerError>

Calls the AVPlayer framework counterpart for set_variant_preferences.

Source

pub fn authorization_required_for_playback(&self) -> Result<bool, AVPlayerError>

Calls the AVPlayer framework counterpart for authorization_required_for_playback.

Source

pub fn application_authorized_for_playback(&self) -> Result<bool, AVPlayerError>

Calls the AVPlayer framework counterpart for application_authorized_for_playback.

Source

pub fn content_authorized_for_playback(&self) -> Result<bool, AVPlayerError>

Calls the AVPlayer framework counterpart for content_authorized_for_playback.

Source

pub fn content_authorization_request_status( &self, ) -> Result<ContentAuthorizationStatus, AVPlayerError>

Calls the AVPlayer framework counterpart for content_authorization_request_status.

Source

pub fn custom_video_compositor( &self, ) -> Result<Option<PlayerItemVideoCompositorInfo>, AVPlayerError>

Calls the AVPlayer framework counterpart for custom_video_compositor.

Source§

impl PlayerItem

Source

pub fn access_log(&self) -> Result<Option<PlayerItemAccessLog>, AVPlayerError>

Calls the AVPlayer framework counterpart for access_log.

Source§

impl PlayerItem

Source

pub fn error_log(&self) -> Result<Option<PlayerItemErrorLog>, AVPlayerError>

Calls the AVPlayer framework counterpart for error_log.

Source§

impl PlayerItem

Source

pub fn integrated_timeline( &self, ) -> Result<PlayerItemIntegratedTimeline, AVPlayerError>

Calls the AVPlayer framework counterpart for integrated_timeline.

Source§

impl PlayerItem

Source

pub fn add_legible_output( &self, output: &PlayerItemLegibleOutput, ) -> Result<(), AVPlayerError>

Calls the AVPlayer framework counterpart for add_legible_output.

Source

pub fn remove_legible_output(&self, output: &PlayerItemLegibleOutput)

Calls the AVPlayer framework counterpart for remove_legible_output.

Source§

impl PlayerItem

Source

pub fn add_metadata_collector( &self, collector: &PlayerItemMetadataCollector, ) -> Result<(), AVPlayerError>

Calls the AVPlayer framework counterpart for add_metadata_collector.

Source

pub fn remove_metadata_collector(&self, collector: &PlayerItemMetadataCollector)

Calls the AVPlayer framework counterpart for remove_metadata_collector.

Source

pub fn media_data_collectors( &self, ) -> Result<Vec<PlayerItemMediaDataCollectorInfo>, AVPlayerError>

Calls the AVPlayer framework counterpart for media_data_collectors.

Source§

impl PlayerItem

Source

pub fn add_metadata_output( &self, output: &PlayerItemMetadataOutput, ) -> Result<(), AVPlayerError>

Calls the AVPlayer framework counterpart for add_metadata_output.

Source

pub fn remove_metadata_output(&self, output: &PlayerItemMetadataOutput)

Calls the AVPlayer framework counterpart for remove_metadata_output.

Source§

impl PlayerItem

Source

pub fn add_rendered_legible_output( &self, output: &PlayerItemRenderedLegibleOutput, ) -> Result<(), AVPlayerError>

Calls the AVPlayer framework counterpart for add_rendered_legible_output.

Source

pub fn remove_rendered_legible_output( &self, output: &PlayerItemRenderedLegibleOutput, )

Calls the AVPlayer framework counterpart for remove_rendered_legible_output.

Source§

impl PlayerItem

Source

pub fn tracks(&self) -> Result<Vec<PlayerItemTrack>, AVPlayerError>

Calls the AVPlayer framework counterpart for tracks.

Source§

impl PlayerItem

Source

pub fn add_video_output( &self, output: &PlayerItemVideoOutput, ) -> Result<(), AVPlayerError>

Calls the AVPlayer framework counterpart for add_video_output.

Source

pub fn remove_video_output(&self, output: &PlayerItemVideoOutput)

Calls the AVPlayer framework counterpart for remove_video_output.

Trait Implementations§

Source§

impl Debug for PlayerItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for PlayerItem

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for PlayerItem

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.