【问题标题】:using default media player to open stream from an Ip in android using uri使用默认媒体播放器在 android 中使用 uri 从 Ip 打开流
【发布时间】:2015-03-12 07:41:36
【问题描述】:

我正在尝试使用默认媒体播放器在我的 Android 应用程序中打开 this stream,但我的所有媒体播放器都出现错误(例如 MX Player 和 VLC Player)。

代码是:

Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://iutv.iut.ac.ir:5657/tv2.flv");                      
intent.setType("video/*");
startActivity(intent)

错误是:

VLC encountered an error with this media.
Please try refreshing the media library

但是当我在 chrome 网络浏览器上输入链接时,它可以正确打开 MX Player 和 VLC Player 的链接

【问题讨论】:

    标签: android android-intent uri mime start-activity


    【解决方案1】:

    这对我有用

    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setDataAndType(Uri.parse("http://iutv.iut.ac.ir:5657/tv2"), "video/*");
    startActivity(intent);
    

    但如果您的问题仍然存在,请查看此处:

    VLC encountered an error with this media Android

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-08
      • 1970-01-01
      相关资源
      最近更新 更多