From 537a8e8ab585c003366d77c08380739243d39a42 Mon Sep 17 00:00:00 2001 From: zrose584 <57181548+zrose584@users.noreply.github.com> Date: Sat, 12 Sep 2020 10:23:31 +0200 Subject: transcript-table.js: sync active transcript with select_tt --- youtube/static/js/transcript-table.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'youtube/static') diff --git a/youtube/static/js/transcript-table.js b/youtube/static/js/transcript-table.js index 6b57911..ac81444 100644 --- a/youtube/static/js/transcript-table.js +++ b/youtube/static/js/transcript-table.js @@ -56,8 +56,12 @@ function renderCues() { function loadCues() { let tts = Q("video").textTracks; let tt = tts[select_tt.selectedIndex]; - for (let ttI of tts) if (ttI !== tt) ttI.mode = "disabled"; - if (tt.mode == "disabled") tt.mode = "hidden"; + let dst_mode = "hidden"; + for (let ttI of tts) { + if (ttI.mode === "showing") dst_mode = "showing"; + if (ttI !== tt) ttI.mode = "disabled"; + } + if (tt.mode == "disabled") tt.mode = dst_mode; var iC = setInterval(() => { if (tt.cues && tt.cues.length) { -- cgit v1.2.3