-
Notifications
You must be signed in to change notification settings - Fork 134
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
Refacto RxJS-based ABRManager
into a SharedReference-based AdaptiveRepresentationSelector
#1091
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0e1baa7
to
c5bafa7
Compare
989ffe8
to
c8154ed
Compare
achrafl0
approved these changes
Jun 7, 2022
03972ab
to
afad9c3
Compare
peaBerberian
added a commit
that referenced
this pull request
Jun 8, 2022
Refacto RxJS-based `ABRManager` into a SharedReference-based `AdaptiveRepresentationSelector`
peaBerberian
added a commit
that referenced
this pull request
Jun 13, 2022
Refacto RxJS-based `ABRManager` into a SharedReference-based `AdaptiveRepresentationSelector`
peaBerberian
added a commit
that referenced
this pull request
Jun 14, 2022
Refacto RxJS-based `ABRManager` into a SharedReference-based `AdaptiveRepresentationSelector`
peaBerberian
added a commit
that referenced
this pull request
Jun 15, 2022
Refacto RxJS-based `ABRManager` into a SharedReference-based `AdaptiveRepresentationSelector`
peaBerberian
added a commit
that referenced
this pull request
Jun 21, 2022
Refacto RxJS-based `ABRManager` into a SharedReference-based `AdaptiveRepresentationSelector`
peaBerberian
added a commit
that referenced
this pull request
Jun 23, 2022
Refacto RxJS-based `ABRManager` into a SharedReference-based `AdaptiveRepresentationSelector`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ABR
Relative to adaptive streaming (Adaptive BitRate)
Priority: 3 (Low)
This issue or PR has a low priority.
Refacto
This Pull Request changes a lot of RxPlayer's code and/or logic
skip-performance-checks
Performance tests are not run on this PR
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After #962 and #1042, this is another huge pull request which tries to progressively reduce our dependency on the RxJS library to improve code "approachability". You can look at the two previous (since-merged) PR for reasons leading to this.
Here RxJS and associated concepts have been completely removed from the
src/core/abr
directory, which concerns our Adaptive BitRate-linked code.On that subject, in the same vein than the
eme
directory has been renameddecrypt
and theEMEManager
theContentDecryptor
- so its more explicit and clear to newcomers and external contributors - theabr
directory has been renamedadaptive
and theABRManager
, theAdaptiveRepresentationSelector
.The key points here are:
Because the adaptive code use many event listeners, a lot of code in
compat/event_listeners.ts
has been updated so it returnsIReadOnlySharedReference
s instead of RxJS Observables.Shared references can be seen as [very] simplified
BehaviorSubject
s when compared to RxJS. Their read-only flavor cannot update the value, they can only get the current value or "listen" (subscribe) to value changes (because the event listener should not have the need to emit them).Simple shared reference description for those not that familiar with BehaviorSubjects: SharedReferences are JS objects with a value inside them (any value: a number, boolean, object, another shared reference etc.), that can be updated and read at any time (by anyone in possession of this object), with also the possibility to register a callback so it is called each time its stored value is updated.
adaptive estimates are also returned as an
IReadOnlySharedReference
- so theAdaptationStream
can easily create aRepresentationStream
each time theRepresentation
estimate changes through a callback.A third argument has been added to our
EventEmitter
'saddEventListener
method: an optionalCancellationSignal
.This allows to easily remove the listener when the signal emits -
CancellationSignal
being the preferred solutions for now for cancellation handling in the player (previously happening implicitly through Observable unsubscription).Because we do not want to leak that supplementary argument to the API/TypeScript types, the public API (
core/api/public_api.ts
) redefines its ownaddEventListener
method on top so it can explicitly remove the third argument.