0

I am using MediaElement to play mp3 files locally. But sometimes the files are not correctly downloaded (showing 0 bytes). When this is the case an exception occurs Java.Lang.RuntimeException: 'setDataSource failed: status = 0xFFFFFFEA', but the thing is when putting the line of code that causes this exception to occur inside a try catch nothing happens. It crashes with or without the try catch. So my question is how can I handle this issue? Thanks in advance.

try 
{
// line that causes the exception
 doaaME.Source = audioPath;
} catch(Exception e){}     
Sam
  • 291
  • 3
  • 17
  • 1
    Does this answer your question? [How do I access the MediaMetadataRetriever.setDataSource(...) status codes?](https://stackoverflow.com/questions/21009583/how-do-i-access-the-mediametadataretriever-setdatasource-status-codes). Since this is a java exception, caused by Android platform, not c# shared code. – Shaw Aug 30 '21 at 21:33
  • check the file size before attempting to play – Jason Aug 30 '21 at 21:36
  • @Jason that is what I did before but honestly I though that this is a workound, because sometimes the file is not fully downloaded so I wanted to handle also this exception. is there any way I can know if a file is fully downloaded? – Sam Aug 31 '21 at 06:35
  • @Shaw I did this solution but sometimes the file is also not fully downloaded. Is there any way I can know if a file is fully downloaded? – Sam Aug 31 '21 at 06:36

0 Answers0