Android的媒体播放器错误(100,0) [英] Android Media Player Error (100,0)
本文介绍了Android的媒体播放器错误(100,0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我看了所有的错误codeS在网络上给定的。
I have read all the error codes given on the web.
错误规定:
常量PVMFStatus PVMFInfoLast = 100; 占位符的范围内结束
const PVMFStatus PVMFInfoLast = 100; " Placeholder for end of range"
但我没有能力处理这个错误,感谢帮助。
But I didn't able to handle this error, thanks for helping.
推荐答案
实施OnErrorListener上您的课。
Implement OnErrorListener to your class.
类体里面写
video_view.setOnErrorListener(this);
然后用这种方法覆盖方法的OnError(MediaPlayer的熔点,诠释了什么,整型附加)
then overwrite the method OnError(MediaPlayer mp , int what , int extra) with this method
@Override
public boolean onError(MediaPlayer mp, int what, int extra)
{
if (what == 100)
{
video_view.stopPlayback();
Intent inn = new Intent(HelloInterruptVideoStream.this,TabAct.class);
startActivity(inn);
}
else if (what == 1)
{
pb2.setVisibility(View.GONE);
Log.i("My Error ", "handled here");
video_view.stopPlayback();
Intent inn = new Intent(HelloInterruptVideoStream.this,TabAct.class);
startActivity(inn);
}
else if(what == 800)
{
video_view.stopPlayback();
Intent inn = new Intent(HelloInterruptVideoStream.this,TabAct.class);
startActivity(inn);
}
else if (what == 701)
{
video_view.stopPlayback();
Intent inn = new Intent(HelloInterruptVideoStream.this,TabAct.class);
startActivity(inn);
}
else if(what == 700)
{
video_view.stopPlayback();
Toast.makeText(getApplicationContext(), "Bad Media format ", Toast.LENGTH_SHORT).show();
Intent inn = new Intent(HelloInterruptVideoStream.this,TabAct.class);
startActivity(inn);
}
else if (what == -38)
{
video_view.stopPlayback();
Intent inn = new Intent(HelloInterruptVideoStream.this,TabAct.class);
startActivity(inn);
}
return false;
}
这篇关于Android的媒体播放器错误(100,0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文