Murtaza Mehmood
Murtaza Mehmood

Reputation: 93

RTSP streaming in android

Here is my code, and when I run the app, it will display "Sorry this video cannot be played".

public class rtspActivity extends Activity {

    Button btn;
    VideoView v;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rtsp);
        v=(VideoView)findViewById(R.id.vv);

        v.setVideoURI(Uri.parse("rtsp://server.intelcast.tv:554/live/haditvfour1"));

    }

 }

Upvotes: 1

Views: 479

Answers (1)

Stupidus
Stupidus

Reputation: 471

You should start with

v.setMediaController(new MediaController(this));
v.requestFocus();
v.start();

Also, the url you're using might not be good. Try it in VLC or similar, to see if its actually there

Another problem can be the "server.intelcast.tv:554" part, try replacing this with a real ip adress with numbers, i've experinced this issue myself

Upvotes: 2

Related Questions