rx-player
rx-player copied to clipboard
Remove RxJS from the SegmentBuffer and related code
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.