Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions src/template/ACRHR_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@
var generalErrorLog= "";

// if performing of this assignment is already counted
var hitCounterIncreased = false;
var hitCounterIncreased = false;
var total_videos_count = 0;

//--------------- Utilities -----------------

Expand Down Expand Up @@ -856,16 +857,22 @@
return;
}
if (!startScreenRefreshRateMeasures){
if (videos_not_loaded_yet_set.size == 0){

getScreenRefreshRate(function(fps){check_screen_refresh_rate(fps);});
startScreenRefreshRateMeasures = true;
if (videos_not_loaded_yet_set.size == 0){
$("#loading_percent").html("100%");

getScreenRefreshRate(function(fps){check_screen_refresh_rate(fps);});
startScreenRefreshRateMeasures = true;

}else{

$("#remaining_videos").html(videos_not_loaded_yet_set.size);
window.setTimeout(hardware_test, 200);
return;
$("#remaining_videos").html(videos_not_loaded_yet_set.size);
if(total_videos_count > 0){
let loaded = total_videos_count - videos_not_loaded_yet_set.size;
let percent = Math.round(100 * loaded / total_videos_count);
$("#loading_percent").html(percent + "%");
}
window.setTimeout(hardware_test, 200);
return;
}
}
if(refresh_rate_passed === null) {
Expand Down Expand Up @@ -2030,8 +2037,9 @@
recordError("on loading video clips",e.target.src, true);
//$("#error_loading_files").show();
});
velements_added = true;
});
total_videos_count = videos_not_loaded_yet_set.size;
velements_added = true;
});

function addListenersToVideoElement(videoElement, is_dcr){
//videoElement.addEventListener("canplay",canPlay.bind(videoElement),false);
Expand Down Expand Up @@ -2103,9 +2111,10 @@
<div class="col-md-2" sytle="float: right"><div class="loader" width="30%"></div></div>
<div class="col-md-3" sytle="text-align: left;"> <h1>Loading</h1>
<p>Loading the videos and checking your hardware. </p>
<p><span id ="remaining_videos">0</span> remains.</p>
<p><small>It might take up to a minute. In case it takes longer, refresh the page.</small></p></div>
<div class="col-md-3"></div>
<p><span id ="remaining_videos">0</span> remains.</p>
<p>Progress: <span id="loading_percent">0%</span></p>
<p><small>It might take up to a minute. In case it takes longer, refresh the page.</small></p></div>
<div class="col-md-3"></div>
</div>

<!-- Instructions -->
Expand Down
39 changes: 24 additions & 15 deletions src/template/ACR_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -942,16 +942,22 @@
return;
}
if (!startScreenRefreshRateMeasures){
if (videos_not_loaded_yet_set.size == 0){
record_video_loading_time();
getScreenRefreshRate(function(fps){check_screen_refresh_rate(fps);});
startScreenRefreshRateMeasures = true;
if (videos_not_loaded_yet_set.size == 0){
$("#loading_percent").html("100%");
record_video_loading_time();
getScreenRefreshRate(function(fps){check_screen_refresh_rate(fps);});
startScreenRefreshRateMeasures = true;

}else{

$("#remaining_videos").html(videos_not_loaded_yet_set.size);
window.setTimeout(hardware_test, 200);
return;
$("#remaining_videos").html(videos_not_loaded_yet_set.size);
if(total_videos_count > 0){
let loaded = total_videos_count - videos_not_loaded_yet_set.size;
let percent = Math.round(100 * loaded / total_videos_count);
$("#loading_percent").html(percent + "%");
}
window.setTimeout(hardware_test, 200);
return;
}
}
if(refresh_rate_passed === null) {
Expand Down Expand Up @@ -981,8 +987,9 @@
}
}
//just tmp for test
var video_size_MB = 0;
var page_loading_timer =null;
var video_size_MB = 0;
var page_loading_timer =null;
var total_videos_count = 0;

