Browse Source

check that there are audio textTracks before trying to use them for #1871

pull/842/head
Willow Gillingham 3 years ago
parent
commit
52033e8788
  1. 2
      modules/islandora_audio/js/audio.js

2
modules/islandora_audio/js/audio.js

@ -21,12 +21,14 @@
function init(context,settings){ function init(context,settings){
if (!initialized){ if (!initialized){
initialized = true; initialized = true;
if ($('audio')[0].textTracks.length > 0) {
$('audio')[0].textTracks[0].oncuechange = function() { $('audio')[0].textTracks[0].oncuechange = function() {
var currentCue = this.activeCues[0].text; var currentCue = this.activeCues[0].text;
$('#audioTrack').html(currentCue); $('#audioTrack').html(currentCue);
} }
} }
} }
}
Drupal.Audio = Drupal.Audio || {}; Drupal.Audio = Drupal.Audio || {};
/** /**

Loading…
Cancel
Save