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

Closed Caption Button and Dynamic Language Change for Captions #1175

Open
HamzaIsrar12 opened this issue Oct 20, 2024 · 1 comment
Open

Closed Caption Button and Dynamic Language Change for Captions #1175

HamzaIsrar12 opened this issue Oct 20, 2024 · 1 comment
Labels

Comments

@HamzaIsrar12
Copy link

HamzaIsrar12 commented Oct 20, 2024

Hi Pier,

I would like to add a closed caption button to the YouTube player to enable/disable captions dynamically. Additionally, I want to allow users to select the available languages for captions.

I already have access to the available languages through an internal API, but I'm facing an issue with changing the caption language or enabling/disabling captions after the player is initialized.

Issue/Blocker:

  • It seems that changing the caption language or toggling captions is only possible through the IFramePlayerOptions, which can only be set during the player's initialization.
  • The library does not support reinitializing the player after it’s been created.
  • Destroying and recreating the player to apply new IFramePlayerOptions results in a glitchy experience.

Question: Is there a way to dynamically update the caption settings (enable/disable and change languages) without destroying and recreating the player? Or, is there a recommended solution to handle this more smoothly?

Any insights or workarounds would be greatly appreciated! Thank you.

@HamzaIsrar12 HamzaIsrar12 changed the title Feature Request: Closed Caption Button and Dynamic Language Change for Captions Closed Caption Button and Dynamic Language Change for Captions Oct 20, 2024
@PierfrancescoSoffritti
Copy link
Owner

I suggest to

  1. finding a way to do this with the IFrame Player.
  2. try to replicate that in the library.

If 1 is possible but 2 is not, we can work on a solution to enable it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants