Android Media Player Error (100,0)
Asked Answered
A

2

7

I have read all the error codes given on the web.

Error specifies:

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

But I didn't able to handle this error, thanks for helping.

Abrahamabrahams answered 16/8, 2012 at 11:5 Comment(0)
A
12

Implement OnErrorListener to your class.

inside the class body write

video_view.setOnErrorListener(this);

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;
}
Abrahamabrahams answered 16/8, 2012 at 11:45 Comment(7)
What happened to good old switch/case and constants?Koy
yah you are right , just it didnt came in mide , hurriedly i just started doing ...oops but it works :)..Abrahamabrahams
what is pb2 and why are you only changing visibility on that when errorcode == 1?Turney
switch/case with string doesnt work for android so i prefer work with this too ^^Nasturtium
@Nasturtium what variable is an intGumwood
what TabAct.class can do?Vineyard
this doesn't fix the error... it catches the error and implements some sort of re-initialization (i assume) of the media player through mystery classes that aren't defined or even sketched out in this non-answer.Adda
C
10

I faced with this problem on Android 1.5.

mMP = new MediaPlayer();
mMP.setOnCompletionListener(new CompletionListener());
mMP.setOnErrorListener(new ErrorListener());    
final FileInputStream fileInStream = new FileInputStream(mFileName);    
mMP.setDataSource(fileInStream.getFD());        
mMP.prepare();
mMP.play();
01-14 01:57:26.248: W/MediaPlayer(1971): MediaPlayer server died!
01-14 01:57:26.258: E/MediaPlayer(1971): error (100, 0)
01-14 01:57:26.258: E/MediaPlayer(1971): Error (100,0)

It happens when mp3 files duration is less than 1 second. This is an android.media.MediaPlayer bug.

The solution is to make mp3 files duration more than 1 second.

Cromer answered 13/9, 2012 at 6:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.