Skip to content

Post-reveal: play more of the song — longer clip, full track, or playback controls #44

Description

@colfin22

The reveal currently plays a fixed 12s "payoff" clip. Often you'll want to hear more once everyone's guessed — a longer snippet, or the whole song — and maybe with playback controls to keep it going. This is an enhancement to play more of the revealed track. Lots of choices to thrash out — research/spec only, not started.

How playback works today (grounding)

  • Clips are pre-cut MP3s: 5/10/20s intros + a 12s payoff (~40% into the song, clips.PAYOFF_LEN), served over HTTP.
  • Playback casts via ha.play_url()music_assistant.play_media with media_id = the clip URL, on the configured Music Assistant _ma player. Direct media_player.play_media to a _cast entity fails silently (chime, no audio) — MA must stream it through its own pipeline. MA calls can take >10s → fire-and-forget.
  • The full original track is reachable from Navidrome/Subsonic (subsonic.stream_url_params(song_id) / transcoded stream), so full-song playback doesn't need new clip storage — stream the library file, or let MA play the library track by its id.

Options — a scope ladder (cheapest → biggest)

  1. Longer payoff clip. Make PAYOFF_LEN configurable, or cut a second longer payoff (e.g. 30s) and play it on reveal. Smallest change; still finite; a bit more disk.
  2. Play the full song on reveal. Cast the full original track (stream from Navidrome via MA) instead of / after the payoff. Needs a stop/skip so the game can continue (songs run 3–4 min).
  3. Transport controls for the revealed song. Host gets play / pause / stop / skip / (seek / volume) for the revealed track on the cast speaker, then continues when ready — a mini-player using MA media_player.* services.
  4. Full library jukebox. Browse/search and play any library song on the speakers from the host UI. Much bigger, and largely duplicates Music Assistant itself — flag before pursuing.

Choices to thrash out

  • Trigger: auto-play on reveal, or an on-demand "🎵 play full song" button (host phone / board)?
  • What: longer clip vs full track vs configurable per game?
  • Where: the game's cast speaker, the board, or the host's phone?
  • Controls: fire-and-forget vs stop/skip vs full transport (pause / seek / volume)?
  • Game flow: a full song blocks the round — auto-stop on "next", or an explicit "stop & continue"? How it interacts with the existing 12s payoff gate.
  • Who: host-only, or anyone in the game?
  • Mechanism: pre-cut longer clip (file) vs stream the original from Navidrome via MA vs MA playing the library track by its Navidrome id.

Notes for whoever builds it

  • Keep the _ma-not-_cast rule and MA's >10s latency (fire-and-forget) in mind for any new playback path.
  • Transport controls need a real media_player entity to command (the _ma player or its _cast), not just a fire-and-forget play_media.

No work beyond research — this is a spec to discuss.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions