Skip to content

feat: add "Start mix" — radio-style infinite playback from any video#5791

Open
bluegate-studio wants to merge 5 commits into
yuliskov:masterfrom
bluegate-studio:feature/start-mix
Open

feat: add "Start mix" — radio-style infinite playback from any video#5791
bluegate-studio wants to merge 5 commits into
yuliskov:masterfrom
bluegate-studio:feature/start-mix

Conversation

@bluegate-studio

Copy link
Copy Markdown

What

Adds a "Start mix" feature that triggers YouTube's algorithmic radio (mix) from any video, via two entry points:

  1. Context menu — long-press any video card → "Start mix". Clears the queue, clones the video with a RD-prefixed playlist ID, and opens fresh playback.
  2. Player button — a toggle button in the player toolbar. Mutates the current video in-place and reloads suggestions without restarting playback.

How it works

YouTube serves mix playlists when playlistId = "RD" + videoId with playlistIndex = 0 and playlistParams = null. This is the same mechanism the official app uses for "Start Radio".

Context menu path

VideoMenuPresenterPlaybackPresenter.startMix() — clones the video, sets mix playlist fields, opens via PlaybackPresenter.openVideo().

Player button path

PlayerUIController.onStartMixClicked() — mutates the currently playing Video object in-place, calls loadSuggestions() to fetch the mix chain. No playback restart — the current stream continues while suggestions load asynchronously.

Changes

  • VideoMenuPresenter — new "Start mix" menu item with guard
  • PlaybackPresenterstartMix() method (clone + open)
  • PlayerUIControlleronStartMixClicked() handler (mutate + reload)
  • PlayerSettingsPresenter — toggle for the player button
  • MainUIDataMENU_ITEM_START_MIX constant + default menu order
  • PlayerTweaksDataPLAYER_BUTTON_START_MIX constant, enabled by default
  • StartMixAction — new TwoStateAction subclass
  • VideoPlayerGlue — wires the action into the toolbar
  • Resourcesaction_start_mix.png (192×192, white on transparent), string, ID

Notes

  • The player button icon is PNG (not vector XML) because TwoStateAction casts to BitmapDrawable — vectors crash at runtime.
  • Enabled by default in both context menu and player toolbar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant