From af971b6a1930bfa59cde473f015826a69c2d44b8 Mon Sep 17 00:00:00 2001 From: Redirion Date: Wed, 12 Jun 2019 14:44:36 +0200 Subject: [PATCH] Fixed selected subtitle stream not being shown closes #2393 this ammends my obviously incomplete fix in PR #2311. This is just an UI issue. Subtitle track selection works, it just shows "No Captions" unfortunately. --- app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java index 4dbbc571d..d15dc8b28 100644 --- a/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java @@ -297,6 +297,7 @@ public abstract class VideoPlayer extends BasePlayer return true; }); + // Add all available captions for (int i = 0; i < availableLanguages.size(); i++) { final String captionLanguage = availableLanguages.get(i); MenuItem captionItem = captionPopupMenu.getMenu().add(captionPopupMenuGroupId, @@ -506,7 +507,7 @@ public abstract class VideoPlayer extends BasePlayer } // Normalize mismatching language strings - final String preferredLanguage = trackSelector.getParameters().preferredTextLanguage; + final String preferredLanguage = trackSelector.getPreferredTextLanguage(); // Build UI buildCaptionMenu(availableLanguages); if (trackSelector.getParameters().getRendererDisabled(textRenderer) ||