avplayer
Safe Rust bindings for Apple's AVPlayer, AVPlayerItem, AVAsset, AVURLAsset, and AVAssetReader on macOS.
Status:
0.1.0covers practical playback + inspection workflows: URL/file assets, asynchronous key loading, track + metadata listing, basic AVPlayer control,AVPlayerItemobservation, time observers, and frame/sample reading throughAVAssetReaderoutputs.
Quick start
use *;
Highlights
UrlAsset::from_file_path/UrlAsset::from_remote_urlAsset::load_values_asynchronously,status_of_value,duration,tracks,metadataPlayer::from_url,Player::from_asset,play,pause,rate,seek_to,current_time,durationPlayerItem::observefor status / presentation-size / end-of-playback eventsPlayer::add_periodic_time_observer/add_boundary_time_observerAssetReader,AssetReaderTrackOutput,AssetReaderAudioMixOutput,AssetReaderVideoCompositionOutputVideoOutputSettings+AudioOutputSettingshelpers forAVAssetReaderconversion dictionariesapple-cfinterop forCMSampleBufferandCVPixelBuffer
Smoke example
The smoke example synthesizes a short AIFF under target/example-artifacts/, loads it as an AVURLAsset, inspects metadata/tracks, reads the first sample buffers through AVAssetReader, and exercises AVPlayer control + observer registration.
Notes
AVPlayerLayeris intentionally out of scope for this crate; it belongs to AppKit/UIKit presentation layers.- The current macOS SDK used for this release does not expose an
AVPlayerItem.externalMetadataproperty, soPlayerItem::metadata()returns the underlying asset metadata instead.
License
Licensed under either of Apache-2.0 or MIT at your option.