Search completed in 1.47 seconds.
2 results for "addtexttrack":
HTMLMediaElement - Web APIs
Web › API › HTMLMediaElement
been implemented for Firefox OS, and was removed in Firefox 55. HTMLMediaElement.onmozinterruptend Sets the EventHandler called when the interruption is concluded. This was Firefox-specific, having been implemented for Firefox OS, and was removed in Firefox 55. Methods This interface also inherits methods from its ancestors HTMLElement, Element, Node, and EventTarget. HTMLMediaElement.addTextTrack() Adds a text track (such as a track for subtitles) to a media element. HTMLMediaElement.captureStream() Returns MediaStream, captures a stream of the media content. HTMLMediaElement.canPlayType() Given a string specifying a MIME media type (potentially with the codecs parameter included), canPlayType() returns the string probably if the media should be playable, maybe if there's not enoug...
VTTCue - Web APIs
Web › API › VTTCue
s a DOMString with the contents of the cue. Methods getCueAsHTML() Returns the cue text as a DocumentFragment. Example HTML <video controls src="https://udn.realityripple.com/samples/c6/f8a3489533.webm"></video> CSS video { width: 320px; height: 180px; } JavaScript let video = document.querySelector('video'); video.addEventListener('loadedmetadata', () => { const track = video.addTextTrack("captions", "????Subtitles", "zh_CN"); track.mode = "showing"; const cueCn = new VTTCue(0, 2.500, '????0?2.5????'); track.addCue(cueCn); const cueEn = new VTTCue(2.6, 4, 'Subtitles will display between 2.6 and 4 seconds'); track.addCue(cueEn); }); Result Chrome: Please Open in JSFiddle to view the live sample. Embed live sample can not show subtitles in Chrome. Specifications ...