Android Media Player错误(100,0)

前端之家收集整理的这篇文章主要介绍了Android Media Player错误(100,0)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经阅读了网上提供的所有错误代码.

错误指定:

const PVMFStatus PVMFInfoLast = 100; ” Placeholder for end of range”

但我无法处理这个错误,谢谢你的帮助.

解决方法

将OnErrorListener实现到您的类.

在类体内写

video_view.setOnErrorListener(this);

然后使用此方法覆盖方法OnError(MediaPlayer mp,int what,int extra)

@Override
public boolean onError(MediaPlayer mp,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;
}
原文链接:https://www.f2er.com/android/314369.html

猜你在找的Android相关文章