/**
Called when downloading of all videos took too long, show a message and block the hit.
Expand Down Expand Up @@ -2321,8 +2328,9 @@
recordError("on loading video clips",e.target.src, true);
//$("#error_loading_files").show();
});
velements_added = true;
});
total_videos_count = videos_not_loaded_yet_set.size;
velements_added = true;
});

const download_start = new Map();
const download_duration = new Map();
Expand Down Expand Up @@ -2453,10 +2461,11 @@
<div class="col-md-3" sytle="text-align: left;"> <h1>Loading</h1>
<p style="color:red">Do NOT open multiple pages of this task.</p>
<p>Loading the videos and checking your hardware. </p>
<p><span id ="remaining_videos">0</span> remains.</p>
<p><small>It might take up to a minute. In case it takes longer, refresh the page.</small></p></div>
<div class="col-md-3"></div>
</div>
<p><span id ="remaining_videos">0</span> remains.</p>
<p>Progress: <span id="loading_percent">0%</span></p>
<p><small>It might take up to a minute. In case it takes longer, refresh the page.</small></p></div>
<div class="col-md-3"></div>
</div>

<!-- Instructions -->
<section class="container disabled_section" id="Survey">
Expand Down
39 changes: 24 additions & 15 deletions src/template/DCR_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -1026,16 +1026,22 @@
return;
}
if (!startScreenRefreshRateMeasures){
if (videos_not_loaded_yet_set.size == 0){
record_video_loading_time();
getScreenRefreshRate(function(fps){check_screen_refresh_rate(fps);});
startScreenRefreshRateMeasures = true;
if (videos_not_loaded_yet_set.size == 0){
$("#loading_percent").html("100%");
record_video_loading_time();
getScreenRefreshRate(function(fps){check_screen_refresh_rate(fps);});
startScreenRefreshRateMeasures = true;

}else{

$("#remaining_videos").html(videos_not_loaded_yet_set.size);
window.setTimeout(hardware_test, 200);
return;
$("#remaining_videos").html(videos_not_loaded_yet_set.size);
if(total_videos_count > 0){
let loaded = total_videos_count - videos_not_loaded_yet_set.size;
let percent = Math.round(100 * loaded / total_videos_count);
$("#loading_percent").html(percent + "%");
}
window.setTimeout(hardware_test, 200);
return;
}
}
if(refresh_rate_passed === null) {
Expand Down Expand Up @@ -1066,8 +1072,9 @@
}

//just tmp for test
var video_size_MB = 0;
var page_loading_timer =null;
var video_size_MB = 0;
var page_loading_timer =null;
var total_videos_count = 0;
/**
Called when downloading of all videos took too long, show a message and block the hit.
**/
Expand Down Expand Up @@ -2559,8 +2566,9 @@
recordError("on loading video clips",e.target.src);
//$("#error_loading_files").show();
});
velements_added = true;
});
total_videos_count = videos_not_loaded_yet_set.size;
velements_added = true;
});

const download_start = new Map();
const download_duration = new Map();
Expand Down Expand Up @@ -2700,10 +2708,11 @@
<div class="col-md-3" sytle="text-align: left;"> <h1>Loading</h1>
<p style="color:red">Do NOT open multiple pages of this task.</p>
<p>Loading the videos and checking your hardware. </p>
<p><span id ="remaining_videos">0</span> remains.</p>
<p><small>It might take up to a minute. In case it takes longer, refresh the page.</small></p></div>
<div class="col-md-3"></div>
</div>
<p><span id ="remaining_videos">0</span> remains.</p>
<p>Progress: <span id="loading_percent">0%</span></p>
<p><small>It might take up to a minute. In case it takes longer, refresh the page.</small></p></div>
<div class="col-md-3"></div>
</div>

<!-- Instructions -->
<section class="container disabled_section" id="Survey">
Expand Down
27 changes: 18 additions & 9 deletions src/template/avatar_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -1139,16 +1139,22 @@
return;
}
if (!startScreenRefreshRateMeasures){
if (videos_not_loaded_yet_set.size == 0){
record_video_loading_time();
getScreenRefreshRate(function(fps){check_screen_refresh_rate(fps);});
if (videos_not_loaded_yet_set.size == 0){
$("#loading_percent").html("100%");
record_video_loading_time();
getScreenRefreshRate(function(fps){check_screen_refresh_rate(fps);});
startScreenRefreshRateMeasures = true;

}else{

$("#remaining_videos").html(videos_not_loaded_yet_set.size);
window.setTimeout(hardware_test, 200);
return;
$("#remaining_videos").html(videos_not_loaded_yet_set.size);
if(total_videos_count > 0){
let loaded = total_videos_count - videos_not_loaded_yet_set.size;
let percent = Math.round(100 * loaded / total_videos_count);
$("#loading_percent").html(percent + "%");
}
window.setTimeout(hardware_test, 200);
return;
}
}
if(refresh_rate_passed === null) {
Expand Down Expand Up @@ -1180,6 +1186,7 @@
//just tmp for test
var video_size_MB = 0;
var page_loading_timer =null;
var total_videos_count = 0;

/**
Called when downloading of all videos took too long, show a message and block the hit.
Expand Down Expand Up @@ -2881,6 +2888,7 @@
recordError("on loading video clips",e.target.src, true);
//$("#error_loading_files").show();
});
total_videos_count = videos_not_loaded_yet_set.size;
velements_added = true;
});

Expand Down Expand Up @@ -3015,9 +3023,10 @@
<div class="col-md-3" sytle="text-align: left;"> <h1>Loading</h1>
<p style="color:red">Do NOT open multiple pages of this task.</p>
<p>Loading the videos and checking your hardware. </p>
<p><span id ="remaining_videos">0</span> remains.</p>
<p><small>It might take up to a minute. In case it takes longer, refresh the page.</small></p></div>
<div class="col-md-3"></div>
<p><span id ="remaining_videos">0</span> remains.</p>
<p>Progress: <span id="loading_percent">0%</span></p>
<p><small>It might take up to a minute. In case it takes longer, refresh the page.</small></p></div>
<div class="col-md-3"></div>
</div>

<!-- Instructions -->
Expand Down