Follow-up to #351. The Windows backend (crates/perry-ui-windows/src/media_playback.rs v0.5.429) ships full playback via Windows.Media.Playback.MediaPlayer (WinRT) but setNowPlaying is a no-op — the volume HUD media tile, Bluetooth headphone media keys, and the Edge / Chromium Now Playing widget don't see anything from a Perry app.
Scope
WinRT MediaPlayer exposes a SystemMediaTransportControls property (and the related SystemMediaTransportControlsDisplayUpdater) that are the canonical surface. Wire setNowPlaying(handle, title, artist, album, artworkUrl) through it:
- Get the player's
SystemMediaTransportControls via MediaPlayer.SystemMediaTransportControls.
- Set
IsPlayEnabled / IsPauseEnabled / IsStopEnabled / IsNextEnabled / IsPreviousEnabled = true.
- Build a
SystemMediaTransportControlsDisplayUpdater, set Type = MusicProperties.Music, populate MusicProperties.Title / Artist / AlbumArtist.
- For artwork:
RandomAccessStreamReference.CreateFromUri(uri) on https:// URLs, or CreateFromFile on file:// paths — assigned to Thumbnail.
- Subscribe to the
ButtonPressed event so headphone / volume-HUD play/pause/skip events route to the existing play / pause / stop FFI thunks.
- Push a
PlaybackStatus update on every state-poller flip so the system UI doesn't show stale state.
windows-crate features
Already on Media_Playback + Media_Core + Foundation (added in v0.5.429). Will need Media (for SMTC types) and Storage_Streams (for RandomAccessStreamReference).
Acceptance
Files
crates/perry-ui-windows/src/media_playback.rs::set_now_playing — currently a no-op
crates/perry-ui-windows/Cargo.toml — add Media + Storage_Streams features
Follow-up to #351. The Windows backend (
crates/perry-ui-windows/src/media_playback.rsv0.5.429) ships full playback viaWindows.Media.Playback.MediaPlayer(WinRT) butsetNowPlayingis a no-op — the volume HUD media tile, Bluetooth headphone media keys, and the Edge / Chromium Now Playing widget don't see anything from a Perry app.Scope
WinRT MediaPlayer exposes a
SystemMediaTransportControlsproperty (and the relatedSystemMediaTransportControlsDisplayUpdater) that are the canonical surface. WiresetNowPlaying(handle, title, artist, album, artworkUrl)through it:SystemMediaTransportControlsviaMediaPlayer.SystemMediaTransportControls.IsPlayEnabled / IsPauseEnabled / IsStopEnabled / IsNextEnabled / IsPreviousEnabled = true.SystemMediaTransportControlsDisplayUpdater, setType = MusicProperties.Music, populateMusicProperties.Title / Artist / AlbumArtist.RandomAccessStreamReference.CreateFromUri(uri)on https:// URLs, orCreateFromFileon file:// paths — assigned toThumbnail.ButtonPressedevent so headphone / volume-HUD play/pause/skip events route to the existingplay / pause / stopFFI thunks.PlaybackStatusupdate on every state-poller flip so the system UI doesn't show stale state.windows-crate features
Already on
Media_Playback+Media_Core+Foundation(added in v0.5.429). Will needMedia(for SMTC types) andStorage_Streams(for RandomAccessStreamReference).Acceptance
setNowPlayingpopulates the Windows volume-HUD media tile.ButtonPressed.PlaybackStatusupdates.Files
crates/perry-ui-windows/src/media_playback.rs::set_now_playing— currently a no-opcrates/perry-ui-windows/Cargo.toml— addMedia+Storage_Streamsfeatures