I made a video player with surfaceview and mediaplayer. i have 10 videos and 10 buttons. if click on each buttons, each videos are playing.
here is my code..
video.getHolder().setFormat(PixelFormat.TRANSPARENT); video.getHolder().setFormat(PixelFormat.OPAQUE); video.setVideoURI(Uri.parse(temp)); video.setOnPreparedListener(new OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { mp.start(); } });
it work for me