Convert subtitle files to WebVTT, which is the only format an HTML5
<video> <track> accepts. Handles SubRip (.srt) and Advanced SubStation
Alpha (.ass, common for anime), dispatching on the file name.
Summary
Functions
ASS → WebVTT: keep only the dialogue events, drop styling/override tags. Not a full ASS renderer, but yields readable timed text the browser shows.
Known subtitle file extensions.
SubRip → WebVTT: add the header and switch the comma decimal to a dot.
True when the filename ends in a known subtitle extension.
Convert by file extension; falls back to SRT handling.
Functions
ASS → WebVTT: keep only the dialogue events, drop styling/override tags. Not a full ASS renderer, but yields readable timed text the browser shows.
Known subtitle file extensions.
SubRip → WebVTT: add the header and switch the comma decimal to a dot.
True when the filename ends in a known subtitle extension.
Convert by file extension; falls back to SRT handling.