Android Media Stream Error? java.io.FileNotFoundException: No content provider :http://

前端 未结 4 581
南方客
南方客 2021-02-06 21:26

I followed this to Play Stream Radio In android

Here Its working Fine But Player Loading Bit Slow after clicking I need to wait for 30+ seconds time

But I am ge

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-06 22:03

    Go to this file https://github.com/Old-Geek/Radio/blob/master/app/src/main/java/org/oucho/radio/Player.java#L234 and change

    player.setDataSource(context, Uri.parse(url));
    

    to

    player.setDataSource(url)
    

    The problem is that void setDataSource (String path) Sets the data source (file-path or http/rtsp URL) to use.

    path String: the path of the file, or the http/rtsp URL of the stream you want to play

    the github code uses void setDataSource (Context context, Uri uri) which assumes uri to be of some form of ContentProvider

    context Context: the Context to use when resolving the Uri
    uri Uri: the Content URI of the data you want to play

提交回复
热议问题