Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update functions.js subtitles by button turned out dead end #2402

Merged
merged 2 commits into from
Jun 22, 2024
Merged

Update functions.js subtitles by button turned out dead end #2402

merged 2 commits into from
Jun 22, 2024

Conversation

raszpl
Copy link
Contributor

@raszpl raszpl commented Jun 20, 2024

#2400 button was still fragile and breaking :(. The only bulletproof ways of learning if subtitles are available are

player.getOption('captions', 'tracklist', {includeAsr: true})
player.getSubtitlesUserSettings() 

also player.isSubtitlesOn() does work even if video has no subtitles, and player.toggleSubtitlesOn() is ignored in same case making both safe to call without checking.

@raszpl raszpl marked this pull request as ready for review June 20, 2024 23:42
@ImprovedTube ImprovedTube merged commit 81f6888 into code-charity:master Jun 22, 2024
1 check passed
@ImprovedTube
Copy link
Member

so it sounds like the method might not even be of use as a backup?

@raszpl raszpl deleted the patch-8 branch June 22, 2024 13:33
@raszpl
Copy link
Contributor Author

raszpl commented Jun 22, 2024

player.getSubtitlesUserSettings() is in my tests 100% reliable. player with no subtitles available doesnt posses any 'Subtitles User Settings' and returns null

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

Successfully merging this pull request may close these issues.

2 participants