i have to make an application where i need to play two video simultaniously,on screen.
here is my code.but the video dose not play.am i doing wrong anywhere? 🙁
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
VideoView myVideoView = (VideoView)findViewById(R.id.myvideoview);
myVideoView.setVideoURI(Uri.parse(SrcPath));
myVideoView.setMediaController(new MediaController(this));
myVideoView.requestFocus();
myVideoView.start();
VideoView myVideoView2 = (VideoView)findViewById(R.id.myvideoview2);
myVideoView2.setVideoURI(Uri.parse(SrcPath2));
myVideoView2.setMediaController(new MediaController(this));
myVideoView2.requestFocus();
myVideoView2.start();
}
I think you require two separate threads for playing two videos. since IO operations are blocking… One of the video Player may starve for CPU… Call start() in two separate threads…. Hope that helps!!!
EDIT
first remove the start() calls from onCreate().. Create two separate threads
now start these threads one by one…
Hope that helps!!!