preferredSubtitleLanguage
Sets the preferred language for subtitles.
This function allows you to specify a language code (e.g., "en" for English, "es" for Spanish) that the player should prioritize when selecting a subtitle track if multiple subtitle tracks are available. When specifying a language, this should be a valid IETF BCP 47 language code. Note that language code tag can also be specified as an ISO 639-2/3 (three-letter codes). BCP 47 is the IETF's Best Current Practices for language tags, defined in RFC 5646, and it incorporates ISO 639 codes as primary language subtags. The authoritative source for valid BCP 47 subtags, including those derived from ISO 639, is the IANA Language Subtag Registry. This registry ensures a single, unambiguous subtag for each language, resolving potential conflicts or ambiguities that might arise from different ISO 639 parts.
If a subtitle track in the preferred language is available, it will be automatically selected. If not, the player might fall back to a default subtitle track or no subtitles, depending on its implementation.
Note: The availability and effectiveness of this setting depends on the available subtitle tracks in the media content.
Parameters
A String representing the IETF BCP 47 language code (e.g., "en", "fr-CA", "es-419") for the preferred subtitle language. Passing an empty string or null might reset to the default behavior or have no effect, depending on the player's implementation.