Skip to content
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

Rename and factorize some methods of the MediaSourceContentInitializer #1570

Merged
merged 2 commits into from
Oct 22, 2024

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.

2 participants