Skip to content

Conversation

@peaBerberian
Copy link
Collaborator

Note: this was part of the #1413 PR, which was a collection of unrelated improvements. I Chose to open individual pull requests instead so it's easier to review and discuss.


Some private methods of the MediaSourceContentInitializer were difficult to follow due to the heavy usage of inner functions with unclear names (such as recursivelyLoadOnMediaSource).

I now tried to isolate some of those and rename the different methods called at content load so it makes more sense. Methods in order are:

start > _setupInitialMediaSourceAndDecryption >
_onInitialMediaSourceReady > _setupContentWithNewMediaSource >
_startLoadingContentOnMediaSource

Note: _setupContentWithNewMediaSource and
_startLoadingContentOnMediaSource are still similarly named, though the former just has the task of setting up a reloading logic and then calling the latter.

Note2: _startLoadingContentOnMediaSource is still a huge and complex method that we might improve on in the future.

Some private methods of the `MediaSourceContentInitializer` were
difficult to follow due to the heavy usage of inner functions with
unclear names (such as `recursivelyLoadOnMediaSource`).

I now tried to isolate some of those and rename the different methods
called at content load so it makes more sense. Methods in order are:

```
start > _setupInitialMediaSourceAndDecryption >
_onInitialMediaSourceReady > _setupContentWithNewMediaSource >
_startLoadingContentOnMediaSource
```

Note: `_setupContentWithNewMediaSource` and
`_startLoadingContentOnMediaSource` are still similarly named, though
the former just has the task of setting up a reloading logic and then
calling the latter.

Note2: `_startLoadingContentOnMediaSource` is still a huge and complex
method that we might improve on in the future.
@peaBerberian peaBerberian merged commit f99b774 into dev Oct 22, 2024
8 checks passed
@peaBerberian peaBerberian added this to the 4.3.0 milestone Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants