how to check whether file Media error or not

All your problems with Audio, Video and Images.

how to check whether file Media error or not

Postby luanbt » Tue Apr 12, 2011 7:24 pm

I have list of files .3GP
can anybody know how to check whether these files are error or not by using android API.
can I use method prepare() to check?
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                 MediaPlayer mPlayer = new MediaPlayer();
  2.                 try {
  3.                         mPlayer.setDataSource(strPath);
  4.                         mPlayer.prepare();
  5.                        
  6.                 } catch (Exception e) {
  7.                                 TraceLog.msg_error("this file is error");
  8.                 }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


many thanks
luanbt
Freshman
Freshman
 
Posts: 7
Joined: Tue Feb 22, 2011 8:00 am

Top

Re: how to check whether file Media error or not

Postby glenandroid » Mon May 23, 2011 10:02 pm

You can call setOnErrorListener on your MediaPlayer -- pass it an OnErrorListener
--> Yes. No. Maybe. I don't know. Can you repeat the question? <--
glenandroid
Junior Developer
Junior Developer
 
Posts: 16
Joined: Mon Mar 01, 2010 3:40 am
Location: Manchester England

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Google Feedfetcher and 12 guests