I have a problem playing video on Android 4.4 on the Galaxy 3 tab. The problem did not occur with the previous version of Android 4.2.
Problem
I play a video in a loop. This worked very well for all users until Tab 3 upgraded to Android 4.4. Since then, the video freezes after the first cycle (it gets stuck on the first frame of the video to be exact).
I can reproduce this behavior, and the moment the video freezes, my LogCat starts to fill up with the following output:
16:25:25.239 14589-14601/my.app V/MediaPlayer? back from callback 16:25:25.499 14589-14686/my.app V/MediaPlayer? message received msg=7, ext1=0, ext2=0 16:25:25.499 14589-14686/my.app V/MediaPlayer? unrecognized message: (7, 0, 0) 16:25:25.499 14589-14686/my.app V/MediaPlayer? callback application 16:25:25.499 14589-14686/my.app V/MediaPlayer? back from callback 16:25:25.519 14589-14602/my.app V/MediaPlayer? message received msg=4, ext1=0, ext2=0 16:25:25.519 14589-14602/my.app V/MediaPlayer? Received seek complete 16:25:25.519 14589-14602/my.app V/MediaPlayer? All seeks complete - return to regularly scheduled program 16:25:25.519 14589-14602/my.app V/MediaPlayer? callback application 16:25:25.519 14589-14602/my.app V/MediaPlayer? back from callback 16:25:25.519 14589-14601/my.app V/MediaPlayer? message received msg=6, ext1=0, ext2=0 16:25:25.519 14589-14601/my.app V/MediaPlayer? Received MEDIA_STARTED 16:25:25.519 14589-14601/my.app V/MediaPlayer? callback application 16:25:25.519 14589-14601/my.app V/MediaPlayer? back from callback 16:25:25.789 14589-14686/my.app V/MediaPlayer? message received msg=7, ext1=0, ext2=0 16:25:25.789 14589-14686/my.app V/MediaPlayer? unrecognized message: (7, 0, 0) 16:25:25.789 14589-14686/my.app V/MediaPlayer? callback application 16:25:25.789 14589-14686/my.app V/MediaPlayer? back from callback 16:25:25.809 14589-14602/my.app V/MediaPlayer? message received msg=4, ext1=0, ext2=0 16:25:25.809 14589-14602/my.app V/MediaPlayer? Received seek complete
Code
It is assumed that the following video program (simple) will be played. MediaPlayer.OnErrorListener () and MediaPlayer.OnInfoListener () are never called.
public class VideoActivity extends Activity { private MediaPlayer mediaPlayer; private String videoPath = "some path obtained from the system";
The video can be launched several times using a different path to the video file throughout the life cycle, so I stop and reset the player before the movie starts.
So far, the only solutions I have found on the Internet have been to make sure MediaPlayer is not going to GC (which I do without making it a local method) and implement WakeLock, which I also made without effect.
Can someone help me here and point me in the right direction? Thanks!