From 0edff14b2c82bd63980d09eaba394faca205d0a6 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Wed, 27 Oct 2021 13:53:07 -0300 Subject: [PATCH] Check if the cue has changed before updating the HTML. --- 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 de0daec7..97e29fd5 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); + } } } }