Posts

A wired issue of MediaPlayer on Android

Background Our application needs to play mp3 files served by our server. What we used to do is just using MediaPlayer to play that URL. However, there are more and more customers complaint about Music playing being cut off quite frequently. So I had to dig into legacy codes to find out the reason. Reproduce From existing codebase, I could tell our app respects MediaPlayer's   OnErrorListener   and if MediaPlay throw out any Error, app will try to catch them and recover. Unfortunately, we did not receive any exceptions for this part according to our Fabric crashlytics report. Besides that, this bug is not really easy to reproduce.   I knew it must be caused by user's network issue. So I tried Charles proxy and using its throttling feature. However it seems like MediaPlayer would have a special connection after connecting and Charles' throttling can not control that connection. Then I also tried Android Emulator's build-in network status simulation feature. Sti
Recent posts