|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.media.AsyncPlayer
public class AsyncPlayer
Plays a series of audio URIs, but does all the hard work on another thread so that any slowness with preparing or loading doesn't block the calling thread.
| Constructor Summary | |
|---|---|
AsyncPlayer(String tag)
Construct an AsyncPlayer object. |
|
| Method Summary | |
|---|---|
void |
play(Context context,
Uri uri,
boolean looping,
int stream)
Start playing the sound. |
void |
setUsesWakeLock(Context context)
We want to hold a wake lock while we do the prepare and play. |
void |
stop()
Stop a previously played sound. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsyncPlayer(String tag)
tag - a string to use for debugging| Method Detail |
|---|
public void play(Context context,
Uri uri,
boolean looping,
int stream)
context - Your application's context.uri - The URI to play. (see MediaPlayer.setDataSource(Context, Uri))looping - Whether the audio should loop forever.
(see MediaPlayer.setLooping(boolean))stream - the AudioStream to use.
(see MediaPlayer.setAudioStreamType(int))public void stop()
public void setUsesWakeLock(Context context)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||