DVCaptions class final

The caption tracks a player offers.

DVBox.video(source, captions: DVCaptions.track('en', vtt)). The standard controls show a captions button when there is at least one track, and the player's captionTrack signal says which is showing.

Constructors

DVCaptions(List<DVCaptionTrack> tracks, {String? initial, bool showByDefault = true})
DVCaptions.track(String language, DVMediaSource source, {String? label, bool showByDefault = true})
One track from a file.

Properties

hashCode → int
The hash code for this object.
no setterinherited
initial → String?
The language shown first. The first track when null.
final
initialTrack → DVCaptionTrack?
The track shown when the player starts, or null for none.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showByDefault → bool
Whether captions start on. Off still offers them in the controls.
final
tracks → List<DVCaptionTrack>
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
trackFor(String? language) → DVCaptionTrack?
The track for language, or null.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

parse(String text) → List<DVCaptionCue>
Cues in a WebVTT or SubRip file. Which one is decided by the content, not the extension: a .vtt served as text/plain is still WebVTT.