/    Sign up×
Reference /Pin to ProfileBookmark

The track tag, or Embed Text Track element, designates text tracks for <audio> or <video> elements.

Syntax

The <track> tag provides subtitles, caption files, or others that will be visible while the associated media is playing.

<video width="600" height="400" controls>
  <source src="videoname.mp4" type="video/mp4">
  <source src="videoname.ogg" type="video/ogg">
  <track src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English">
</video>

Attributes

default
Designates that the track is to be enabled when the user’s browser preferences allow it.

kind
Provides the kind of track it is. Possible values: captions, chapters, descriptions, metadata, or subtitles.

label
Gives the title of the track.

src
Provides the URL of the track file.

srclang
If kind="subtitles" is used, this attribute is required, and it provides the text track data’s language.

Browser Compatibilty

Demos

Have a code example of <track>? Submit a codepen.io demo and we'll showcase it here

to submit a demo.
HTML
×

Success!

Help @reference spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...