This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

inBandMetadataTrackDispatchType

Summary

Returns the text track in-band metadata track dispatch type string. This is a string extracted from the media resource specifically for in-band metadata tracks, to enable such tracks to be dispatched to different scripts in the document.

Property of apis/audio-video/TextTrackapis/audio-video/TextTrack

Syntax

Note: This property is read-only.

var result = TextTrack.inBandMetadataTrackDispatchType;

Return Value

Returns an object of type StringString

Examples

<!DOCTYPE HTML>
<html>
<head>
    <title>Get track example</title>
</head>
<body>
    <h1>Get track example</h1>
    <video id="video1" controls>
        <source src="http://ie.microsoft.com/testdrive/Videos/BehindIE9ModernWebStandards/Video.mp4">
        <track id="entrack" label="English subtitles" kind="captions" src="entrack.vtt" srclang="en" default>
    </video>
    <p>
        <button id="mybutton">Show dispatch type</button>
    </p>
    <div style="display:block; overflow:auto; height:200px; width:650px;" id="display"></div>

    <script>
      document.getElementById("mybutton").addEventListener("click", function () {
        var myTrack = document.getElementById("entrack").track; // get text track from track element
        var myType = myTrack.inBandMetadataTrackDispatchType;   // get dispatch type
        document.getElementById("display").innerHTML = myType;
     }, false);
    </script>
</body>
</html>

Related specifications

W3C HTML5 Specification
W3C Editor’s Draft

Attributions