dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


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

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


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">

<head>

<meta charset="utf-8">

<title><track> tag</title>

<body>

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

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

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

</video>

</body>

</html>
Octavia Anghel
 
Comment and Contribute

 

 

 

 

 


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

 

 

Sitemap
×
By using this site, you agree to the Privacy Policy
Thanks for your registration, follow us on our social networks to keep up-to-date