diff --git a/src/template/ACRHR_template.html b/src/template/ACRHR_template.html index 5112eee..d4c8574 100644 --- a/src/template/ACRHR_template.html +++ b/src/template/ACRHR_template.html @@ -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 ----------------- @@ -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) { @@ -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); @@ -2103,9 +2111,10 @@

Loading

Loading the videos and checking your hardware.

-

0 remains.

-

It might take up to a minute. In case it takes longer, refresh the page.

-
+

0 remains.

+

Progress: 0%

+

It might take up to a minute. In case it takes longer, refresh the page.

+
diff --git a/src/template/ACR_template.html b/src/template/ACR_template.html index 10a4aea..81d3b57 100644 --- a/src/template/ACR_template.html +++ b/src/template/ACR_template.html @@ -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) { @@ -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. @@ -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(); @@ -2453,10 +2461,11 @@

Loading

Do NOT open multiple pages of this task.

Loading the videos and checking your hardware.

-

0 remains.

-

It might take up to a minute. In case it takes longer, refresh the page.

-
- +

0 remains.

+

Progress: 0%

+

It might take up to a minute. In case it takes longer, refresh the page.

+
+
diff --git a/src/template/DCR_template.html b/src/template/DCR_template.html index 0fe8bf6..c6cf780 100644 --- a/src/template/DCR_template.html +++ b/src/template/DCR_template.html @@ -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) { @@ -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. **/ @@ -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(); @@ -2700,10 +2708,11 @@

Loading

Do NOT open multiple pages of this task.

Loading the videos and checking your hardware.

-

0 remains.

-

It might take up to a minute. In case it takes longer, refresh the page.

-
- +

0 remains.

+

Progress: 0%

+

It might take up to a minute. In case it takes longer, refresh the page.

+
+
diff --git a/src/template/avatar_template.html b/src/template/avatar_template.html index 73cf157..be3f7cf 100644 --- a/src/template/avatar_template.html +++ b/src/template/avatar_template.html @@ -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) { @@ -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. @@ -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; }); @@ -3015,9 +3023,10 @@

Loading

Do NOT open multiple pages of this task.

Loading the videos and checking your hardware.

-

0 remains.

-

It might take up to a minute. In case it takes longer, refresh the page.

-
+

0 remains.

+

Progress: 0%

+

It might take up to a minute. In case it takes longer, refresh the page.

+