mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 16:48:12 +00:00
Merge branch 'master' of https://github.com/jspsych/jsPsych
This commit is contained in:
commit
66b1af85b6
15
jspsych.js
15
jspsych.js
@ -2405,16 +2405,6 @@ jsPsych.pluginAPI = (function() {
|
|||||||
}
|
}
|
||||||
audio.removeEventListener('error', handleError);
|
audio.removeEventListener('error', handleError);
|
||||||
});
|
});
|
||||||
audio.addEventListener('stalled', function handleStalled(){
|
|
||||||
if(count < jsPsych.initSettings().max_preload_attempts){
|
|
||||||
setTimeout(function(){
|
|
||||||
load_audio_file_html5audio(source, count+1)
|
|
||||||
}, 200);
|
|
||||||
} else {
|
|
||||||
jsPsych.loadFail();
|
|
||||||
}
|
|
||||||
audio.removeEventListener('stalled', handleStalled);
|
|
||||||
});
|
|
||||||
audio.addEventListener('abort', function handleAbort(){
|
audio.addEventListener('abort', function handleAbort(){
|
||||||
if(count < jsPsych.initSettings().max_preload_attempts){
|
if(count < jsPsych.initSettings().max_preload_attempts){
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
@ -2618,7 +2608,10 @@ jsPsych.pluginAPI = (function() {
|
|||||||
loaded++;
|
loaded++;
|
||||||
if(progress_bar){
|
if(progress_bar){
|
||||||
var percent_loaded = (loaded/total_n)*100;
|
var percent_loaded = (loaded/total_n)*100;
|
||||||
jsPsych.getDisplayElement().querySelector('#jspsych-loading-progress-bar').style.width = percent_loaded+"%";
|
var preload_progress_bar = jsPsych.getDisplayElement().querySelector('#jspsych-loading-progress-bar');
|
||||||
|
if (preload_progress_bar !== null) {
|
||||||
|
preload_progress_bar.style.width = percent_loaded+"%";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user