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

feat: Render native cues using text displayer #6985

Merged
merged 17 commits into from
Jul 15, 2024

Conversation

tykus160
Copy link
Contributor

@tykus160 tykus160 commented Jul 4, 2024

Closes #2585

Ownership of text displayer has changed to player, it is created now in MSE mode and in src= mode if video element has textTracks property.

@avelad avelad added type: enhancement New feature or request priority: P3 Useful but not urgent labels Jul 4, 2024
@avelad avelad added this to the v4.11 milestone Jul 4, 2024
@shaka-bot
Copy link
Collaborator

shaka-bot commented Jul 4, 2024

Incremental code coverage: 52.48%

avelad pushed a commit that referenced this pull request Jul 5, 2024
lib/text/text_utils.js Outdated Show resolved Hide resolved
Copy link
Contributor

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes here seem reasonable. The only thing I think we should have is an option to use native text track rendering. This is because on safari, if you use native pip, it will continue displaying captions if they are natively rendered. But not if they are rendered manually.
Even better if the option can be toggled at runtime so that native rendering could be toggled as part of a pip requested event handler.

lib/text/ui_text_displayer.js Outdated Show resolved Hide resolved
@avelad
Copy link
Collaborator

avelad commented Jul 8, 2024

The changes here seem reasonable. The only thing I think we should have is an option to use native text track rendering. This is because on safari, if you use native pip, it will continue displaying captions if they are natively rendered. But not if they are rendered manually. Even better if the option can be toggled at runtime so that native rendering could be toggled as part of a pip requested event handler.

I prefer that we detect if we are in PiP and switch to native mode. But this only applies if we use the PiP of the video, not the document. See: https://github.com/shaka-project/shaka-player/blob/main/ui/pip_button.js

@gkatsev
Copy link
Contributor

gkatsev commented Jul 8, 2024

I prefer that we detect if we are in PiP and switch to native mode.

👍🏻, doing it automatically, sounds good to me.

But this only applies if we use the PiP of the video, not the document

💯. Though, only safari does it properly and shows captions in the video pip. Firefox will as well, but they don't implement the pip api, so, not possible to know when entering pip, i believe.

@avelad
Copy link
Collaborator

avelad commented Jul 8, 2024

But this only applies if we use the PiP of the video, not the document

💯. Though, only safari does it properly and shows captions in the video pip. Firefox will as well, but they don't implement the pip api, so, not possible to know when entering pip, i believe.

And do you know if Firefox shows subtitles in its PiP?

@gkatsev
Copy link
Contributor

gkatsev commented Jul 8, 2024

yeah, firefox shows captions in its pip. They were the first to implement that.

@avelad
Copy link
Collaborator

avelad commented Jul 8, 2024

yeah, firefox shows captions in its pip. They were the first to implement that.

Well, since Firefox does not follow the PiP standard, in this case Firefox would be left without subtitles.

lib/text/text_utils.js Outdated Show resolved Hide resolved
lib/player.js Outdated Show resolved Hide resolved
avelad pushed a commit that referenced this pull request Jul 15, 2024
@avelad avelad merged commit 6c0c63d into shaka-project:main Jul 15, 2024
9 of 16 checks passed
avelad pushed a commit that referenced this pull request Jul 15, 2024
@tykus160 tykus160 deleted the wt-render-vtt-cues branch July 19, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: P3 Useful but not urgent type: enhancement New feature or request
4 participants