← posts
srtplayer — client-side subtitle sync

2026

[why]

subtitle sync needs precision. you need to hear the audio, see the waveform, and read the subtitles at the same time — all locally, no uploads, no cloud.

most players are either bloated desktop apps or require uploading your files to someone else's server. wanted something dead simple: open a browser, drop your files, done.

[what it does]
[the refactor]

applied NASA/JPL Power of 10 rules to a browser JS app. the results:

before          after
─────────────   ─────────────
0 assertions    13 assert() calls
0 guards        7 guardWaveSurfer() functions
anonymous       named event handlers
no loop bounds  MAX_SRT_BLOCKS = 10000
global state    centralized state object
no XSS check    escapeHTML() on all subtitle text

every DOM query validated. every user input escaped. every function under 60 lines. strict mode everywhere.

[terminal aesthetic]

rebuilt the entire UI from scratch to match the portfolio. no color, no gradients, no rounded corners.

[the pipeline]

two tools, one workflow:

gcolab-whisper → audio in, .srt out
srtplayer     → audio + .srt, synced playback

transcribe on colab. play back locally. no cloud uploads, no API keys, no subscriptions.

[stats]
[credits]

github repo →

try it live →

gcolab-whisper → // generate .srt files with AI transcription

Last updated: July 2026