VideoPlayerView = new VideoView(this);
        VideoPlayerView.setOnPreparedListener(VideoPrepared);
        VideoPlayerView.setOnCompletionListener(VideoFinished);
        VideoPlayerView.setOnErrorListener(VideoError);

        String VideoResourcePath =
getResources().getResourceName(R.raw.myVideo);
        VideoResourcePath = VideoResourcePath.replace(':', '/');
        VideoPlayerView.setVideoPath("android.resource://" +
VideoResourcePath);

                public boolean onError(MediaPlayer mp, int what, int extra) {
                        FailTimer.cancel();
                        finish();
                        return true;
                }

Hi,
  I am getting a hang in a MediaPlayer when there is an error.

  I have a separate Activity that I launch to play the MediaPlayer in
full screen mode. The relevant code from onCreate is posted above.

  I have set a Timer to time out in 15 seconds, so that if the video
fails to play the activity will exit. However, an error happens, so
onError is called, and the debugger shows me that I am hung in the
MediaPlayer.release() / MediaPlayer.reset() call.

  I'm not so interested in discovering why the error happens, as the
phone I am testing on seems to have issues with running videos. But I
do want to figure out why the MediaPlayer is hanging.

Any help?

Thanks,
John

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to