A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/apis/audio-video/TextTrack/cues below:

cues · WebPlatform Docs

cues Summary

Returns the text track list of cues, as a TextTrackCueList object.

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

Syntax

Note: This property is read-only.

var result = TextTrack.cues;
Return Value

Returns an object of type DOM NodeDOM Node

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 tracks</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; 
        var myCues = myTrack.cues;   
        for (var i = 0; i < myCues.length; i++) {
        
        document.getElementById("display").innerHTML += (myCues[i].getCueAsHTML().textContent + "<br/>");
        }
     }, false);
    </script>
</body>
</html>
Related specifications
W3C HTML5 Specification
W3C Editor’s Draft
Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4