Arteqo Consulting

The European Web Agency

Design, brand and digital development


×

Arteqo Consulting Services

Contact Arteqo

×
I have read and accept the terms and conditions

track tag

The track tag, which, when implemented in the code, is written like this - <track>, is an HTML tag that belongs to audio/video tags. Audio and Video HTML tags are used to insert audio and video content. The multimedia content is played thorugh the default player of a user's browser.

<track> specifies text tracks for media elements (<audio> and <video>). This element is used to specify subtitles, caption files or other files containing text, that should be visible when the media is playing. This tag is supported in the current version of HTML, which is HTML5.

Browser support

Here you can see whether <track> is supported by a certain browser, and, if yes, starting from which version it is supported.

Browser support for <track>
ChromeFirefoxEdgeOperaSafari
Supported since Chrome v18Supported since Firefox v31Supported since Edge v10Supported since Opera v15Supported since Safari v6

Attributes and values

An attribute is a piece of additional information about a tag. While tags denote the type of objects they mark or create, attributes set the parameters of these objects. These parameters can include anything from the types of possible interactions to its visual style to its actual contents.

Values indicate how a certain attribute is actually implemented, if there is a number of ways it can happen.

What attributes are actually allowed in a certain tag depends on the tag itself. Much like possible attributes depend on a tag, possible values depend on an attribute.

The <track> tag supports the following attributes (with their respective values):

AttributeValueDescription
defaultdefaultSpecifies that the track is to be enabled if the user’s preferences do not indicate that another track would be more appropriate
kind
  • captions
  • chapters
  • descriptions
  • metadata
  • subtitles
Specifies the kind of text track
labeltextSpecifies the title of the text track
srcURLRequired. Specifies the URL of the track file
srclanglanguage_codeSpecifies the language of the track text data (required if kind="subtitles")

Global Attributes

Global attributes are HTML tag attributes that can be used by any tag, hence the name "global". They are in contrast to unique attributes that are tag-specific.

<track> supports global attributes.

Event Attributes

Event attributes are HTML tag attributes that allow triggering actions upon specific conditions, hence the name "event". Other types of attributes, namely global and unique attributes, can also trigger actions, but the difference is that even attributes allow calling scripts, such as JavaScript functions, while most other attributes only support a certain type of action.

<track> supports event attributes.