本文介绍了多RTSP流不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用了4 VideoView在我Activity.If uri1可以和其他的URI所不具备的手段所有的视频视图显示uri1的视频。如果其他URI的也有,但uri1不起来意味着所有的videoview的都没有显示任何东西。引导我解决这个问题。
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.
推荐答案
您可以试试这个:
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
}
这篇关于多RTSP流不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!