public final class SimpleMedia extends Object
SimpleMedia.with(this).play(R.raw.mysong);
| Modifier and Type | Method and Description |
|---|---|
int |
getPosition(int id)
Returns the time position in milliseconds for the media clip with the given ID if it is playing.
|
boolean |
isLooping(int id)
Returns whether the media clip with the given ID is currently playing in 'loop' mode.
|
boolean |
isPlaying(int id)
Returns whether the media clip with the given ID is currently playing or looping.
|
SimpleMedia |
loop(int id)
Plays the media clip with the given ID in 'looping' mode.
|
SimpleMedia |
pause(int id)
Pauses the media clip with the given ID if it is playing.
|
SimpleMedia |
play(int id)
Plays the media clip with the given ID.
|
SimpleMedia |
setPosition(int id,
int position)
Sets the time position in milliseconds for the media clip with the given ID.
|
SimpleMedia |
stop(int id)
Stops the media clip with the given ID if it was playing.
|
static SimpleMedia |
with(Context context)
Returns a singleton SimpleMedia instance bound to the given context.
|
static SimpleMedia |
with(View context)
Returns a singleton SimpleMedia instance bound to the given view's context.
|
public static SimpleMedia with(Context context)
public static SimpleMedia with(View context)
public boolean isLooping(@RawRes int id)
public boolean isPlaying(@RawRes int id)
public SimpleMedia loop(@RawRes int id)
public SimpleMedia play(@RawRes int id)
public SimpleMedia pause(@RawRes int id)
public int getPosition(@RawRes int id)
public SimpleMedia setPosition(@RawRes int id, int position)
public SimpleMedia stop(@RawRes int id)