PrismCore / API reference / Subtitles and captions
Structure
TimedTextCue
struct TimedTextCueDeclared in Sources/PrismCore/Subtitles/TimedTextCue.swift · PrismCore 3.5.4
One timed text cue of an embedded subtitle stream, handed to the host as the demux produces it — the host-facing twin of the internal SubtitleCue.
Exists because the WebVTT renditions are not always the right delivery for text: AVPlayer times a SUBTITLES rendition on its own segment schedule, which is where the late-cue drift class of bugs lives, while a host that draws captions itself wants the cue list on the player's own clock. Plex's subtitle-only transcode turned out to answer empty documents for embedded tracks (Aether#1533), so "ask the server for the text" is not a route — the demux this engine already runs is the one honest source of embedded cues.
Times are seconds on the producer's playback clock. Remux callbacks subtract the source's presentation origin for comparison with AVPlayerItem.currentTime(). SoftwarePlaybackPipeline.activeSubtitleCues keeps source timestamps, matching that pipeline's currentTime.
Initializers
init(streamIndex: Int32, start: Double, end: Double, text: String, placement: TextCuePlacement? = nil)No documentation comment in the source.
Instance properties
let streamIndex: Int32The source stream this cue came from — the same index SubtitleTrackInfo.streamIndex reports, so a host can route cues to the track the viewer selected.
let text: StringCue payload as the converter produced it — WebVTT-safe plain text, possibly carrying simple inline tags (<i>, <b>, <u>) the source had, including ones translated from ASS {\i1}-style overrides.
Generated from the public symbols of PrismCore 3.5.4. All types