Open In App

HTML | <track> srclang Attribute

The HTML <track> srclang Attribute is used to specify the language of the track text. The srclang attribute can be applied on the <track> element:

Note: srclang attribute is required with kind = “subtitles”.



Syntax:

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

Attribute Values



Example:




<html>
  
<head>
</head>
  
<body style="text-align: center">
    <h1 style="color: green"
    GeeksforGeeks 
</h1>
    <h2>HTML Track srclang Attribute</h2>
  
    <video width="600" 
           height="400" 
           controls>
  
        <track src="CSS-animation-duration02.mp4" 
               id="myTrack1" 
               kind="subtitles"
               srclang="en" 
               label="English">
  
            <source id="myTrack"
                    src="CSS-animation-duration02.mp4"
                    type="video/mp4">
    </video>
</body>
  
</html>

Output:

Supported Browsers: The browsers supported by <track> srclang Attribute are listed below:

Article Tags :