开发者

Play movie from URL on Android

@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);
        vi开发者_运维知识库deoView.setVideoURI(video);
        videoView.requestFocus();
        videoView.start();
    }

But not successful. It's giving an error: "Cannot play this video"


I guess you did not use

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

Did you?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