Skip to content

Add AudioSource media type for plugin sources#1786

Merged
marcelveldt merged 4 commits into
mainfrom
feat/audio-source-mediatype
May 22, 2026
Merged

Add AudioSource media type for plugin sources#1786
marcelveldt merged 4 commits into
mainfrom
feat/audio-source-mediatype

Conversation

@marcelveldt
Copy link
Copy Markdown
Member

Summary

Mirrors the server's new AudioSource MediaItem so plugin sources (Spotify Connect, AirPlay receiver, Snapcast, VBAN, Yandex Ynison, …) surface as first-class browseable queue items instead of being injected into each player's source_list. The player OSD reads per-item capability flags (can_play_pause, can_seek, can_next_previous) so only the controls the source actually supports are rendered. Coordinates with the matching server PR; only fully functional once both ship.

Changes

  • MediaType.AUDIO_SOURCE enum value, new AudioSource interface (capability flags + exclusive / allow_external_trigger), SourceControl enum, added to MediaItemType and PlayableMediaItemType unions.
  • isAudioSource type guard in plugins/api/helpers.ts.
  • New useActiveAudioSource composable, mirroring useActiveSource.
  • Player OSD transport buttons (PlayBtn, NextBtn, PreviousBtn) hide via v-if when the active AudioSource doesn't advertise the capability; existing disabled behaviour kept for non-AudioSource items.
  • PlayerTimeline.canSeek defers to the active AudioSource's can_seek when present.
  • Player.vue lets the timeline render for both TRACK and AUDIO_SOURCE (seekability still gated by canSeek).
  • PlayerFullscreen hides the upcoming-tracks panel — and QueueBtn hides itself — when the active queue item is an AudioSource.
  • Genre icon map covers the new media type so the typed Record<MediaType, …> stays exhaustive.
  • audio_source translation key in en.json.
  • Vitest unit test for isAudioSource.

Mirror the server's new AudioSource MediaItem so plugin sources
(Spotify Connect, AirPlay receiver, Snapcast, VBAN, …) surface as
first-class browseable queue items. The player OSD honours the
per-source capability flags and hides controls/views that don't apply.
Match the models-repo cleanup: those members don't fit the source-control
contract — SELECT and VOLUME live on dedicated plugin hooks, STOP has no
cross-plugin meaning.
PlayBtn no longer disappears when the active source lacks play/pause
support — instead it swaps Pause for Stop while playback is running so
the user always has a way to terminate. Triggered by AudioSource items
without can_play_pause, source-list entries that don't advertise it,
and radio streams.
@marcelveldt marcelveldt merged commit da6272d into main May 22, 2026
8 of 9 checks passed
@marcelveldt marcelveldt deleted the feat/audio-source-mediatype branch May 22, 2026 08:21
github-actions Bot pushed a commit to music-assistant/server that referenced this pull request May 23, 2026
Update music-assistant-frontend to version
[2.17.162](https://github.com/music-assistant/frontend/releases/tag/2.17.162)


- i18n: add 'inspired_by_recently_played' recommendations key (by
@chrisuthe in
[#1791](music-assistant/frontend#1791))

## 🚀 Features and enhancements

- Add AudioSource media type for plugin sources (by @marcelveldt in
[#1786](music-assistant/frontend#1786))

## 🐛 Bugfixes

- Fix copy to clipboard (by @OzGav in
[#1742](music-assistant/frontend#1742))

## 🧰 Maintenance and dependency bumps

- Chore(deps): Bump js-cookie from 3.0.5 to 3.0.7 (by
@[dependabot[bot]](https://github.com/apps/dependabot) in
[#1788](music-assistant/frontend#1788))


## 🙇 Contributors

@OzGav, @chrisuthe and @marcelveldt

Co-authored-by: marcelveldt <6389780+marcelveldt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant