Should MediaPlayer.start () also be a new stream?

This guide explains that the service actually uses the main thread. Therefore, it uses prepareAsync to avoid blocking UIS: http://developer.android.com/guide/topics/media/mediaplayer.html#asyncprepare

I was wondering where the async onPrepared . In the onPrepared example, a call to MediaPlayer begins. Does the intense processor also start? If it works in the same thread, it also blocks.

+6
source share
1 answer

MediaPlayer.start() is not an intensive operation. MediaPlayer uses its own native stream to perform tasks, but calling the synchronous prepare method may take too long for the user interface stream, especially if it is the remote medium you are trying to play. In this case, it must wait for one or more network requests, data for the buffer, etc. The onPrepared will occur in the main thread if this is where you called prepareAsync (or any thread from which you called it, more precisely).

+3
source

All Articles