FAQ
If the question is related to FairPlay, have you read the tutorial?
Not applicable
What version of Shaka Player are you using?
5.1.0
What browser and OS are you using?
Chrome, MacOS
Please ask your question
When I start a stream that has Swedish audio, I don't want to enable Swedish captions by default. In version 4.x the preferredTextLanguage property let me pick a text language that would only be applied if it didn't match the audio language:
| Name |
Description |
preferredTextLanguage |
... If a matching text track is found, and the selected audio and text tracks have different languages, the text track will be shown. ... |
v4.15.10 PlayerConfiguration docs
I want to achieve the same thing with the new preferredAudio and preferredText config, but the player always enables the text track even if it doesn't match my .TextPreference.
Stream
Audio tracks
[
{ label: "Swedish", language: "sv", primary: true, roles: ["main"], ... },
{ label: "Swedish (AD)", language: "sv", primary: true, roles: ["commentary"], ... }
]
Text tracks
[
{ label: "Swedish (CC)", language: "sv", primary: false, roles: ["caption"], ... }
]
Configuration
{
preferredAudio: [
{ language: 'sv', channelCount: 6 },
{ language: 'sv', channelCount: 2 },
{ language: 'en', channelCount: 6 },
{ language: 'en', channelCount: 2 },
],
preferredText: [
{ language: 'sv', role: 'main' }
],
}
I would expect this configuration to not enable any subtitles since there is no match ("main" != "caption"), but as long as the language matches it seems to get picked. With preferredText: [], no subtitles are enabled by default as expected.
I can see this in the logs No exact match for the text role could be found., shouldn't an empty list be returned there if there are no role matches?
Is this achievable without manually calling this.player.selectTextTrack(null) when the player is ready?
FAQ
If the question is related to FairPlay, have you read the tutorial?
Not applicable
What version of Shaka Player are you using?
5.1.0
What browser and OS are you using?
Chrome, MacOS
Please ask your question
When I start a stream that has Swedish audio, I don't want to enable Swedish captions by default. In version 4.x the
preferredTextLanguageproperty let me pick a text language that would only be applied if it didn't match the audio language:I want to achieve the same thing with the new
preferredAudioandpreferredTextconfig, but the player always enables the text track even if it doesn't match my.TextPreference.Stream
Audio tracks
Text tracks
Configuration
I would expect this configuration to not enable any subtitles since there is no match (
"main" != "caption"), but as long as the language matches it seems to get picked. WithpreferredText: [], no subtitles are enabled by default as expected.I can see this in the logs
No exact match for the text role could be found., shouldn't an empty list be returned there if there are no role matches?Is this achievable without manually calling
this.player.selectTextTrack(null)when the player is ready?