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

Bring multiple feature switching improvements #1287

Merged
merged 2 commits into from
Sep 26, 2023
Merged

Conversation

peaBerberian
Copy link
Collaborator

The RxPlayer has an API to allow an application to only import features it needs, e.g. only importing text track parsers for needed subtitles formats, only DRM handling if it plays encrypted content, and so on.

While working on the WebWorker branch (#1272), I noticed several feature switching improvements could be performed without breaking the current API:

  • I added an implicit MEDIA_SOURCE (and un-importable) feature which is automatically added when either transport protocol feature is added (DASH, SMOOTH, LOCAL or METAPLAYLIST).

    Here it allows to drastically reduce the bundle size if only "directfile" mode is needed - as it does not share the same core logic. When / if the worker work is merged, it will also greatly reduce the size if only on-worker playback is needed.

  • The addFeatures static method is now also added for the default RxPlayer import (import RxPlayer from "rx-player") as well as for the builds published in the dist directory and in on our release notes.

    Before you needed to explicitly import the minimal RxPlayer through the "rx-player/minimal" path, but there was no reason left for that.

    Now the only current difference between the default and minimal import will be that the default has all non-experimental features already imported, which seems logical.

    So now, it will be possible to add experimental features also to the default RxPlayer build. Consequently, the corresponding features' documentation has been updated to remove the notion that you need the minimal build to import them. The code examples still relies on the minimal build as we expect that's what most applications would want to do.

  • Because now feature switching can happen on any build, it's documentation has moved from tutorials to its own page in the API documentation.

  • NATIVE_TEXT_BUFFER and HTML_TEXT_BUFFER are now optional features which are automatically and implicitly imported if respectively any native text parser or any html text parser is imported.

    I also chose to un-document both feature to simplify the features' documentation. Though it may be a bad idea for applications looking what an already-added feature does. So I may re-add it to the doc and announce it as deprecated instead.

  • The features's code unit tests has been simplified. There's no need to mock and to as any here as it was before.

@peaBerberian peaBerberian merged commit a89178c into next Sep 26, 2023
1 of 3 checks passed
peaBerberian added a commit that referenced this pull request Sep 27, 2023
Bring multiple feature switching improvements
peaBerberian added a commit that referenced this pull request Sep 27, 2023
In #1287, I deprecated the `NATIVE_TEXT_BUFFER` and `HTML_TEXT_BUFFER`
as they already are automatically included when importing one of the
corresponding text track parsers (so there's no point to have a separate
import here, it can just be lazily added on any of those parser's
injection to the RxPlayer).

Yet I forgot that the exact same situation was there for the
`IMAGE_BUFFER` (and even completely forgot to re-document image-related
features). This is now done.
peaBerberian added a commit that referenced this pull request Sep 27, 2023
In #1287, I deprecated the `NATIVE_TEXT_BUFFER` and `HTML_TEXT_BUFFER`
as they already are automatically included when importing one of the
corresponding text track parsers (so there's no point to have a separate
import here, it can just be lazily added on any of those parser's
injection to the RxPlayer).

Yet I forgot that the exact same situation was there for the
`IMAGE_BUFFER` (and even completely forgot to re-document image-related
features). This is now done.
This was referenced Sep 27, 2023
peaBerberian added a commit that referenced this pull request Oct 12, 2023
In #1287, I deprecated the `NATIVE_TEXT_BUFFER` and `HTML_TEXT_BUFFER`
as they already are automatically included when importing one of the
corresponding text track parsers (so there's no point to have a separate
import here, it can just be lazily added on any of those parser's
injection to the RxPlayer).

Yet I forgot that the exact same situation was there for the
`IMAGE_BUFFER` (and even completely forgot to re-document image-related
features). This is now done.
peaBerberian added a commit that referenced this pull request Oct 13, 2023
Bring multiple feature switching improvements
peaBerberian added a commit that referenced this pull request Oct 13, 2023
In #1287, I deprecated the `NATIVE_TEXT_BUFFER` and `HTML_TEXT_BUFFER`
as they already are automatically included when importing one of the
corresponding text track parsers (so there's no point to have a separate
import here, it can just be lazily added on any of those parser's
injection to the RxPlayer).

Yet I forgot that the exact same situation was there for the
`IMAGE_BUFFER` (and even completely forgot to re-document image-related
features). This is now done.
peaBerberian added a commit that referenced this pull request Oct 13, 2023
Bring multiple feature switching improvements
peaBerberian added a commit that referenced this pull request Oct 13, 2023
In #1287, I deprecated the `NATIVE_TEXT_BUFFER` and `HTML_TEXT_BUFFER`
as they already are automatically included when importing one of the
corresponding text track parsers (so there's no point to have a separate
import here, it can just be lazily added on any of those parser's
injection to the RxPlayer).

Yet I forgot that the exact same situation was there for the
`IMAGE_BUFFER` (and even completely forgot to re-document image-related
features). This is now done.
peaBerberian added a commit that referenced this pull request Oct 13, 2023
Bring multiple feature switching improvements
peaBerberian added a commit that referenced this pull request Oct 13, 2023
In #1287, I deprecated the `NATIVE_TEXT_BUFFER` and `HTML_TEXT_BUFFER`
as they already are automatically included when importing one of the
corresponding text track parsers (so there's no point to have a separate
import here, it can just be lazily added on any of those parser's
injection to the RxPlayer).

Yet I forgot that the exact same situation was there for the
`IMAGE_BUFFER` (and even completely forgot to re-document image-related
features). This is now done.
@peaBerberian peaBerberian deleted the feat/demo-improvs branch February 7, 2024 16:31
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.

None yet

1 participant