[Android] AudioService: warn if the location cannot be played
Ludovic Fauvet
git at videolan.org
Wed May 22 16:04:34 CEST 2013
vlc-ports/android | branch: master | Ludovic Fauvet <etix at videolan.org> | Wed May 22 15:59:08 2013 +0200| [82fae8a2dcf7bd908b09a5ceb8685a38e78ff84f] | committer: Ludovic Fauvet
AudioService: warn if the location cannot be played
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=82fae8a2dcf7bd908b09a5ceb8685a38e78ff84f
---
vlc-android/src/org/videolan/vlc/AudioService.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index 19b9e8c..33b08af 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -432,6 +432,14 @@ public class AudioService extends Service {
float pos = msg.getData().getFloat("data");
service.updateWidgetPosition(service, pos);
break;
+ case EventHandler.MediaPlayerEncounteredError:
+ showToast(VLCApplication.getAppContext().getString(R.string.invalid_location,
+ service.mCurrentMedia.getLocation()), Toast.LENGTH_SHORT);
+ service.executeUpdate();
+ service.next();
+ if (service.mWakeLock.isHeld())
+ service.mWakeLock.release();
+ break;
default:
Log.e(TAG, "Event not handled");
break;
@@ -1131,7 +1139,7 @@ public class AudioService extends Service {
return true;
}
- private void showToast(String text, int duration) {
+ private static void showToast(String text, int duration) {
Message msg = new Message();
Bundle bundle = new Bundle();
bundle.putString("text", text);
More information about the Android
mailing list