I'm building RKMovies, a tiny 4K player (0.91 MB APK on Android, a native Windows build, hardware decode, no account, no tracking). Indian titles usually ship with several audio dubs — Hindi, Tamil, Telugu, English — and users expect to switch between them mid-playback without losing their position. Here's how that fits inside a sub-megabyte APK.
The whole feature is three pieces, all inside the player module:
- Filter the dub list. Upstream play payloads mix real audio dubs with subtitle-language variants ("Arabic sub"). Anything ending in
subis not an audio option, so it gets filtered out before the picker renders. - Probe before you promise. When the audio panel opens, the app background-probes the other dubs and hides any that have no stream for the current episode. No dead buttons.
- Swap in place. Switching audio does not reload the page. It fetches the dub's play data (cached), picks the best non-VIP stream, and hands it to the player's existing quality switch at the same timestamp, so playback continues from the exact position. Subtitles reset and refetch, because they belong to the dub's resource, not the video.
async function switchDubStream(d) { let data = dubPlayCache[d.detailPath]; if (!data) { const res = await API(`play?subjectId=${d.subjectId}&se=${se}&ep=${ep}&detailPath=${d.detailPath}`); data = res?.data; dubPlayCache[d.detailPath] = data; } const list = data.streams?.length ? data.streams : (data.hls || []); const pool = list.filter(x => !x.vipLocked && x.url) .sort((a, b) => (parseInt(b.resolutions) || 0) - (parseInt(a.resolutions) || 0)); smoothSwitchQuality(pool[0], true); // same position, no navigation loadSubtitles(); // subs belong to the dub, not the video } The size cost is basically zero: no HLS demuxer, no extra library. The player already has a quality switcher, so a dub switch is just "pick a different stream URL and send it down the same path". The picker UI is a plain DOM list, not a component framework.
Lesson: features don't cost APK size, dependencies do. Reuse the machinery you already have.
Try it: media player for low-end Android, native Windows app.

