【问题标题】:Playing video through URL of Youtube in Android在 Android 中通过 Youtube 的 URL 播放视频
【发布时间】:2016-10-07 18:27:24
【问题描述】:

我想通过 YouTube 的 URL 播放视频,在 Android 中使用 VideoView。请帮帮我。

【问题讨论】:

  • 向我们提供详细信息、代码、异常。萨卢多斯
  • 在谷歌上搜索 ExoPlayer for android。

标签: android youtube android-videoview


【解决方案1】:

试试这个:

videoView = (VideoView) findViewById(R.id.video_view);
waitSign = (ProgressBar) findViewById(R.id.progress_bar);
waitSign.setVisibility(View.VISIBLE);
MediaController contorls = new MediaController(this);
contorls.setAnchorView(videoView);
videoView.setMediaController(contorls);
String url = "http://www.somedomain.com/samplevideo.mp4";
videoView.setVideoURI(Uri.parse(url));
videoView.start();

记得在文件名上加上扩展名

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-10-22
    • 1970-01-01
    • 2012-05-27
    • 1970-01-01
    • 1970-01-01
    • 2012-03-17
    • 1970-01-01
    • 2014-02-12
    相关资源
    最近更新 更多