GoogleChrome / GoogleChrome/omnitone
Display audio download progress
- Dominant language
- JavaScript
- Stars
- 911
- Forks
- 118
- Avg merge
- 2m
- Merged PRs (30d)
- 3
Description
As higher order Ambisonics files are big in size, I want the user to see the download progress.
Maybe the function `BufferList.prototype._launchAsyncLoadTaskXHR` has to be extended for this.
I added the following lines right before `xhr.send();` (line 282 in omnitone.esm.js at the time of writing)
```
xhr.onprogress = function(event) {
if (event.lengthComputable) {
Utils.log(`Received ${event.loaded} of ${event.total} bytes`);
} else {
Utils.log(`Received ${event.loaded} bytes`); // no Content-Length
}
};
```
The result is a console display of the desired values.
Has anybody advice on how to read `event.loaded` and `event.total` outside of the Omnitone library?
Thank you in advance!
Contributor guide
Research direction
Start in omnitone.esm.js at BufferList.prototype._launchAsyncLoadTaskXHR and inspect how the XMLHttpRequest is created and used. Determine how progress values from xhr.onprogress could be made available outside the library rather than only logged; done means callers can access download progress while the audio is loading.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- audio-video-rtc
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100