revert fix for html5 audio progress bar - now in audio-bug branch

This commit is contained in:
Becky Gilbert 2020-10-12 17:55:48 -07:00
parent a63a749e3f
commit d6f3d79d04

View File

@ -2328,14 +2328,13 @@ jsPsych.pluginAPI = (function() {
function load_audio_file_html5audio(source, count){ function load_audio_file_html5audio(source, count){
count = count || 1; count = count || 1;
var audio = new Audio(); var audio = new Audio();
audio.addEventListener('canplaythrough', function handleCanPlayThrough(){ audio.addEventListener('canplaythrough', function(){
audio_buffers[source] = audio; audio_buffers[source] = audio;
n_loaded++; n_loaded++;
loadfn(n_loaded); loadfn(n_loaded);
if(n_loaded == files.length){ if(n_loaded == files.length){
finishfn(); finishfn();
} }
this.removeEventListener('canplaythrough', handleCanPlayThrough);
}); });
audio.addEventListener('onerror', function(){ audio.addEventListener('onerror', function(){
if(count < jsPsych.initSettings().max_preload_attempts){ if(count < jsPsych.initSettings().max_preload_attempts){