how to play video from url

Posted by priyanka on Stack Overflow See other posts from Stack Overflow or by priyanka
Published on 2010-04-12T05:27:20Z Indexed on 2010/04/12 5:33 UTC
Read the original article Hit count: 566

i am biginner in android development and try to play video from link but it's give error "sorry,we can't play this video" i tride so many links but for all links its show same error.

My code it follwing

public class VideoDemo extends Activity {

    private static final String path ="http://demo.digi-corp.com/S2LWebservice/Resources/SampleVideo.mp4";

private VideoView video; private MediaController ctlr; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); getWindow().setFormat(PixelFormat.TRANSLUCENT); setContentView(R.layout.videoview);

        video = (VideoView) findViewById(R.id.video);
        video.setVideoPath(path);

        ctlr = new MediaController(this);
        ctlr.setMediaPlayer(video);
        video.setMediaController(ctlr);
        video.requestFocus();
 }

}

thansk in advance

© Stack Overflow or respective owner

Related posts about android

Related posts about videoview