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.

pauseOnExit

Summary

Returns the pause-on-exit flag on a TextTrackCue. When the flag is true, playback will pause when it reaches the cue’s endTime.

Property of apis/audio-video/TextTrackCueapis/audio-video/TextTrackCue

Syntax

Note: This property is read-only.

var result = TextTrackCue.pauseOnExit;

Return Value

Returns an object of type BooleanBoolean

Examples

This example displays the cue (caption), startTime, endTime, pauseOnExit, and id for all cues in a track.

  <head>
    <script type="text/javascript">
      function getCues() {
        var myTrack = document.getElementById("entrack").track; // get text track from track element
        var myCues = myTrack.cues;   // get list of cues
        var statusFlags = "<table><tr><th>startTime</th><th>endTime</th>";
        statusFlags += "<th>pauseOnExit</th><th>id</th>";
        statusFlags += "<th>cue text</th></tr>";

        for (var i = 0; i < myCues.length; i++) {
          statusFlags += "<tr><td>" + myCues[i].startTime + "</td><td>" + myCues[i].endTime + "</td>";
          statusFlags += "</td><td>" + +myCues[i].pauseOnExit + "</td><td>\"" + myCues[i].id + "\"</td>";
          statusFlags += "</td><td>" + myCues[i].getCueAsHTML().textContent + "</td></tr>";
          }
          statusFlags += "</table>";
          document.getElementById("display").innerHTML = statusFlags;  //append track label
        }
    </script>
  </head>
  <body>
    <video id="video1" controls  >
      <source src="video.mp4">
      <track id="entrack" label="English subtitles" kind="captions" src="entrack.vtt" srclang="en" default>
    </video>
    <p><button onclick="getCues();">Show tracks</button></p>
    <div style="display:block; overflow:auto; height:200px; width:auto"  id="display"></div>
</body>

Related specifications

W3C HTML5 Specification
W3C Editor’s Draft

Attributions