aboutsummaryrefslogtreecommitdiffstats
path: root/youtube
diff options
context:
space:
mode:
authorzrose584 <57181548+zrose584@users.noreply.github.com>2020-09-12 10:23:31 +0200
committerzrose584 <57181548+zrose584@users.noreply.github.com>2020-09-12 10:23:31 +0200
commit537a8e8ab585c003366d77c08380739243d39a42 (patch)
treecf755885763494a08cee55e4b5a88afe160a7ca5 /youtube
parent081058c07e10a4123efcce813918873887eb78c5 (diff)
downloadyt-local-537a8e8ab585c003366d77c08380739243d39a42.tar.lz
yt-local-537a8e8ab585c003366d77c08380739243d39a42.tar.xz
yt-local-537a8e8ab585c003366d77c08380739243d39a42.zip
transcript-table.js: sync active transcript with select_tt
Diffstat (limited to 'youtube')
-rw-r--r--youtube/static/js/transcript-table.js8
1 files changed, 6 insertions, 2 deletions
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) {