Fragment loading/loaded events should accurately reflect "bitrateTest" property
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 2.8k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 27
Description
Is your feature request related to a problem? Please describe.
The Fragment object contains a property called bitrateTest that is used to track if a fragment is for a bitrate test. However, this property attempts to do 2 different things:
- track if a fragment is used for a bitrate test
- track the state of the request
I believe this property would be more useful if it just did number 1. It would also allow us to document this property, which may be useful for listeners of the FRAG_LOADING/LOADED event. Today, if a listener of the FRAG_LOADED event tries to query if the fragment loaded was for a bitrate test, they will not be able to, as the property will be false after the request is completed.
Lastly, there is already a member variable in base-stream-controller that tracks the state of the bitrate test. It is not clear why we use that variable in some places in stream-controller and frag.bitrateTest in other places.
Describe the solution you'd like
The solution would be to not set frag.bitrateTest = false after the request is completed. Instead, we can use member variables in any controller that needs to know the state of the request, and continue to use frag.bitrateTest in places where we need to know if the fragment is for a test or not.
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the bitrate-test state handling in base-stream-controller and stream-controller, then trace the FRAG_LOADING and FRAG_LOADED event paths. Check where frag.bitrateTest is changed during the request. Done means the property continues to identify bitrate-test fragments after loading, while controller state tracks whether the request is in progress.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- audio-video-rtc
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100