Sample Code:
How to play the two video in one activity
public class Two_videos extends Activity
{
VideoView video1, video2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.two_video);
VideoView video1= (VideoView) findViewById(R.id.video1);
video1.setVideoPath("/mnt/sdcard/Movies/com.bnb.giggle/IMG_20130415184609.mp4");
video1.start();
VideoView video2= (VideoView) findViewById(R.id.video2);
video2.setVideoPath("/mnt/sdcard/Movies/com.bnb.giggle/IMG_20130415184608.mp4");
video2.start();
}
}
cannot play two video same time.
Play multiple videos is depends on hardware but if your device supports only one instance of media Player then you must call yourVideoView.stopPlayBack() for playing video in another videoview. you can resume video in first videoview by using its resume() method but after stop playing from second.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With