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/removeCue below:

removeCue · WebPlatform Docs

removeCue Summary

Removes the given cue from textTrack’s text track list of cues.

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

Syntax
var  = TextTrack.removeCue(cue);
Parameters cue
Data-type
String

“cue” is of type TextTrackCue.

Return Value

Returns an object of type

Examples
<!DOCTYPE html >
<html >
  <head>
    <title>Remove Cue example</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body>

<video id="video1" controls muted autoplay>
    <source src="video.mp4">
    HTML5 Video not supported
</video>

 <script type="text/javascript">
    var video = document.getElementById("video1");
    var beginTime, endTime, message;
    var newTextTrack = video.addTextTrack("captions", "sample");
    newTextTrack.mode = newTextTrack.SHOWING; 
    
    for(var i=0;i<10;i++){
        beginTime =  i * 5 ;
        endTime = ( (i * 5) +  5);
        message =  "This is number " + i;
        newTextTrack.addCue(new TextTrackCue(beginTime, endTime, message));
    }
    
    newTextTrack.addEventListener("cuechange", function () {
            
            var currentCue = newTextTrack.activeCues[0];
            if (currentCue.text == "This is number 2") {
                newTextTrack.removeCue(currentCue)
            }
        },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