avplayer
Safe Rust bindings for Apple's AVFoundation playback stack on macOS: AVPlayer, AVPlayerItem, AVPlayerLayer, AVQueuePlayer, AVPlayerLooper, AVAsset, AVURLAsset, and AVAssetReader.
Status:
0.2.1expands the crate from basic playback to broad player-subsystem coverage, including player-video-output, rendered-legible-output, metadata-collector, interstitial-event, and integrated-timeline APIs. SeeCOVERAGE.mdfor the per-area map.
Quick start
use *;
Highlights
AVAsset/AVURLAsset: async key loading, URL inspection, metadata, track enumeration, andUrlAssetOptions.AVPlayer: play/pause/rate/seek, volume + mute, action-at-item-end, time-control status, time observers, and media-selection criteria application.AVPlayerItem: observation callbacks, buffering/bit-rate/resolution preferences, audio time-pitch selection, loaded/seekable ranges, outputs, and per-item logs.AVPlayerLayer: player attachment, video gravity, video rect inspection, and displayed pixel-buffer access.AVQueuePlayer/AVPlayerLooper: queue mutation, current-item inspection, loop configuration, and loop-state reporting.AVPlayerItemVideoOutput,AVPlayerItemMetadataOutput, andAVPlayerItemLegibleOutput: attach/detach plus configuration/introspection helpers.AVPlayerItemTrack,AVPlayerItemAccessLog,AVPlayerItemErrorLog, andAVPlayerMediaSelectionCriteriawrappers.AVAssetReader,AssetReaderTrackOutput,AssetReaderAudioMixOutput, andAssetReaderVideoCompositionOutputremain available for frame/sample extraction.
Examples
Every requested subsystem area now has a numbered example:
01_smoke_surface02_avasset03_avurlasset04_avplayer05_avplayer_item06_avplayer_layer07_avqueue_player08_avplayer_looper09_avplayer_item_access_log10_avplayer_item_error_log11_avplayer_item_metadata_output12_avplayer_item_video_output13_avplayer_item_legible_output14_avplayer_item_track15_avplayer_media_selection_criteria
Run any example with:
Examples write synthesized media into target/example-artifacts/ and avoid /tmp.
Notes
AVPlayerItemTrackmaterialization is media- and readiness-dependent. On synthesizedAIFFs,AVFoundationmay legitimately report zeroAVPlayerItemTrackinstances until it fully prepares the item.- The current macOS SDK used for this release does not expose
AVPlayerItem.externalMetadata, soPlayerItem::metadata()continues to surface the underlying asset metadata.
License
Licensed under either of Apache-2.0 or MIT at your option.