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.
This commit is contained in:
138138138 2022-06-23 01:01:11 +08:00 committed by GitHub
parent 7db6e43e3f
commit ac685f65e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -673,7 +673,12 @@ if (player.share) player.share(shareOptions);
// show the preferred caption by default // show the preferred caption by default
if (player_data.preferred_caption_found) { if (player_data.preferred_caption_found) {
player.ready(function () { player.ready(function () {
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'; player.textTracks()[0].mode = 'showing';
}
}); });
} }