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

Added subtitle event handling for manual rendering the subtitles #4360

Merged

Conversation

bitboxer
Copy link
Contributor

This adds two new media player events: CUE_ENTER and CUE_EXIT. With these events you can render the subtitles without relying on the browser. This makes it possible to fully customize the UI for the subtitles. To enable the events, set the fireCueEvents setting to true.

For details check out the example in samples/captioning/events.html.

I am a bit unclear about the testing strategy of dash.js at the moment, because of that those are currently missing. Would love to add them after you explained where I should put them.

Closes #4317

This adds two new media player events: `CUE_ENTER` and `CUE_EXIT`.
With these events you can render the subtitles without relying on
the browser. This makes it possible to fully customize the UI for
the subtitles. To enable the events, set the `fireCueEvents` setting
to true.

For details check out the example in `samples/captioning/events.html`.
@dsilhavy
Copy link
Collaborator

@bitboxer Thank you for the PR. Following our contribution guidelines, and since this seems to be your first PR have you signed the feedback agreement yet? If not can you please send me a signed copy of the dash.js feedback agreement?

@dsilhavy dsilhavy added this to the 4.7.4 milestone Jan 16, 2024
@bitboxer
Copy link
Contributor Author

@dsilhavy I just send you an email with the signed agreement.

index.d.ts Outdated Show resolved Hide resolved
src/core/Settings.js Outdated Show resolved Hide resolved
src/core/Settings.js Outdated Show resolved Hide resolved
src/core/Settings.js Outdated Show resolved Hide resolved
src/streaming/text/TextTracks.js Outdated Show resolved Hide resolved
src/streaming/text/TextTracks.js Outdated Show resolved Hide resolved
@bitboxer
Copy link
Contributor Author

@dsilhavy I updated the PR with your suggestions. I opted for the _getCueInformation way of doing it. Looked way cleaner that way.

@bitboxer
Copy link
Contributor Author

bitboxer commented Feb 2, 2024

@dsilhavy did you have time to have a look into the latest changes? Is there anything left that I should/can do?

src/core/Settings.js Show resolved Hide resolved
src/streaming/text/TextController.js Outdated Show resolved Hide resolved
src/streaming/text/TextTracks.js Outdated Show resolved Hide resolved
src/streaming/text/TextTracks.js Outdated Show resolved Hide resolved
src/streaming/text/TextTracks.js Outdated Show resolved Hide resolved
@dsilhavy
Copy link
Collaborator

dsilhavy commented Feb 5, 2024

@bitboxer Thank you for the changes, I only had some "minor" code style comments. If you can address them it would be great. Otherwise let me know and I add them after your PR is merged

@bitboxer
Copy link
Contributor Author

bitboxer commented Feb 6, 2024

@dsilhavy I now added a commit that should fix all the things you mentioned. Let me know if there is anything else todo. Happy to help.

@dsilhavy dsilhavy merged commit db643ad into Dash-Industry-Forum:development Feb 6, 2024
3 checks passed
@bitboxer
Copy link
Contributor Author

bitboxer commented Feb 6, 2024

❤️ Thanks for merging this.

@dsilhavy
Copy link
Collaborator

dsilhavy commented Feb 6, 2024

❤️ Thanks for merging this.

Thank you for your work on this :)

eirikbjornr pushed a commit to bbc/dash.js that referenced this pull request Feb 14, 2024
…h-Industry-Forum#4360)

* Added subtitle event handling for manual rendering the subtitles

This adds two new media player events: `CUE_ENTER` and `CUE_EXIT`.
With these events you can render the subtitles without relying on
the browser. This makes it possible to fully customize the UI for
the subtitles. To enable the events, set the `fireCueEvents` setting
to true.

For details check out the example in `samples/captioning/events.html`.
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.

Events for Subtitles
2 participants