From 7db6e43e3f68f32dd375dda244285fd7f82b3d29 Mon Sep 17 00:00:00 2001 From: 138138138 <78271024+138138138@users.noreply.github.com> Date: Wed, 22 Jun 2022 19:10:46 +0800 Subject: [PATCH 1/2] Fix captions Captions should automatically show according to preferences. --- assets/js/player.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/player.js b/assets/js/player.js index 7d099e66..8486d875 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -673,7 +673,7 @@ if (player.share) player.share(shareOptions); // show the preferred caption by default if (player_data.preferred_caption_found) { player.ready(function () { - player.textTracks()[1].mode = 'showing'; + player.textTracks()[0].mode = 'showing'; }); } From ac685f65e9011b226f580917efc8392b16e5a8f4 Mon Sep 17 00:00:00 2001 From: 138138138 <78271024+138138138@users.noreply.github.com> Date: Thu, 23 Jun 2022 01:01:11 +0800 Subject: [PATCH 2/2] Fix captions textTracks 0 in DASH mode shows debug messages. Use textTracks 1 in DASH mode, and textTracks 0 in non-DASH mode and audio mode. --- assets/js/player.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/assets/js/player.js b/assets/js/player.js index 8486d875..aef50926 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -673,7 +673,12 @@ if (player.share) player.share(shareOptions); // show the preferred caption by default if (player_data.preferred_caption_found) { player.ready(function () { - player.textTracks()[0].mode = 'showing'; + if (!video_data.params.listen && video_data.params.quality === 'dash') { + // play.textTracks()[0] on DASH mode is showing some debug messages + player.textTracks()[1].mode = 'showing'; + } else { + player.textTracks()[0].mode = 'showing'; + } }); }