Remove RxJS from the SegmentBuffer and related code #1127
Merged
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.
This is yet another PR to remove RxJS from parts of the code to raise the RxPlayer's "approachability", after #962 (for the transports code), #1042 (the content decryption code) and #1091 (from the adaptive code).
This time, this is the turn of a relatively smaller part of the code: the "SegmentBuffers (in
src/core/segment_buffers
) which is the code wrapping browser's buffers (or even implementing them in the case of subtitles and image buffers).Like the other PR before it, this one makes heavy usage of:
ISharedReference
objects, which are very similar to RXJS BehaviorSubjects (always-set Observable values which are not lazy and can beget
ted at any time) to easily share values between blocks while allowing to trigger a callback when its inner state changes.TaskCanceller
andCancellationSignal
, which are very similar to respectively theAbortController
andAbortSignal
APIs and which allows to easily and explicitly (generally unlike RxJS Observables where it often happens as a side-effect of unsubscription) abort cancellable asynchronous operations.