Open In App

HTML | kind Attribute

The HTML <track> kind Attribute is used to specify the kind of the track for video and audio files. This is very useful if the listener or viewer is deaf.

Syntax:  



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

Attribute Value: It is either true or false which shows the default state of the track. By default, it is false.  

Example 1: This example illustrates the <track> kind attribute with video element.  






<!DOCTYPE html>
<html>
     
<head>
    <title>
        HTML track kind Attribute
    </title>
     
    <style>
        body {
            text-align: center;
        }
        h1 {
            color: green;
        }
    </style>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
     
    <h2>HTML track kind Attribute</h2>
  
    <video width="420" height="240" controls>
        <source src="video1" type="video/mp4">
        <track src="subtitles_en.vtt" kind="subtitles"
                      srclang="en" label="English">
    </video>
</body>
 
</html>          

Output: 
 

Example 2:This example illustrates the use of <track> kind attribute with audio element. 




<!DOCTYPE html>
<html>
     
<head>
    <title>
        HTML track kind Attribute
    </title>
     
    <style>
        body {
            text-align: center;
        }
        h1 {
            color: green;
        }
    </style>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
     
    <h2>HTML track kind Attribute</h2>
  
    <audio  controls>
        <source src="audiofile_name" type="audio/mp3">
         
        <track src="subtitles_en.vtt" kind="subtitles"
                      srclang="en" label="English">
    </audio>
</body>
 
</html>          

Output: 
 

Supported Browsers: The browser supported by HTML <track> kind Attribute are listed below: 

 


Article Tags :