Audio track language in Tracks dialog (#1629)

This commit is contained in:
KingLucius
2025-03-30 16:29:17 +02:00
committed by GitHub
parent 4cc398447e
commit b9df1387d8

View File

@ -300,7 +300,13 @@ class GeneratorPlayer : FullScreenPlayer() {
override fun createCurrentContentIntent(player: Player): PendingIntent? { override fun createCurrentContentIntent(player: Player): PendingIntent? {
// Open the app without creating a new task to resume playback seamlessly // Open the app without creating a new task to resume playback seamlessly
return PendingIntentCompat.getActivity(context, 0, Intent(context, MainActivity::class.java), 0, false) return PendingIntentCompat.getActivity(
context,
0,
Intent(context, MainActivity::class.java),
0,
false
)
} }
override fun getCurrentContentText(player: Player): CharSequence? { override fun getCurrentContentText(player: Player): CharSequence? {
@ -1348,10 +1354,17 @@ class GeneratorPlayer : FullScreenPlayer() {
val audioArrayAdapter = val audioArrayAdapter =
ArrayAdapter<String>(ctx, R.layout.sort_bottom_single_choice) ArrayAdapter<String>(ctx, R.layout.sort_bottom_single_choice)
// audioArrayAdapter.add(ctx.getString(R.string.no_subtitles))
audioArrayAdapter.addAll(currentAudioTracks.mapIndexed { index, format -> audioArrayAdapter.addAll(currentAudioTracks.mapIndexed { index, format ->
format.label ?: format.language?.let { fromTwoLettersToLanguage(it) } when {
?: index.toString() format.label != null && format.language != null ->
"${format.label} - [${fromTwoLettersToLanguage(format.language) ?: format.language}]"
else -> format.label
?: format.language?.let { fromTwoLettersToLanguage(it) }
?: format.language
?: index.toString()
}
}) })
audioList.adapter = audioArrayAdapter audioList.adapter = audioArrayAdapter