Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit e3cf65b

Browse files
committed
provide alternate locations for audio and image files in audiotours
1 parent 2e8bcc0 commit e3cf65b

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

runestone/activecode/js/activecode.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,11 @@ function AudioTour (divid, code, bnum, audio_text) {
730730
var bcount = 0;
731731
var html_string = "<div class='modal-lightsout'></div><div class='modal-profile'><h3>Take an audio tour!</h3><div class='modal-close-profile'></div><p id='windowcode'></p><p id='" + divid + "_audiocode'></p>";
732732
html_string += "<p id='status'></p>";
733-
html_string += "<input type='image' src='../_static/first.png' width='25' id='first_audio' name='first_audio' title='Play first audio in tour' alt='Play first audio in tour' disabled/>" + "<input type='image' src='../_static/prev.png' width='25' id='prev_audio' name='prev_audio' title='Play previous audio in tour' alt='Play previous audio in tour' disabled/>" + "<input type='image' src='../_static/pause.png' width='25' id='pause_audio' name='pause_audio' title='Pause current audio' alt='Pause current audio' disabled/><input type='image' src='../_static/next.png' width ='25' id='next_audio' name='next_audio' title='Play next audio in tour' alt='Play next audio in tour' disabled/><input type='image' src='../_static/last.png' width ='25' id='last_audio' name='last_audio' title='Play last audio in tour' alt='Play last audio in tour' disabled/><br/>";
733+
html_string += "<input type='image' src='../_static/first.png' width='25' id='first_audio' name='first_audio' title='Play first audio in tour' alt='Play first audio in tour' onerror=\"this.onerror=null;this.src='_static/first.png'\" disabled/>" +
734+
"<input type='image' src='../_static/prev.png' width='25' id='prev_audio' name='prev_audio' title='Play previous audio in tour' alt='Play previous audio in tour' onerror=\"this.onerror=null;this.src='_static/prev.png'\" disabled/>" +
735+
"<input type='image' src='../_static/pause.png' width='25' id='pause_audio' name='pause_audio' title='Pause current audio' alt='Pause current audio' onerror=\"this.onerror=null;this.src='_static/pause.png'\" disabled/>" + "" +
736+
"<input type='image' src='../_static/next.png' width ='25' id='next_audio' name='next_audio' title='Play next audio in tour' alt='Play next audio in tour' onerror=\"this.onerror=null;this.src='_static/next.png'\" disabled/>" +
737+
"<input type='image' src='../_static/last.png' width ='25' id='last_audio' name='last_audio' title='Play last audio in tour' alt='Play last audio in tour' onerror=\"this.onerror=null;this.src='_static/last.png'\" disabled/><br/>";
734738
for (var i = 0; i < audio_type.length - 1; i++) {
735739
html_string += "<input type='button' style='margin-right:5px;' class='btn btn-default btn-sm' id='button_audio_" + i + "' name='button_audio_" + i + "' value=" + bval[i] + " />";
736740
bcount++;
@@ -869,9 +873,12 @@ AudioTour.prototype.tour = function (divid, audio_type, bcount) {
869873
// str+="<audio id="+akey+" preload='auto'><source src='http://ice-web.cc.gatech.edu/ce21/audio/"+
870874
// akey+".mp3' type='audio/mpeg'><source src='http://ice-web.cc.gatech.edu/ce21/audio/"+akey+
871875
// ".ogg' type='audio/ogg'>Your browser does not support the audio tag</audio>";
872-
str += "<audio id=" + akey + " preload='auto' ><source src='../_static/audio/" + akey +
873-
".wav' type='audio/wav'><source src='../_static/audio/" +
874-
akey + ".mp3' type='audio/mpeg'><br />Your browser does not support the audio tag</audio>";
876+
str += "<audio id=" + akey + " preload='auto' >";
877+
str += "<source src='../_static/audio/" + akey + ".wav' type='audio/wav'>";
878+
str += "<source src='../_static/audio/" + akey + ".mp3' type='audio/mpeg'>";
879+
str += "<source src='_static/audio/" + akey + ".wav' type='audio/wav'>";
880+
str += "<source src='_static/audio/" + akey + ".mp3' type='audio/mpeg'>";
881+
str += "<br />Your browser does not support the audio tag</audio>";
875882
this.ahash[akey] = lnums;
876883
this.aname.push(akey);
877884
}

0 commit comments

Comments
 (0)