-
Notifications
You must be signed in to change notification settings - Fork 425
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
Add an option to calculate bandwidth by using Chromium's networkInfo API #1218
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1218 +/- ##
==========================================
+ Coverage 86.42% 86.43% +0.01%
==========================================
Files 39 39
Lines 9743 9752 +9
Branches 2263 2267 +4
==========================================
+ Hits 8420 8429 +9
Misses 1323 1323
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @evanfarina ! A few comments for consideration.
…fo tests into their own module
…ystemBandwidth getter
Co-authored-by: Garrett Singer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's nice that it's pretty simple and self-contained!
…es if both estimates are >= 10 Mbps
Description
We've found that the player's bandwidth estimations provide lower-than-expected values when a particular segment is encoded with a low bitrate relative to other segments in its lane. This is a fairly common phenomenon when a live stream is using a variable bitrate encoding strategy and is broadcasting a static scene (e.g a slide in a slideshow). We believe that this issue is further exacerbated by two factors:
BANDWIDTH_VARIANCE
value as a multiplier for the advertised bandwidth value in each lane. The filter calculation looks likelane bandwidth * bandwidth variance < calculatedBandwidth
. WhencalculatedBandwidth
is low due to aforementioned reasons, the bandwidth variance default makes it more likely that higher-quality lanes will be filtered out by the playerSpecific Changes proposed
Introduce an experimental option that allows the player to leverage Chromium's NetworkInfo.downlink API to estimate bandwidth. Note: This API is not available in Firefox or Safari. When enabled, the player will take the max value between its own bandwidth estimation and that provided by NetworkInformation.downlink.
Please see attached screenshots which demonstrate how the player now selects the higher-quality rendition during static scenes. This demo uses 2-second segments.
## Requirements Checklist - [x] Feature implemented / Bug fixed - [ ] If necessary, more likely in a feature request than a bug fix - [ ] Unit Tests updated or fixed - [ ] Docs/guides updated - [ ] Example created ([starter template on JSBin](https://jsbin.com/gejugat/edit?html,output)) - [ ] Reviewed by Two Core Contributors