Added a sleep timer
This commit is contained in:
parent
b5f160dd89
commit
4d82b91465
25 changed files with 350 additions and 47 deletions
|
|
@ -210,6 +210,9 @@ public class MultiPlayer implements MediaPlayer.OnErrorListener,
|
|||
* @return The duration in milliseconds
|
||||
*/
|
||||
public int duration() {
|
||||
if (!mIsInitialized) {
|
||||
return -1;
|
||||
}
|
||||
try {
|
||||
return mCurrentMediaPlayer.getDuration();
|
||||
} catch (IllegalStateException e) {
|
||||
|
|
@ -223,6 +226,9 @@ public class MultiPlayer implements MediaPlayer.OnErrorListener,
|
|||
* @return The current position in milliseconds
|
||||
*/
|
||||
public int position() {
|
||||
if (!mIsInitialized) {
|
||||
return -1;
|
||||
}
|
||||
try {
|
||||
return mCurrentMediaPlayer.getCurrentPosition();
|
||||
} catch (IllegalStateException e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue