【问题标题】:How To Play .avi videos using url in android by programing如何通过编程在 android 中使用 url 播放 .avi 视频
【发布时间】:2013-03-06 06:43:41
【问题描述】:

如何在 android 中播放 .avi 视频?来自 url 的视频。

【问题讨论】:

  • 你有没有尝试过?也请张贴。

标签: android video avi


【解决方案1】:

您可以尝试以下代码使用 URL 播放视频

    String link="http://s1133.photobucket.com/albums/m590/Anniebabycupcakez/?action=view& current=1376992942447_242.avi";
    VideoView videoView = (VideoView) findViewById(R.id.VideoView);
    MediaController mediaController = new MediaController(this);
    mediaController.setAnchorView(videoView);
    Uri video = Uri.parse(link);
    videoView.setMediaController(mediaController);
    videoView.setVideoURI(video);
    videoView.start();

使用 VideoView 只需设置 uri:

videoView.setVideoURI(Uri.parse(videoUrl));

【讨论】:

    猜你喜欢
    • 2016-10-07
    • 2014-01-14
    • 1970-01-01
    • 2012-12-06
    • 1970-01-01
    • 1970-01-01
    • 2014-11-05
    • 2013-12-17
    • 1970-01-01
    相关资源
    最近更新 更多