[Android] Command UI update in events listener
Geoffrey Métais
git at videolan.org
Mon Nov 7 16:07:11 CET 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Nov 7 15:56:27 2016 +0100| [c4ad53aa021461a3c01d50269a09d8598fc43757] | committer: Geoffrey Métais
Command UI update in events listener
> https://code.videolan.org/videolan/vlc-android/commit/c4ad53aa021461a3c01d50269a09d8598fc43757
---
vlc-android/src/org/videolan/vlc/PlaybackService.java | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index f7b37e6..b38af38 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -577,6 +577,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
executeUpdate();
publishState(event.type);
executeUpdateProgress();
+ mHandler.sendEmptyMessage(SHOW_PROGRESS);
final MediaWrapper mw = mMediaList.getMedia(mCurrentIndex);
if (mw != null) {
@@ -611,6 +612,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
publishState(event.type);
executeUpdateProgress();
showNotification();
+ mHandler.removeMessages(SHOW_PROGRESS);
if (mWakeLock.isHeld())
mWakeLock.release();
break;
@@ -928,22 +930,14 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
public void pause() {
if (mPausable) {
savePosition();
- mHandler.removeMessages(SHOW_PROGRESS);
- // hideNotification(); <-- see event handler
mMediaPlayer.pause();
- broadcastMetadata();
}
}
@MainThread
public void play() {
- if(hasCurrentMedia()) {
+ if (hasCurrentMedia())
mMediaPlayer.play();
- mHandler.sendEmptyMessage(SHOW_PROGRESS);
- updateMetadata();
- updateWidget();
- broadcastMetadata();
- }
}
@MainThread
More information about the Android
mailing list