kind

The kind attribute in HTML defines the type of track for <track> elements, which provide text tracks for <audio> or <video> elements.

kind attribute

The kind attribute in HTML is used within the <track> element to define the type of text track being offered. It specifies whether the track is for subtitles, captions, descriptions, or other types of text, enabling media players to display the correct track for users.

Syntax

index.html
 <track src="URL" kind="subtitles | captions | descriptions | chapters | metadata">

Example

index.html
<video controls>
  <source src="video.mp4" type="video/mp4">
  <track kind="subtitles" src="movie_en.vtt" srclang="en" label="English subtitles">
  <track kind="captions" src="movie_es.vtt" srclang="es" label="Spanish captions">
</video>

Values

  • subtitles: Provide text for dialogue and key audio cues, typically aimed at viewers who can hear but may need translations.
  • captions: Display dialogue and sound descriptions for viewers who are deaf or hard of hearing.
  • descriptions: Offer textual descriptions of visual content for users who are visually impaired.
  • chapters: Divide the media into sections to make it easier to navigate.
  • metadata: Includes information about the media, such as its creation details and authorship.

Applies To

The kind attribute can be applied to the following HTML elements:

Conclusion

The kind attribute in HTML specifies the type of text track linked to media elements like <video> and <audio>. It ensures that users receive the correct information, such as subtitles, captions, or descriptions. By defining the track type, it guarantees the appropriate content is shown to the audience. Ultimately, this attribute improves accessibility and enhances the user experience in multimedia content.