Indian releases now ship four or five audio languages on the same stream. Telugu original, Hindi dub, Tamil dub, sometimes Kannada and Malayalam too. The stock players pick one at start, and if you switch, half the time the video re-seeks and re-buffers. So people just stay on the wrong dub.
My player is 1.17 MB on Android and runs on the system MediaPlayer, so there was no library to lean on. The trick turned out to be boring: never tear the player down.
What I actually do:
After prepare, I read player.getTrackInfo() once. It returns every track with its type and language, so I filter TRACK_TYPE_AUDIO and build a small picker from getLanguage() .
Switching is just selectTrack(index) on the same player instance. The video track stays selected, the decoder never restarts, and there is no rebuffer. On a 2 GB Moto G Play the swap lands in under 300 ms with no seek-bar jump.
The catch: some OEM players still stall briefly when the audio renderer re-inits.…