PierfrancescoSoffritti / android-youtube-player

YouTube Player library for Android and Chromecast, stable and customizable.
https://pierfrancescosoffritti.github.io/android-youtube-player/
MIT License
3.44k stars 765 forks source link

Closed Caption Button and Dynamic Language Change for Captions #1175

Open HamzaIsrar12 opened 3 weeks ago

HamzaIsrar12 commented 3 weeks ago

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:

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.

PierfrancescoSoffritti commented 3 weeks ago

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.