From 9d2c325cdf431664d33bca31626f73d5c6f7a608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Thu, 9 Feb 2023 00:39:48 +0100 Subject: [PATCH] fix: Caption can not turn off at iOS Safari (#4978) Fixes https://github.com/shaka-project/shaka-player/issues/4940 This occurs when the operating system defaults to enabled subtitles in src= mode. The solution is to detect that there are active subtitles and set the internal visible flag to true. --- lib/player.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/player.js b/lib/player.js index 0d9654eccf..e26d67994d 100644 --- a/lib/player.js +++ b/lib/player.js @@ -2585,6 +2585,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget { // goes wrong. new shaka.util.Timer(resolve).tickAfter(1); }); + } else if (textTracks.length > 0) { + this.isTextVisible_ = true; } // If we have moved on to another piece of content while waiting for