addExternalSubtitle

Loads a subtitle FILE during playback, appends it to PlayerSnapshot.tracks as an external track, selects it, and returns its id once it is really showing.

SubRip and WebVTT, the same text path the open-time route reads.

When a container subtitle stream is already timing cues, the swap needs the same reopen selectTrack needs, and this call waits for it. It used to return the id as soon as the file parsed, so a caller held an id for a track whose selection had not run and might still fail the player. A selection that does not apply takes the appended track back out of PlayerSnapshot.tracks rather than leaving a row nothing can show.

Throws

when nothing is open, or when the selection was replaced or torn down before it applied.

when the file cannot be read, cannot be parsed, or parses to no cues; the message says which.

when the reopen the selection needed failed.