From adbfea79a4029273a35706c3fbaf43652ee0ae8a Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Thu, 28 Oct 2021 13:10:28 -0300 Subject: [PATCH] Check if the cue has changed before updating the HTML. (#853) --- modules/islandora_audio/js/audio.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/islandora_audio/js/audio.js b/modules/islandora_audio/js/audio.js index de0daec73..97e29fd5b 100644 --- a/modules/islandora_audio/js/audio.js +++ b/modules/islandora_audio/js/audio.js @@ -23,8 +23,10 @@ initialized = true; if ($('audio')[0].textTracks.length > 0) { $('audio')[0].textTracks[0].oncuechange = function() { + if (this.activeCues.length > 0) { var currentCue = this.activeCues[0].text; $('#audioTrack').html(currentCue); + } } } }