i'm the dev behind RKMovies, a 1.17 mb native 4k player for android, with a 29.5 mb windows build on the side. one constraint i gave myself early: subtitles must not burn in amoled screens, and total playback ram has to stay under 15 mb on 2 gb phones. this is how the subtitle engine actually works.
dom subtitles are the enemy
the obvious implementation is a div stacked over the video that you re-render on every cue. two problems with that. on amoled, every static pixel is a burn-in timer, and subtitle blocks sit still for seconds at the bottom of the frame. and re-creating dom nodes per cue on a budget phone is gc churn you feel as jank during seeks.
canvas overlay with a dirty flag
so the player renders webvtt cues onto a single canvas layered above the video surface. the parser keeps a sorted cue list plus a sliding window of the 3 active cues, and the canvas only repaints when that active set changes or when you seek. text metrics are measured once per style run and cached, so a two hour movie does not re-measure the same words thousands of times.
one canvas layer costs one extra composite pass on the gpu. the mediacodec hw decode path underneath is untouched, which is why the ram number holds under 15 mb during 4k hevc playback.
the srt to webvtt hop
upstream sources hand out srt, players want webvtt, so the app converts in memory at load: drop the index line, swap comma decimals for dot timestamps, re-wrap overlong lines. it's a small state machine and it keeps the bundled parser tiny, which matters when your whole apk is 1.17 mb.
grab the android build on the apk download page, or the windows one on the pc edition page. the home page is here if you want the full feature list.
