YouTip LogoYouTip

Att Track Srclang

## HTML `` srclang Attribute The `srclang` attribute of the `` element specifies the language of the track text data. This attribute is essential for accessibility, allowing browsers and media players to identify and present text tracks (such as subtitles or captions) in the user's preferred language. --- ## Definition and Usage The `srclang` attribute defines the language of the track's text content using a standard language code. ### Key Rules: * **Required for Subtitles:** If the `kind` attribute of the `` element is set to `"subtitles"`, the `srclang` attribute is **mandatory**. * **Value Format:** The value must be a valid BCP 47 language tag (such as `"en"` for English, `"es"` for Spanish, or `"zh"` for Chinese). --- ## Syntax ```html ``` ### Attribute Values | Value | Description | | :--- | :--- | | *language_code* | A valid language tag (usually a two-letter ISO 639-1 code) that specifies the language of the track (e.g., `en`, `no`, `fr`, `zh`). | --- ## Code Examples ### Example: A Video Player with Multi-Language Subtitles The following example demonstrates a `
← Att Ul CompactAtt Track Src β†’