[Android] [PATCH 2/4] AudioService: Start video based on MediaParsedEvent
Thomas Guillem
thomas at gllm.fr
Wed Jan 21 17:33:12 CET 2015
Temporary solution until we find something better.
---
vlc-android/src/org/videolan/vlc/audio/AudioService.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/audio/AudioService.java b/vlc-android/src/org/videolan/vlc/audio/AudioService.java
index 694ccde..08bf35b 100644
--- a/vlc-android/src/org/videolan/vlc/audio/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/audio/AudioService.java
@@ -460,6 +460,11 @@ public class AudioService extends Service {
switch (msg.getData().getInt("event")) {
case EventHandler.MediaParsedChanged:
Log.i(TAG, "MediaParsedChanged");
+ /* XXX: using EventHandler.MediaPlayerVout is not possible
+ * yet since this event won't be received if
+ * VideoPlayerActivity is not created. */
+ if (service.mLibVLC.getVideoTracksCount() >= 1)
+ service.handleVout();
break;
case EventHandler.MediaPlayerPlaying:
Log.i(TAG, "MediaPlayerPlaying");
@@ -613,10 +618,7 @@ public class AudioService extends Service {
String title = getCurrentMedia().getTitle();
String MRL = mMediaListPlayer.getMediaList().getMRL(mCurrentIndex);
int index = mCurrentIndex;
- mCurrentIndex = -1;
- mEventHandler.removeHandler(mVlcEventHandler);
- // Preserve playback when switching to video
- hideNotification(false);
+ stop();
// Switch to the video player & don't lose the currently playing stream
VideoPlayerActivity.start(VLCApplication.getAppContext(), MRL, title, index, false, true);
--
2.1.3
More information about the Android
mailing list