显示来自网址的视频

时间:2010-08-31 06:01:49

标签: android video

您能举例说明如何从网址显示视频吗?

1 个答案:

答案 0 :(得分:1)

更简单的方法:

public class A extends Activity{
    public void onCreate(Bundle b){
        super.onCreate(b);
        VideoView videoView = new VideoView(this);
        setContentView(videoView);

        videoView.setVideoPath("http://example.com/video.mp4");
        videoView.setMediaController(new MediaController(this));
        videoView.requestFocus();
        videoView.start();
    }
}