Browse Source

Merge pull request #842 from asulibraries/audio_notracks_hotfix_1871

check audio textTracks before trying to use them for #1871
pull/843/head
Alan Stanley 3 years ago committed by GitHub
parent
commit
d291c628bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      modules/islandora_audio/js/audio.js

10
modules/islandora_audio/js/audio.js

@ -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 || {};

Loading…
Cancel
Save