mediaplayer-rs
Safe Rust bindings for Apple's MediaPlayer.framework on macOS — Now Playing info and Remote Commands.
Status: v0.1.0 covers
MPNowPlayingInfoCentermetadata,MPRemoteCommandCenterhandler registration, andMPMediaItemArtworkcreation from file paths.
Quick start
use *;
Highlights
NowPlayingInfoCenter— fluentNowPlayingInfobuilder,set_now_playing_info,set_playback_state,clear(), auto-clear on drop.RemoteCommandCenter—add_handler+ per-command convenience (on_play,on_pause,on_toggle_play_pause,on_next_track,on_previous_track,on_skip_forward,on_skip_backward,on_seek_forward,on_seek_backward,on_change_playback_position).CommandToken— RAII guard that deregisters and frees the handler on drop.Artwork—MPMediaItemArtworkfrom a file path; optional explicit boundsCGSizeviaapple-cf.constants— now-playing info dictionary key strings for documentation reference.
Availability
MPNowPlayingInfoCenter,MPRemoteCommandCenter— macOS 10.12.2+MPNowPlayingInfoCenter.playbackState— macOS 10.12.2+MPMediaItemArtwork(boundsSize:requestHandler:)— macOS 10.12.2+
Smoke example
License
Licensed under either of Apache-2.0 or MIT at your option.