Added a sleep timer

This commit is contained in:
Karim Abou Zeid 2015-07-08 01:16:19 +02:00
commit 4d82b91465
25 changed files with 350 additions and 47 deletions

View file

@ -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) {