[Android] PlaybackService: never show audio player when video player is active
Thomas Guillem
git at videolan.org
Fri Jul 10 20:59:43 CEST 2015
vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jul 10 20:59:27 2015 +0200| [790db062cc1cdc361d1818726b289d8073a2ee66] | committer: Thomas Guillem
PlaybackService: never show audio player when video player is active
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=790db062cc1cdc361d1818726b289d8073a2ee66
---
vlc-android/src/org/videolan/vlc/PlaybackService.java | 5 +++++
vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 2d1cbb4..391dd95 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1379,6 +1379,11 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
}
@MainThread
+ public boolean isVideoPlaying() {
+ return mMediaPlayer.getVLCVout().areViewsAttached();
+ }
+
+ @MainThread
public String getAlbum() {
if (hasCurrentMedia())
return Util.getMediaAlbum(PlaybackService.this, getCurrentMedia());
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
index 3499c30..e4eacbc 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java
@@ -325,7 +325,7 @@ public class AudioPlayer extends PlaybackServiceFragment implements PlaybackServ
if (mService == null || getActivity() == null)
return;
- if (mService.hasMedia()) {
+ if (mService.hasMedia() && !mService.isVideoPlaying()) {
SharedPreferences mSettings= PreferenceManager.getDefaultSharedPreferences(getActivity());
if (mSettings.getBoolean(PreferencesActivity.VIDEO_RESTORE, false)){
Util.commitPreferences(mSettings.edit().putBoolean(PreferencesActivity.VIDEO_RESTORE, false));
More information about the Android
mailing list