Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | <track> tag

  • Last Updated : 17 Sep, 2019

The <track> tag specifies text tracks for media components audio and video
This part is employed to specify subtitles, caption files or different files containing text, that ought to be visible once the media is taking part in.

Syntax:

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

<track Attribute>

Attribute:

  • default: Specifies to that track to enabled if the user want to change the track
  • kind: Specifies the kind of text track
  • label: the title of the text track
  • src: It is for URL of the track file
  • srclang: It tell the language of the track text data (required if kind=”subtitles”)

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 HTML <track> tag are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!