mediaplayer:setdatasource:ioexception,uri= 电脑蓝屏怎么解决决

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
您的访问请求被拒绝 403 Forbidden - ITeye技术社区
您的访问请求被拒绝
亲爱的会员,您的IP地址所在网段被ITeye拒绝服务,这可能是以下两种情况导致:
一、您所在的网段内有网络爬虫大量抓取ITeye网页,为保证其他人流畅的访问ITeye,该网段被ITeye拒绝
二、您通过某个代理服务器访问ITeye网站,该代理服务器被网络爬虫利用,大量抓取ITeye网页
请您点击按钮解除封锁&video - Android MediaPlayer setDataSource() Throwing IllegalStateException Error - Stack Overflow
to customize your list.
Join the Stack Overflow Community
Stack Overflow is a community of 6.3 million programmers, just like you, helping each other.
J it only takes a minute:
While I use almost the same code to play two videos, the first works perfectly, but the second does not.
When I press the next video button, the program crashed with:
WARN/System.err(15726): java.lang.IllegalStateException
WARN/System.err(15726):
at android.media.MediaPlayer.setDataSource(Native Method)
Source code:
the first play code:
mediaPlayer = new MediaPlayer();
playURI = receiveIntent.getStringExtra("playURI");
showDebugInfo("play uri "+playURI);
Log.e("Gplayer on create", "play uri "+playURI);
mediaPlayer.setDataSource(playURI);
} catch (IllegalArgumentException e) {
Log.v(LOGTAG, e.getMessage());
} catch (IllegalStateException e) {
Log.v(LOGTAG, e.getMessage());
} catch (IOException e) {
Log.v(LOGTAG, e.getMessage());
when press next button it runs the following code:
String uri = listAdapter.getItem(position).getItem().getFirstResource().getValue();
showDebugInfo(" Uri "+uri);
if(mediaPlayer != null){
mediaPlayer.stop();
mediaPlayer.reset();
mediaPlayer.setDataSource(uri);
mediaPlayer.prepareAsync();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Why does this happen? and I check the two parts only the different that, the first one is new a mediaplayer and the second is let the mediaplayer stop and reset then the same.
Know someone who can answer?
Share a link to this
via , , , or .
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Browse other questions tagged
Stack Overflow works best with JavaScript enabledjava.io.IOException: setDataSource failed.: status=0x8000000
当我使用Android中MediaPlayer播放网络uri提供的一首歌曲时,出现如上的问题,这个问题的解决是因为没有获取相应的播放权限导致的。解决办法:需要在AndroidMani
当我使用Android中MediaPlayer播放网络uri提供的一首歌曲时,出现如上的问题,这个问题的解决是因为没有获取相应的播放权限导致的。解决办法:需要在AndroidManifest.xml中添加这样一段代码用于获取播放权限来访问你的manifest
file文件。
&uses-permission android:name=&android.permission.INTERNET& /&
网络播放指定Url提供的歌曲的代码如下:
& & * 网络资源
& & MediaPlayer&mediaPlayer=new MediaPlayer();
& & String path=&?link=/data2/music/61128.mp3?xcode=fc3ef977c9fa9bdff2550e&song_id=2923710&;
& & mediaPlayer.setDataSource(path);//为MediaPlayer设置数据源
& & mediaPlayer.prepare();//准备播放
& & mediaPlayer.start();//开始播放
版权声明:本文为博主原创文章,,未经博主允许不得转载。
你最喜欢的

我要回帖

更多关于 电脑太卡了怎么解决 的文章

 

随机推荐