Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <track> src Attribute

The src attribute on a <track> tag specifies the URL or path of an text track file.

The browser uses the URL to locate and load the text track file.

Example

#

A src attribute on a <track> element.
The attribute references a file with a text track for Spanish subtitles.

<video controls="controls" width="320" height="176">
  <source src="/media/godfather.mp4" type="video/mp4" />
  <source src="/media/godfather.ogg" type="video/ogg" />
  <track src="/media/godfather.srt" kind="subtitles" srclang="es" label="Spanish" />
</video>

Using src

The src attribute specifies the URL or path of the track file.

The browser uses the URL to locate and load the text track file.

Track files must be in a Web Video Text Tracks (.vtt, WebVTT) file format.

The URL of the track file can be external (from another website) or internal (same website).


Syntax

<track src="URL">

Values

#

Value Description
URL URL or path of the track file.

Browser support

Here is when src support started for each browser:

Chrome
23.0 Nov 2012
Firefox
31.0 Jul 2014
IE/Edge
10.0 Sep 2012
Opera
12.1 Nov 2012
Safari
6.0 Jul 2012

You may also like

 Back to <track>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides