> I'm trying to display a remote video (mp4 format). When I launch > prepare (or prepareSync), Android is crashing (see log view after my > piece of code). I tried with emulator, ADP1 and Hero... > Thanks by advance for your help > mPlayer = new MediaPlayer(); > mPlayer.setOnBufferingUpdateListener(this); > mPlayer.setDataSource(this, mVideoUri); //mVideoUri is a remote http > address > mPlayer.setDisplay(mHolder); > mPlayer.prepareAsync(); > I tried a lot of thing...but this my last code ! > public void onBufferingUpdate(MediaPlayer mp, int percent) { > // TODO Auto-generated method stub > Log.e("ee", ">>" + percent); > if (percent==20) mp.start(); > }
Is your SurfaceView prepared by the time you call mPlayer.setDisplay(mHolder); ? Here is a sample project supporting HTTP-based video streams played by MediaPlayer on a SurfaceView: http://github.com/commonsguy/vidtry -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html -- 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