Skip to content

Add audio and subtitle track selection to new video player - #5527

Open
johnpc wants to merge 4 commits into
jellyfin:masterfrom
johnpc:feature/new-player-track-selection
Open

Add audio and subtitle track selection to new video player#5527
johnpc wants to merge 4 commits into
jellyfin:masterfrom
johnpc:feature/new-player-track-selection

Conversation

@johnpc

@johnpc johnpc commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Changes

Adds audio and subtitle track selection to the new Compose-based video player, bringing it closer to feature parity with the old player.

subtitle-track-selector audio-track-selector

- Add TrackSelectionBackend interface to playback core
- Implement track selection in ExoPlayerBackend using TrackSelectionOverride
- Add ExternalSubtitle support - loads external subs via SubtitleConfiguration
- Expose trackSelection property on PlaybackManager
- Add AudioTrackButton and SubtitleTrackButton Compose UI components
- Wire up buttons in VideoPlayerControls
- Audio button hidden when <2 tracks, subtitle button hidden when no tracks

This brings the new player closer to feature parity with the old player.
@johnpc
johnpc requested a review from nielsvanvelzen as a code owner April 13, 2026 01:52
@Pentaphon

Pentaphon commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

@johnpc please keep an eye on contrast issues when it comes to UI elements. The light checkmark on the light selector background is hard for some people to see. The checkmark should be dark when selected.

Use Button's inherited content color for the checkmark icon instead of
a fixed color. This ensures proper contrast - dark checkmark on light
focused background, light checkmark on dark unfocused background.
@johnpc

johnpc commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing! I added a commit to update the style for more contrast, lmk what you think.

subtitle-track-contrast-fixed audio-track-contrast-fixed

Comment thread app/src/main/res/values/strings.xml Outdated
<string name="lbl_playback_speed">Playback speed</string>
<string name="lbl_quality_profile">Quality profile</string>
<string name="lbl_subtitle_track">Select subtitle track</string>
<string name="no_tracks_available">No tracks available</string>
// Add external subtitles
if (stream.externalSubtitles.isNotEmpty()) {
setSubtitleConfigurations(stream.externalSubtitles.map { sub ->
MediaItem.SubtitleConfiguration.Builder(android.net.Uri.parse(sub.url))
Comment on lines +123 to +130
private fun TrackSelectionPopover(
expanded: Boolean,
onDismissRequest: () -> Unit,
tracks: List<PlayerTrack>,
title: String,
showNoneOption: Boolean = false,
onTrackSelected: (PlayerTrack?) -> Unit,
) {
expanded = expanded,
onDismissRequest = onDismissRequest,
alignment = Alignment.TopCenter,
offset = DpOffset(0.dp, (-5).dp),
val languageName = language?.let { code ->
try {
Locale.forLanguageTag(code).displayLanguage.takeIf { it.isNotBlank() && it != code }
} catch (e: Exception) {
val languageName = language?.let { code ->
try {
Locale.forLanguageTag(code).displayLanguage.takeIf { it.isNotBlank() && it != code }
} catch (e: Exception) {
return tracks
}

override fun selectTrack(type: TrackType, index: Int): Boolean {
.build()
exoPlayer.trackSelectionParameters = params
true
} catch (e: Exception) {
@nielsvanvelzen nielsvanvelzen added the enhancement New feature or request label May 9, 2026
@nielsvanvelzen nielsvanvelzen added this to the v0.20.0 milestone May 9, 2026
@jellyfin-bot jellyfin-bot added the merge conflict Conflicts prevent merging label May 9, 2026
@nielsvanvelzen nielsvanvelzen removed this from the v0.20.0 milestone May 9, 2026
…track-selection

# Conflicts:
#	app/src/main/java/org/jellyfin/androidtv/ui/player/video/VideoPlayerControls.kt
@jellyfin-bot jellyfin-bot removed the merge conflict Conflicts prevent merging label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants