Mediaplayer Error (1, -1004) Aka Media_Error_Io Trying to Stream Music on Samsung S3

MediaPlayer error (1, -1004) aka MEDIA_ERROR_IO trying to stream music on Samsung S3

The answer to this question turned out to be an issue on Android firmware installed on Samsung S III devices running Android 4.1.2.

It seemed to have been something relating to the source of the stream, because some sources eventually played on the device, but the one we needed, never played.

If you can get your stream from another source, it should work.

So if you're developing an application for a specific company/purpose and have some control over the source of the stream, or can communicate with people in control of the source of the stream, get them to change the source of the stream to something that'll work on a Samsung S III running Android 4.1.2.

Other than that all that will solve this is a firmware upgrade.

open failed: EACCES (Permission denied)

I ran into a similar issue a while back.

Your problem could be in two different areas. It's either how you're creating the file to write to, or your method of writing could be flawed in that it is phone dependent.

If you're writing the file to a specific location on the SD card, try using Environment variables. They should always point to a valid location. Here's an example to write to the downloads folder:

java.io.File xmlFile = new java.io.File(Environment
.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
+ "/Filename.xml");

If you're writing the file to the application's internal storage. Try this example:

java.io.File xmlFile = new java.io.File((getActivity()
.getApplicationContext().getFileStreamPath("FileName.xml")
.getPath()));

Personally I rely on external libraries to handle the streaming to file. This one hasn't failed me yet.

org.apache.commons.io.FileUtils.copyInputStreamToFile(is, file);

I've lost data one too many times on a failed write command, so I rely on well-known and tested libraries for my IO heavy lifting.

If the files are large, you may also want to look into running the IO in the background, or use callbacks.

If you're already using environment variables, it could be a permissions issue. Check out Justin Fiedler's answer below.

WebView won't play any sound

Try to add this

webSettings.setMediaPlaybackRequiresUserGesture(false)


Related Topics



Leave a reply



Submit