From de1bf7f74697ba7f79b0604ab3a1f097b3369d43 Mon Sep 17 00:00:00 2001 From: chrisk325 Date: Fri, 27 Feb 2026 16:39:13 +0530 Subject: [PATCH] fix for when player does not return lang --- .../player/android/components/VideoSurface.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/player/android/components/VideoSurface.tsx b/src/components/player/android/components/VideoSurface.tsx index e34d7d60..dd43af7e 100644 --- a/src/components/player/android/components/VideoSurface.tsx +++ b/src/components/player/android/components/VideoSurface.tsx @@ -122,6 +122,13 @@ export const buildExoAudioTrackName = (t: any, i: number): string => { rawTitle = rawTitle.replace(/\|ch:\d+$/, '').trim(); } if (rawTitle) { + // Prepend language if available and not already in the title + if (t.language) { + const lang = EXOPLAYER_LANG_MAP[t.language.toLowerCase()] ?? t.language.toUpperCase(); + if (!rawTitle.toLowerCase().includes(lang.toLowerCase())) { + parts.push(lang); + } + } parts.push(rawTitle); } else if (t.language) { parts.push(EXOPLAYER_LANG_MAP[t.language.toLowerCase()] ?? t.language.toUpperCase()); @@ -147,6 +154,13 @@ export const buildExoSubtitleTrackName = (t: any, i: number): string => { const parts: string[] = []; const titleLower = (t.title ?? '').toLowerCase(); if (t.title && t.title.trim()) { + // Prepend language if available and not already in the title + if (t.language) { + const lang = EXOPLAYER_LANG_MAP[t.language.toLowerCase()] ?? t.language.toUpperCase(); + if (!t.title.toLowerCase().includes(lang.toLowerCase())) { + parts.push(lang); + } + } parts.push(t.title.trim()); } else if (t.language) { parts.push(EXOPLAYER_LANG_MAP[t.language.toLowerCase()] ?? t.language.toUpperCase());