SubtitleSource
An external subtitle file added alongside a media item.
SubRip, WebVTT and ASS files load at open: each becomes a selectable synthetic subtitle track (a negative io.github.yuroyami.kiteplayer.TrackId, labelled by title or the file name) whose cues run through the same engine timing path container cues use. A file that cannot be read or parsed warns typed and is skipped rather than failing the open.
Where the bytes come from, in order: io when set; then, for an http or https uri, the network resolver; then uri as a local path.
The network resolver gets the parent item's MediaItem.headers only when uri has the same scheme, host and port as the item's own URI, so a subtitle beside a signed URL works. A subtitle on another server gets no item header. To send headers to it, give it its own io.
The text's encoding is decided from the bytes unless encoding names it: a byte-order mark, then UTF-8, then SubtitleConfig.fallbackEncoding when one is set, and otherwise a guess, which PlaybackWarning.SubtitleCharsetGuessed reports. A track whose guess was wrong can be read again in another encoding with KitePlayer.reloadExternalSubtitle.
Throws
when encoding is not one of ENCODINGS or a label for one.