1

I want to play 2 or more videoview at same time but only one play why? can ı do this with mediaplayer? Must I use thread?

VideoView vv1,vv2,vv3,vv4;

        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(dizi[0].toString())); 
        vv1.requestFocus();
        vv1.start();
        } catch (Exception e) {
            // TODO: handle exception
        }
        try {
        vv2.setVideoURI(Uri.parse(dizi[1].toString())); 
        vv2.requestFocus();
        vv2.start();
        } catch (Exception e) {
            // TODO: handle exception
        }
        try {
        vv3.setVideoURI(Uri.parse(dizi[2].toString())); 
        vv3.requestFocus();
        vv3.start();
        } catch (Exception e) {
            // TODO: handle exception
        }
        try {
        vv4.setVideoURI(Uri.parse(dizi[3].toString())); 
        vv4.requestFocus();
        vv4.start();
        } catch (Exception e) {
            // TODO: handle exception
        }
  • can you print out the exceptions in the catch clauses? Maybe they show something useful. – Marc Van Daele Jun 22 '12 at 10:59
  • 06-22 14:02:11.518: E/ARTSPConnection(29097): Server unexpectedly closed the connection. it says and only one plays the others just photo dont play –  Jun 22 '12 at 11:04
  • Hence it seems to be a server issue. To double check this, can you use 4 urls from different servers (maybe using some simple video streams from an http server)? – Marc Van Daele Jun 22 '12 at 11:09
  • 4 of them same server but different camera ip . –  Jun 22 '12 at 11:11
  • ok. The idea is to test whether it is a client issue (can the device playback 4 streams simultaneously) or a server issue. This can be done by using 4 streams from different servers. If this works fine, then we know it is a server issue. – Marc Van Daele Jun 22 '12 at 11:15
  • 1
    AFAIK, playing multiple videos simultaneously (from any source) is not supported, at least with SurfaceView. – CommonsWare Jun 22 '12 at 11:38

0 Answers0