Improved error handling in MediaPlayerActivity
This commit is contained in:
parent
aba5568176
commit
69f424e71c
@ -3,6 +3,7 @@ package de.danoeh.antennapod.util.playback;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.*;
|
import android.content.*;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
|
import android.media.MediaPlayer;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
@ -415,6 +416,7 @@ public abstract class PlaybackController {
|
|||||||
|
|
||||||
case ERROR:
|
case ERROR:
|
||||||
postStatusMsg(R.string.player_error_msg);
|
postStatusMsg(R.string.player_error_msg);
|
||||||
|
handleError(MediaPlayer.MEDIA_ERROR_UNKNOWN);
|
||||||
break;
|
break;
|
||||||
case PAUSED:
|
case PAUSED:
|
||||||
clearStatusMsg();
|
clearStatusMsg();
|
||||||
@ -520,7 +522,7 @@ public abstract class PlaybackController {
|
|||||||
*/
|
*/
|
||||||
public float onSeekBarProgressChanged(SeekBar seekBar, int progress,
|
public float onSeekBarProgressChanged(SeekBar seekBar, int progress,
|
||||||
boolean fromUser, TextView txtvPosition) {
|
boolean fromUser, TextView txtvPosition) {
|
||||||
if (fromUser && playbackService != null) {
|
if (fromUser && playbackService != null && media != null) {
|
||||||
float prog = progress / ((float) seekBar.getMax());
|
float prog = progress / ((float) seekBar.getMax());
|
||||||
int duration = media.getDuration();
|
int duration = media.getDuration();
|
||||||
txtvPosition.setText(Converter
|
txtvPosition.setText(Converter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user