srclang property

Gets or sets the language of the text track data. This attribute is required if "subtitles" is specified in the kind attribute.

This property is read/write.

HTML5 A vocabulary and associated APIs for HTML and XHTMLInternet Explorer 10



object.srclang = sLangvalue
sLangvalue = object.srclang


Property values

Type: DOMString

A string containing a valid BCP 47 abbreviated language language code.

Standards information


The following example shows the kind attribute defined for a track element.

Note  To create timed text files in both Web Video Text Track (WebVTT) and Timed Text Markup Language (TTML) formats, see HTML5 Video Caption Maker on the Windows Internet Explorer test drive site.


This example shows the kind, label, and srclang attributes defined on a track element.

    <video id="video1" controls autoplay loop>
      <source src="" type="video/mp4" >
      <track id="enTrack" src="entrack.vtt" label="English" kind="subtitles" srclang="en" default> 
      <track id="esTrack" src="estrack.vtt" label="Spanish" kind="subtitles" srclang="es">
      <track id="deTrack" src="detrack.vtt" label="German" kind="subtitles" srclang="de">
      HTML5 video not supported

See also

Track element
Track object



© 2015 Microsoft