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] 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'; + } }); }