English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

HTML: <track> srclang attribute

Usage of the <track> srclang attribute, online example demonstrating how to use the <track> srclang attribute, browser compatibility, syntax definition, and detailed information about its attribute values.

 HTML <track> tag

Online Example

A video element with two subtitle tracks:

<video width="320" height="240" controls>
  <source src="forrest_test.mp4" type="video/mp4">
  <source src="forrest_test.ogg" type="video/ogg">
  <track src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English" default>
  <track src="subtitles_no.vtt" kind="subtitles" srclang="no" label="Norwegian">
</video>

Browser Compatibility

IEFirefoxOperaChromeSafari

Internet Explorer 10, Opera, and Chromium supports the srclang attribute.

Definition and Usage

The srclang attribute defines the language of the track.

If the value of the kind attribute is "subtitles", the srclang attribute is required.

Tip: To view all available language codes, please visit our Language Code Reference Manual.

HTML 4.01 from HTML5differences

The <track> tag is part of HTML5 New tag.

Syntax

    <track src="subtitles_en.vtt" kind="subtitles" srclang="en">

Attribute value

ValueDescription
language_codeDouble-letter language code, specifying the language of the track.


 HTML <track> tag