在Android上播放来自网址的电影

时间:2011-06-08 10:30:56

标签: android url video movie

@Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.main);

        VideoView videoView = (VideoView) findViewById(R.id.video_view);
        MediaController mediaController = new MediaController(this);
        mediaController.setAnchorView(videoView);
        Uri video = Uri.parse(link);
        videoView.setMediaController(mediaController);
        videoView.setVideoURI(video);
        videoView.requestFocus();
        videoView.start();
    }

但不成功。这是一个错误:“无法播放此视频”

1 个答案:

答案 0 :(得分:1)

我猜你没用

    <uses-permission android:name="android.permission.INTERNET" />

你呢?