diff options
Diffstat (limited to 'youtube/static/js/common.js')
-rw-r--r-- | youtube/static/js/common.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/youtube/static/js/common.js b/youtube/static/js/common.js index f2e62fe..4c7ee51 100644 --- a/youtube/static/js/common.js +++ b/youtube/static/js/common.js @@ -20,4 +20,13 @@ function getActiveTranscriptTrackIdx() { } return cur_tt_idx; } -function getActiveTranscriptTrack() { return Q("video").textTracks[getActiveTranscriptTrackIdx()]; }
\ No newline at end of file +function getActiveTranscriptTrack() { return Q("video").textTracks[getActiveTranscriptTrackIdx()]; } + +function getDefaultTranscriptTrackIdx() { + let tts = Q("video").textTracks; + return tts.length - 1; +} + +window.addEventListener('DOMContentLoaded', function() { + cur_tt_idx = getDefaultTranscriptTrackIdx(); +}); |