Android Question [SOLVED] MediaPlayerStream Problem with 5.1.1

GuyBooth

Active Member
Licensed User
Longtime User
An App I wrote that uses a MediaPlayerStream object was working properly with versions of Android up to and including 4.4.2.
With 5.1.1 the MediaPlayerStream fails to load the files. The app checks to make sure the file can be located before it tries to load it, so it doesn't have a problem finding the file.
The error in the log following the MP.Load instruction is

"Stream Error: MEDIA_ERROR_UNKNOWN, -2147483648"

Is there something I need to do with 5.1.1 that wasn't required previously?
A manifest entry perhaps?
Permissions?
Is there problem with caching the stream that requires special permissions that i need to assign?
Is there a particular version of the Android SDK that I need to be using with 5.1.1?

Or is this this a bug in b4a (my experience with b4a has been really good, so that would be a long shot)?
This one has me stumped so far ... would appreciate some help!
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
I've had nothing but trouble with the default Android MediaPlayer and its limited ability to play all file types. Your problem maybe the same as discussed here...
http://stackoverflow.com/questions/...mly-stops-on-android-4-4-19/20713956#20713956
My solution is to use an intent and let the user choose they're own media player to use. If they check the default box then it will always play using the selected player and so it's not much of a hindrance, I recommend MX Player (I have no affiliation with this programming!). Only down side is that it leaves your App whilst playing the movie.
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
I should clarify that the only files I play with the MediaPlayerStream are mp3 and flac audio files.
Until version 5.1.1 I have been able to do everything I need to with no real problems.
I'm not even sure how I would use an intent for this particular app. I did see the comment in the link you provided that says:
"One thing I remember running into though was that Android 5+ was using an experimental media player. I believe this can be unset in the Developer Options of the phone."
I'll look into that and see if I can find the option.
Update: The "old" player is the default one on my S2. Tried both anyway, without success.
 
Last edited:
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
Erel the streams are "internal" to my NAS.
But it turns out that while the older versions of Android forgave my inclusions of spaces in the URL, 5.1.1 does not!
So I substituted %20 characters for spaces in the file names, and now it works.

There are other problems from 5.1.1 that I will post in separate threads if I can't find solutions.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…