When I use the MediaPlayer in Android to play a song provided by the network URI , the problem occurs as above. The solution to this problem is caused by the lack of access to the corresponding playback permissions .
WORKAROUND: You need to add a piece of code in androidmanifest.xml to get the playback permission to access your manifest file.
<uses-permission android:name= "Android.permission.INTERNET"/>
The network playback specifies the URL of the song that is provided by the code such as the following:
/*
* Network resources
*/
MediaPlayerMediaplayer=new MediaPlayer ();
String path= "Http://music.baidu.com/data/music/file?Link=http://yinyueshiting.baidu.com/data2/music/3566287/29237101437253261128.mp3?xcode=fc3ef977c9fa9bdf4394f800f7f2550e&song_id=2923710 ";
Mediaplayer.setdatasource (path);Set up a data source for MediaPlayer
Mediaplayer.prepare ();Ready to play
Mediaplayer.start ();Start playback
Java.io.IOException:setDataSource failed.: Resolution of status=0x80000000 problems