Skip to content

Commit

Permalink
Merge pull request #842 from asulibraries/audio_notracks_hotfix_1871
Browse files Browse the repository at this point in the history
check audio textTracks before trying to use them for #1871
  • Loading branch information
ajstanley authored Jul 16, 2021
2 parents 75215ca + 52033e8 commit d291c62
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/islandora_audio/js/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
function init(context,settings){
if (!initialized){
initialized = true;
$('audio')[0].textTracks[0].oncuechange = function() {
var currentCue = this.activeCues[0].text;
$('#audioTrack').html(currentCue);
}
if ($('audio')[0].textTracks.length > 0) {
$('audio')[0].textTracks[0].oncuechange = function() {
var currentCue = this.activeCues[0].text;
$('#audioTrack').html(currentCue);
}
}
}
}
Drupal.Audio = Drupal.Audio || {};
Expand Down

0 comments on commit d291c62

Please sign in to comment.