This commit is contained in:
Josh de Leeuw 2017-03-20 22:22:50 -04:00
parent b5bdcfa345
commit b0ecd233d9

View File

@ -112,10 +112,13 @@ jsPsych.plugins["single-audio"] = (function() {
jsPsych.pluginAPI.clearAllTimeouts();
// stop the audio file if it is playing
// remove end event listeners if they exist
if(context !== null){
source.stop();
source.onended = function() { }
} else {
audio.pause();
audio.removeEventListener('end', end_trial);
}
// kill keyboard listeners