Failure code -32 MediaPlayer (Android 4.4)

假如想象 提交于 2019-12-06 01:12:33

I have the same issue and this helps me https://groups.google.com/forum/#!topic/ima-sdk/dTkE2BmH1mw. Here the example of how i did it in my project(this is simple loop over playlist):

     videoView = (VideoView)findViewById(R.id.videoView);
     videoView.requestFocus();
     videoView.start();
     videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
       public void onCompletion(MediaPlayer mp) {
         mp.setDisplay(null);
         mp.reset();
         mp.setDisplay(videoView.getHolder());

         PlaylistItem next = playlistAdapter.getNext(lastVideo.id);
         if (next != null && lastVideo.URL != null) {
         lastVideo = next;
         videoView.setVideoURI(next.getLocalFileURI());
         videoView.requestFocus();
         videoView.start();
       }
     });

the following lines

     mp.setDisplay(null);
     mp.reset();
     mp.setDisplay(videoView.getHolder());

do the trick.

Found the answer. I was using IMAVideoPlayer (for commercials). Just had to update the sdk.jar. Everything works fine on KitKat now.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!