SubtitleFileParser

fun interface SubtitleFileParser

Parses one subtitle file's whole text into timed cues. See MediaBackend.subtitleFileParser.

Functions

Link copied to clipboard
open fun decode(bytes: ByteArray, encoding: String): String?

Reads a subtitle file's bytes as encoding, or answers null when this parser has no table for it.

Link copied to clipboard
abstract fun parse(text: String, vttHint: Boolean): List<SubtitleCue>

vttHint is true when the file names or opens itself as WebVTT; SubRip otherwise.

Link copied to clipboard
open suspend fun parseOther(bytes: ByteArray, text: String, uri: String): SubtitleFileReading?

Reads a file whose text parse found no cues in (#492): one in a format this parser's own readers do not know, such as SAMI, MicroDVD, SubViewer, or a Blu-ray or DVD image track.