How to avoid 15 second delay/caching in Android Media Player when playing stream?

Try this. This will definatly help to you :: private class TouchandshowTask extends AsyncTask { @Override protected Void doInBackground(Void... arg0) { try { player. SetAudioStreamType(AudioManager.

STREAM_MUSIC); player. SetDataSource("URL"); player.prepare(); } catch (Exception e) { // TODO: handle exception } return null; } protected void onPostExecute(final Void unused) { } } OnCreate() new TouchandshowTask().execute().

Unfortunately that did not help. And even worse, I tried to turbocharge the transfer in the beginning to minimize the delay: I transferred the first megabyte (out of 3) in a second, and still it took > 10 seconds for it to start playing! No idea whats going on in there, but it doesn't feel like a caching problem.

– Daniel Oct 4 at 6:19 I have never face this problem I also get sound from server but not get any delay. I get 50 sound but never raise problem – Dr.nik Oct 4 at 6:21 When I simply stream a file from a server it works perfectly for me too. But once I am tuning into a stream there is the delay... – Daniel Oct 4 at 7:54.

Ok, meanwhile I got closer to the solution. Turned out the source of my problem is Android DRM! (No, I am not playing a protected file.

Its standard mp3). DRM seems to have been introduced in Android 3.1 (I was testing on a Galaxy Tab 10.1). It works fine on the Emulator (maybe DRM is not implemented there?) Any idea how I can disable or accelerate this?

There seems to be a 10 seconds timer somewhere deep in the Android DRM impl that waits for - whatever, no idea. My error log: 10-06 17:38:19.020: ERROR/MediaExtractor(226): **********MediaExtractor::Create 10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(226): add uniqueid 10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(225): Entering BnDrmManagerService::onTransact with code 1 10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(225): BnDrmManagerService::onTransact :ADD_UNIQUEID 10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(225): Entering BnDrmManagerService::onTransact with code 3 10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(225): BnDrmManagerService::onTransact :ADD_CLIENT 10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(226): Entering BpDrmManagerService::openDecryptSession 10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(225): Entering BnDrmManagerService::onTransact with code 27 10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(225): BnDrmManagerService::onTransact :OPEN_DECRYPT_SESSION_FROM_URI 10-06 17:38:19.020: ERROR/DrmManagerService(Native)(225): Entering DrmManagerService::openDecryptSession with uri 10 seconds wait 10-06 17:38:29.040: ERROR/DrmManager(Native)(225): DrmManager::openDecryptSession: no capable plug-in found 10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): NULL decryptHandle is returned 10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(226): no decryptHandle is generated in service side 10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(226): remove uniqueid 10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): Entering BnDrmManagerService::onTransact with code 2 10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): BnDrmManagerService::onTransact :REMOVE_UNIQUEID 10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): Entering BnDrmManagerService::onTransact with code 4 10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): BnDrmManagerService::onTransact :REMOVE_CLIENT 10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(226): setDrmServiceListener 10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): Entering BnDrmManagerService::onTransact with code 5 10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): BnDrmManagerService::onTransact :SET_DRM_SERVICE_LISTENER 10-06 17:38:29.040: ERROR/DrmManagerService(Native)(225): Entering setDrmServiceListener.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions