{
  "id": 21492518,
  "title": "how my 1.17 mb player renders webvtt subtitles on a canvas (no amoled burn-in, no dom churn)",
  "url": "https://urgent.news/2026/11/23/how-my-1-17-mb-player-renders-webvtt-subtitles-on-a-canvas-no-amoled",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-23T23:04:34.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/hammiwor/how-my-117-mb-player-renders-webvtt-subtitles-on-a-canvas-no-amoled-burn-in-no-dom-churn-2gpo"
  },
  "original_language": "en",
  "account": "This is the story of how the developer behind RKMovies, a 1.17 MB native 4K player for Android with a 29.5 MB Windows build, manages to render webVTT subtitles without causing AMOLED burn-in or DOM churn. The key to achieving this lies in the subtitle engine's design.\n\nRKMovies follows a strict rule: subtitles must not burn into AMOLED screens, and total playback RAM must stay under 15 MB on 2 GB phones. To address these constraints, the developer opts for a canvas overlay approach instead of the traditional method of rendering subtitles using DOM nodes over the video.\n\nUsing a canvas overlay provides several benefits. First, static pixels on AMOLED screens are a burn-in risk, so rendering subtitles on a separate canvas layer eliminates this concern. Second, DOM node creation per subtitle cue can cause garbage collection (GC) churn, leading to noticeable jank during playback seeks. By rendering subtitles on a canvas, the developer avoids this performance hit, resulting in a smoother experience on budget phones.\n\nThe subtitle parsing system keeps a sorted cue list and a sliding window of the three actively rendered cues. The canvas only repaints when the active set changes or when the user seeks, minimizing unnecessary rendering work. Text metrics are measured once per style run and cached, so a two-hour movie doesn't waste CPU resources re-measuring the same words thousands of times.\n\nA crucial aspect of the pipeline is converting the upstream SRT files to webVTT format in memory during load. The app handles tasks such as dropping the index line, swapping comma decimals for dot timestamps, and re-wrapping overlong lines. This small state machine keeps the bundled parser tiny, which is essential when the entire APK is only 1.17 MB.\n\nThe subtitle rendering process relies on the underlying Mediacodec hardware decode path, which remains untouched. This ensures that the player can handle 4K HEVC playback with a RAM footprint below 15 MB, demonstrating the efficiency of the subtitle rendering system.\n\nTo access the RKMovies player, visit the Android edition download page or the Windows edition download page. For more information about the player's features, refer to the home page.",
  "summary": "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…",
  "key_points": [
    "RKMovies player renders webVTT subtitles using canvas overlay",
    "Avoids AMOLED burn-in and DOM churn with canvas approach",
    "Parses and renders subtitles in memory, keeping APK under 1.17 MB"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}