My Android app streams a live audio show using MediaPlayer within a Service. It worked fine until the KitKat 4.4.2 update to Samsung S4 and S5 phones. On these phones, the audio cuts out after about 1 minute. It will start playing again if I hit the stop button, then the play button again, but will continue to cut out again after about a minute. My app thinks it is still playing, but there is no sound.
The live streaming works fine on the other devices I have tested, including a non-Samsung phone running the 4.4.2 OS, and on a 4.4.2 emulator.
After searching stackoverflow, I tried to resolve the issue by
- targeting API 19
- adding a wakelock
- adding a wifilock
- temporarily commenting out the two timer task threads I have running to update the UI
None of these helped to keep the streaming audio running.
While testing on the Samsung Galaxy S5 phone, I receive MediaPlayer message msg=3 while it is playing, then it changes to msg=2 and then msg=7 right before it stops. I looked at error codes but could not find a 7.
My questions:
1. What is a MediaPlayer msg=7?
2. Has anyone else had trouble with live streaming since the KitKat updates to Samsung S4/S5 phones?
Thank you.
EDIT: PROBLEM APPEARS SOLVED. PLEASE SEE MY COMMENT BELOW.
7/15/14 CORRECTION: It wasn't solved as it just kept looping the same buffered part of the stream. Not solved. This only happens on Samsung S4 and S5 phones w/KitKat 4.4.2 updates. At one point I received a message that it was not valid for progressive playback, so I tested a different live audio URL, which had no problems continuing playback.
The setlooping got the player to stay started, but just played the same audio over and over. As an incomplete fix, I added a mediaplayer reset, followed by a call to my playshow method in my onCompletionListener, which works to get the rest of the show, but it causes about a second of the show to be skipped each time. Anyone have any idea of what is going on with Samsung phones streaming live audio? Thanks.