Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http.request report_progress updates one time per second. I need more updates per second #8966

Closed
d954mas opened this issue May 21, 2024 · 3 comments
Assignees
Labels
engine Issues related to the Defold engine feature request A suggestion for a new feature html5 Issue related to the HTML5 platform

Comments

@d954mas
Copy link
Sponsor Contributor

d954mas commented May 21, 2024

Is your feature request related to a problem? Please describe (REQUIRED):
I am loading liveupdate in http.request.I need to show progress bar for player.

Callback for progress called one time per second. You can see step on progress bar, this looks not good

2024-05-21.15-45-22.mp4

DEBUG:SCRIPT: [INFO 15:45:35] none: libs_project/liveupdate.lua:103: liveupdate loaded 0.1166659307531
DEBUG:SCRIPT: [INFO 15:45:36] none: libs_project/liveupdate.lua:103: liveupdate loaded 0.15555457433747
DEBUG:SCRIPT: [INFO 15:45:37] none: libs_project/liveupdate.lua:103: liveupdate loaded 0.19444321792183
DEBUG:SCRIPT: [INFO 15:45:38] none: libs_project/liveupdate.lua:103: liveupdate loaded 0.2333318615062

Describe the solution you'd like (REQUIRED):
1)Add parameter to request. If i need i will change delay

{ report_progress = true, report_progress_delay = 0.1 }

2)Or send progress every frame
Describe alternatives you've considered (REQUIRED):
Now i use lerp for progress, so it looks less steps

Additional context (OPTIONAL):
Add any other context or screenshots about the feature request here.

@d954mas d954mas added the feature request A suggestion for a new feature label May 21, 2024
@d954mas d954mas changed the title http.request report_progress updates one timer per second. I need more updates per second http.request report_progress updates one time per second. I need more updates per second May 21, 2024
@britzl britzl self-assigned this May 27, 2024
@britzl britzl added engine Issues related to the Defold engine html5 Issue related to the HTML5 platform labels May 27, 2024
@britzl
Copy link
Contributor

britzl commented May 27, 2024

We are not throttling progress updates. We send it make to the caller as soon as we receive progress updates:

https://github.com/defold/defold/blob/dev/engine/script/lib/js/library_script.js#L29-L33

This SO comment seem to indicate that it may happen every 50ms, but I don't see anything about it in the spec. I guess it happens when the browser thinks it is appropriate. If you can find an actual way to configure it please let us know!

@britzl britzl closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2024
@d954mas
Copy link
Sponsor Contributor Author

d954mas commented May 27, 2024

Interesting.
I test on pc, i get update often.

But in browser i get update one time per second:(

I look and code, i see that you post message every onprogress, not sure what is happening(

@britzl
Copy link
Contributor

britzl commented May 27, 2024

not sure what is happening(

I blame the browser! Have you tried in different browsers to see if there is a difference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine Issues related to the Defold engine feature request A suggestion for a new feature html5 Issue related to the HTML5 platform
Projects
None yet
Development

No branches or pull requests

2 participants