Skip to content

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

Open
DarkseidAM wants to merge 1 commit intoMakD:masterfrom
DarkseidAM:multi-version-support
Open

feat(player): add support for Jellyfin Merge Versions plugin#75
DarkseidAM wants to merge 1 commit intoMakD:masterfrom
DarkseidAM:multi-version-support

Conversation

@DarkseidAM
Copy link

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.

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
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
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 👍

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