[Android] Change video from recommendation cards

Geoffrey Métais git at videolan.org
Thu Sep 3 17:45:39 CEST 2015


vlc-ports/android | branch: data-binding | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Sep  3 15:21:02 2015 +0200| [6f43885f65842fd8f87e64d5a428f93ad27d32eb] | committer: Geoffrey Métais

Change video from recommendation cards

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=6f43885f65842fd8f87e64d5a428f93ad27d32eb
---

 .../org/videolan/vlc/gui/video/VideoPlayerActivity.java    |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 9eaa36b..da26ba0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -507,6 +507,18 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             setRequestedOrientation(mScreenOrientationLock);
     }
 
+    @Override
+    protected void onNewIntent(Intent intent) {
+        setIntent(intent);
+        if (mPlaybackStarted) {
+            Uri uri = intent.hasExtra(PLAY_EXTRA_ITEM_LOCATION) ? (Uri) intent.getExtras().getParcelable(PLAY_EXTRA_ITEM_LOCATION) : intent.getData();
+            if (uri == null || uri.equals(mUri))
+                return;
+            stopPlayback();
+            startPlayback();
+        }
+    }
+
     @TargetApi(Build.VERSION_CODES.LOLLIPOP)
     @Override
     protected void onPause() {



More information about the Android mailing list