Finder
Finder

Reputation: 1217

Multiple RTSP Streaming not working

I had used 4 VideoView in my Activity.If uri1 is available and other uri's are not available means all video view shows uri1's video. If other uri's are available but uri1 is not up means all videoview's are not showing anything. Guide me to solve this issue.

String uri1="rtsp://admin:admin@Serverurl1"
String uri2="rtsp://admin:admin@Serverurl2"
String uri3="rtsp://admin:admin@Serverurl3"
String uri4="rtsp://admin:admin@Serverurl4"

videoview1.setVideoURI(Uri.parse(uri1));
videoview2.setVideoURI(Uri.parse(uri2));
videoview3.setVideoURI(Uri.parse(uri3));
videoview4.setVideoURI(Uri.parse(uri4));

Thanks in advance.

Upvotes: 2

Views: 449

Answers (1)

CompEng
CompEng

Reputation: 7376

You can try this:

vv1=(VideoView)findViewById(R.id.vv1);
vv2=(VideoView)findViewById(R.id.vv2);
vv3=(VideoView)findViewById(R.id.vv3);
vv4=(VideoView)findViewById(R.id.vv4);


try {
vv1.setVideoURI(Uri.parse(url1)); 
vv1.requestFocus();
vv1.start();
} catch (Exception e) {
    // TODO: handle exception
}
try {
vv2.setVideoURI(Uri.parse(url2)); 
vv2.requestFocus();
vv2.start();
} catch (Exception e) {
    // TODO: handle exception
}
try {
vv3.setVideoURI(Uri.parse(url3)); 
vv3.requestFocus();
vv3.start();
} catch (Exception e) {
    // TODO: handle exception
}
try {
vv4.setVideoURI(Uri.parse(url4)); 
vv4.requestFocus();
vv4.start();
} catch (Exception e) {
    // TODO: handle exception
}

Upvotes: 1

Related Questions