Skip to content

feat: Add video playback support for video songs#2861

Draft
kairosci wants to merge 20 commits intoMetrolistGroup:mainfrom
kairosci:feature/video-playback
Draft

feat: Add video playback support for video songs#2861
kairosci wants to merge 20 commits intoMetrolistGroup:mainfrom
kairosci:feature/video-playback

Conversation

@kairosci
Copy link
Contributor

@kairosci kairosci commented Feb 15, 2026

Problem
Video songs display only static thumbnails instead of playing video content.

Cause
The player lacks video playback integration. While the codebase tracks isVideoSong metadata, the UI only renders static images in the thumbnail area for all media types.

Solution

  • Created VideoPlayer component using Media3 PlayerView to render video content
  • Modified Thumbnail.kt to conditionally show VideoPlayer or static image based on media type
  • Added user preference toggle in appearance settings (disabled by default)
  • Added media3-ui dependency to support PlayerView

Testing
Feature builds successfully. Requires device testing with video songs from YouTube Music to verify playback functionality, performance, and battery impact.

Closes no specific issue (new feature implementation)

@kairosci kairosci force-pushed the feature/video-playback branch 2 times, most recently from 66e0703 to e321811 Compare February 15, 2026 15:53
@mostafaalagamy
Copy link
Member

Feedback: It gives us all a black screen

@mostafaalagamy mostafaalagamy marked this pull request as draft February 15, 2026 17:36
@mostafaalagamy
Copy link
Member

The settings option could be improved so that we use it within the player as a toggle button at the top instead of Now Playing!
youtube music

@kairosci kairosci force-pushed the feature/video-playback branch from f203d2e to 7e33307 Compare February 15, 2026 17:56
@mostafaalagamy
Copy link
Member

No video player shown yet!

-Add VideoPlayer component using Media3 PlayerView
- Add toggle button in Now Playing header
- Add EnableVideoPlaybackKey preference (defaults to true)
- Add appearance settings option for video playback
- Implement video streaming support in YTPlayerUtils (muxed formats)
- Pass video preference from MusicService to streaming layer
- Add videocam/videocam_off icons for toggle button
@kairosci kairosci force-pushed the feature/video-playback branch from 7e33307 to ee2b71b Compare February 15, 2026 18:30
@kairosci
Copy link
Contributor Author

I just discovered that the app only fetched audio, so I need to fetch mixed data.

When it's ready, I'll mark it as ready.

@alltechdev
Copy link
Contributor

alltechdev commented Feb 16, 2026

I just discovered that the app only fetched audio, so I need to fetch mixed data.

When it's ready, I'll mark it as ready.

I just discovered that the app only fetched audio, so I need to fetch mixed data.

When it's ready, I'll mark it as ready.

If you want adaptive streaming, above 720p you can use built in MergingMediaSource, TVHTML5 is a good primary client too.

Might need to apply PoToken and n transform same that we are using for web remix. I think so. Could be wrong.

@mostafaalagamy mostafaalagamy changed the base branch from master to main February 18, 2026 22:51
- Enhanced muxed format selection algorithm with network-aware quality scoring
- Added comprehensive logging for format selection debugging
- Improved aspect ratio handling with RESIZE_MODE_FIT for proper centering
- Optimized quality preference: 720p on unmetered, 480p on metered connections
- Disabled buffering indicator in video player for cleaner UI
- Ensured proper full-width video display matching YouTube Music behavior
CRITICAL FIX: Resolves issues where video wouldn't display and audio would block

The problem was that enableVideoPlayback was only read at service startup.
When users toggled video/audio during playback, the setting wasn't applied.

This caused:
- Service continued fetching audio-only even after enabling video
- VideoPlayer tried to show video but stream had no video tracks
- Audio could block due to mismatch between UI and stream format

Solution:
- Added dataStore listener for EnableVideoPlaybackKey changes
- On toggle, service now:
  1. Updates enableVideoPlayback value
  2. Clears cache for current media
  3. Reloads stream with correct format (muxed or audio-only)
  4. Resumes playback at same position
- Metadata automatically updated via recoverSong with correct isVideoFormat flag

Now video playback works seamlessly when toggling between audio/video modes.
@moonpic
Copy link

moonpic commented Feb 19, 2026

Screenshot_2026-02-19-17-40-52-224_com metrolist music debug
I hope I can see this functionality working soon!

- Always fetch muxed streams in YTPlayerUtils.
- Support switching between audio and video via track selection in MusicService (no reloading).
- Force 1:1 aspect ratio for song thumbnails in lists and grids.
- Add animated transitions between artwork and video in player.
- Ensure official music videos replace Art Tracks when video is enabled.
…pport

- Add squareThumbnail support to InnerTube models (Song, Album, Search, Next).
- Update player menus and settings for a more consistent muxed experience.
- Ensure all relevant UI components use the correct artwork sources.
@kairosci kairosci force-pushed the feature/video-playback branch from a0e4c02 to 1111bc2 Compare February 25, 2026 16:19
@kairosci
Copy link
Contributor Author

kairosci commented Feb 26, 2026

ONLY A LITTLE REMINDER.

TODO AT 25.2:

  • RESOLVE CONFLICT
  • FORCE VIDEO VISUALIZATION LAYER
  • BUILD CHECK
  • MANUALLY CHECK

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.

4 participants