[Android] Video Player: Reset uri & fix playlist reloading
Geoffrey Métais
git at videolan.org
Thu Jan 10 10:00:21 CET 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan 10 09:51:37 2019 +0100| [0569850dbbd5463b0910595124e0276b50d17494] | committer: Geoffrey Métais
Video Player: Reset uri & fix playlist reloading
Set mUri to null when activity is stopped to retrieve the saved one.
And don't retrieve any in case of playlist
Fix #714
> https://code.videolan.org/videolan/vlc-android/commit/0569850dbbd5463b0910595124e0276b50d17494
---
.../videolan/vlc/gui/video/VideoPlayerActivity.java | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
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 14a8184e1..01f64f0b7 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -419,7 +419,6 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
mOrientationToggle.setOnClickListener(enabled ? this : null);
mOrientationToggle.setOnLongClickListener(enabled ? this : null);
}
-
UiTools.setViewOnClickListener(mRendererBtn, enabled ? this : null);
}
@@ -433,10 +432,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
return;
if (TextUtils.equals("file", uri.getScheme()) && uri.getPath().startsWith("/sdcard")) {
Uri convertedUri = FileUtils.convertLocalUri(uri);
- if (convertedUri == null || convertedUri.equals(mUri))
- return;
- else
- uri = convertedUri;
+ if (convertedUri == null || convertedUri.equals(mUri)) return;
+ else uri = convertedUri;
}
mUri = uri;
mTitle.setText(mService.getCurrentMediaWrapper().getTitle());
@@ -456,10 +453,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
protected void onPause() {
- if (isFinishing())
- overridePendingTransition(0, 0);
- else
- hideOverlay(true);
+ if (isFinishing()) overridePendingTransition(0, 0);
+ else hideOverlay(true);
super.onPause();
setListeners(false);
@@ -481,11 +476,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
super.onSaveInstanceState(outState);
if (mUri != null && !"content".equals(mUri.getScheme())) {
outState.putLong(KEY_TIME, mSavedTime);
- outState.putParcelable(KEY_URI, mUri);
+ if (mPlaylistModel == null) outState.putParcelable(KEY_URI, mUri);
}
+ mUri = null;
}
- @TargetApi(Build.VERSION_CODES.N)
+ @TargetApi(Build.VERSION_CODES.O)
public void switchToPopup() {
final MediaWrapper mw = mService != null ? mService.getCurrentMediaWrapper() : null;
if (mw == null) return;
@@ -511,8 +507,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
mw.addFlags(MediaWrapper.MEDIA_PAUSED);
cleanUI();
exitOK();
- } else
- Permissions.checkDrawOverlaysPermission(this);
+ } else Permissions.checkDrawOverlaysPermission(this);
}
}
More information about the Android
mailing list