Export (0) Print
Expand All

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

 

Syntax

JavaScript
object.srclang = sLangvalue
sLangvalue = object.srclang

 

Property values

Type: DOMString

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

Standards information

Remarks

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.

Examples

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


    <video id="video1" controls autoplay loop>
      <source src="http://ie.microsoft.com/testdrive/ieblog/2011/nov/pp4_blog_demo.mp4" 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
    </video>


See also

Track element
Track object

 

 

Show:
© 2014 Microsoft