Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Semantic Web
Expertise: Beginner
Feb 28, 2018



How to Help Your Business Become an AI Early Adopter

Using the Track HTML5 Tag to Specify Text Tracks

The <track> tag specifies text tracks for media elements (<audio> and <video>). You can use the <track> attribute to add subtitles to any video or audio element. Web Video Text Tracks Format (WebVTT) is a format for displaying timed text tracks (such as subtitles or captions) using the <track> element. Values that can be applied to the attribute include subtitles, descriptions, or captions.

Other attributes that can be included in the track tag:

  • kind: represents the kind of text track: caption, chapter, subtitle, description
  • label: represents the title of the text track
  • src: is a obligatory attribute and has the role of specifying the URL of the track file
  • srclang: this attribute identifies the language of the subtitles contained in that file
<!DOCTYPE html>

<html lang="en">


<meta charset="utf-8">

<title><track> tag</title>


<video width="480" height="320" controls>

<source src="video.mp4" type="video.mp4">

<track kind="subtitles" src="Romanian.vtt" scrlang="ro" label="Romanian">



Octavia Anghel
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date