Skip to content

feat(player): add support for Jellyfin Merge Versions plugin#75

Merged
MakD merged 3 commits intoMakD:masterfrom
DarkseidAM:multi-version-support
Mar 5, 2026
Merged

feat(player): add support for Jellyfin Merge Versions plugin#75
MakD merged 3 commits intoMakD:masterfrom
DarkseidAM:multi-version-support

Conversation

@DarkseidAM
Copy link
Contributor

This commit introduces full support for selecting and playing different media versions grouped by the Jellyfin Merge Versions plugin. Key Features:

  • Pre-play Version Picker: Intercepts the primary Play action on the ItemDetailScreen. If an item contains multiple remote sources (versions), it prompts the user with a newly created VersionPickerDialog to select their preferred version before launching the player.
  • In-Player Version Switching: Added a Versions button to the PlayerControls interface (visible only when multiple sources exist). Users can seamlessly switch between versions mid-playback via the new VersionPickerSheet, which seamlessly resumes playback from the current position.
  • Sticky Autoplay Logic: Re-architected auto-play logic within PlayerViewModel (loadMedia and playQueueItem). Autoplaying the next episode now intelligently selects the source that best matches the previously played version (matching by source name, then video height) across fetched items. Data Layer & Architecture:
  • Enriched the AfinitySource data model to extract and store display-oriented fields from Jellyfin's MediaSourceInfo (bitrate, container, audioCodec, videoCodec, width, height).
  • Introduced PlayerEvent.SwitchVersion to orchestrate on-the-fly source switching.
  • Refactored PlayerViewModel to manage the lifecycle and UI state of version pickers natively.

@MakD
Copy link
Owner

MakD commented Mar 4, 2026

I really loved the player version switcher, but a query. The version dialogue on play button click, seems redundant, as we already have a version selector. User can select the version to play already.
Screenshot_20260304-084202

@MakD
Copy link
Owner

MakD commented Mar 4, 2026

Also, I reckon, version switcher to be aligned with the bottom controls in the playercontrols.kt
Screenshot_20260304-091005

@DarkseidAM
Copy link
Contributor Author

DarkseidAM commented Mar 4, 2026

I really loved the player version switcher, but a query. The version dialogue on play button click, seems redundant, as we already have a version selector. User can select the version to play already.
Screenshot_20260304-084202

Ahh, so what happened was the names of my jellyfin items were too long. Didn't know those pills were horizontally scrollable. On the other hand that works only work for movies, this popup is for episodes also. Can disable for movies if needed

@DarkseidAM
Copy link
Contributor Author

Also, I reckon, version switcher to be aligned with the bottom controls in the playercontrols.kt
Screenshot_20260304-091005

Yeah, sure

@MakD
Copy link
Owner

MakD commented Mar 4, 2026

I really loved the player version switcher, but a query. The version dialogue on play button click, seems redundant, as we already have a version selector. User can select the version to play already.
Screenshot_20260304-084202

Ahh, so what happened was the names of my jellyfin items were too long. Didn't know those pills were horizontally scrollable. On the other hand that works only work for movies, this popup is for episodes also. Can disable for movies if needed

Yeah that would be perfect. Let the pills handle for movies, and dialog for episodes👍

@MakD
Copy link
Owner

MakD commented Mar 4, 2026

Do let me know once the changes are pushed, will test and merge 👍

This commit introduces full support for selecting and playing different media versions grouped by the Jellyfin Merge Versions plugin.
Key Features:
- Pre-play Version Picker: Intercepts the primary Play action on the ItemDetailScreen. If an item contains multiple remote sources (versions), it prompts the user with a newly created VersionPickerDialog to select their preferred version before launching the player.
- In-Player Version Switching: Added a Versions button to the PlayerControls interface (visible only when multiple sources exist). Users can seamlessly switch between versions mid-playback via the new VersionPickerSheet, which seamlessly resumes playback from the current position.
- Sticky Autoplay Logic: Re-architected auto-play logic within PlayerViewModel (loadMedia and playQueueItem). Autoplaying the next episode now intelligently selects the source that best matches the previously played version (matching by source name, then video height) across fetched items.
Data Layer & Architecture:
- Enriched the AfinitySource data model to extract and store display-oriented fields from Jellyfin's MediaSourceInfo (bitrate, container, audioCodec, videoCodec, width, height).
- Introduced PlayerEvent.SwitchVersion to orchestrate on-the-fly source switching.
- Refactored PlayerViewModel to manage the lifecycle and UI state of version pickers natively.
@DarkseidAM DarkseidAM force-pushed the multi-version-support branch from 6dc83db to 9679e5d Compare March 4, 2026 18:09
@DarkseidAM
Copy link
Contributor Author

@MakD

  • Disabled Dialog for Movies
  • Fixed height for version selection in PlayerView and made it scrollable

@MakD MakD merged commit e8d144a into MakD:master Mar 5, 2026
@MakD
Copy link
Owner

MakD commented Mar 5, 2026

@DarkseidAM bro totally my fault, i f'd up a merge conflict. That isnwhar happens when you merge prs from the web, without your morning coffee. Can you open another here was the issue

onPlayClick = { item, selection -> onPlayClick(item, selection) },
. I want to retain your authorship for this. Just the click interceptor I missed out

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.

2 participants