WebvttCueParser


@UnstableApi
class WebvttCueParser


Parser for WebVTT cues. (https://w3c.github.io/webvtt/#cues)

Summary

Constants

const Pattern!

Public constructors

Public functions

java-static Cue!
@VisibleForTesting(otherwise = 3)
newCueForText(text: CharSequence!)

Create a new Cue containing text and with WebVTT default values.

java-static WebvttCueInfo?
parseCue(
    webvttData: ParsableByteArray!,
    styles: (Mutable)List<WebvttCssStyle!>!
)

Parses the next valid WebVTT cue in a parsable array, including timestamps, settings and text.

Constants

CUE_HEADER_PATTERN

const val CUE_HEADER_PATTERNPattern!

Public constructors

WebvttCueParser

WebvttCueParser()

Public functions

newCueForText

@VisibleForTesting(otherwise = 3)
java-static fun newCueForText(text: CharSequence!): Cue!

Create a new Cue containing text and with WebVTT default values.

parseCue

java-static fun parseCue(
    webvttData: ParsableByteArray!,
    styles: (Mutable)List<WebvttCssStyle!>!
): WebvttCueInfo?

Parses the next valid WebVTT cue in a parsable array, including timestamps, settings and text.

Parameters
webvttData: ParsableByteArray!

Parsable WebVTT file data.

styles: (Mutable)List<WebvttCssStyle!>!

List of styles defined by the CSS style blocks preceding the cues.

Returns
WebvttCueInfo?

The parsed cue info, or null if no valid cue was found.