Rename and factorize some methods of the MediaSourceContentInitializer #1570
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.
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 asrecursivelyLoadOnMediaSource
).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:
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.