[Android] TV: Leave video player if device is shut down
Geoffrey Métais
git at videolan.org
Fri Jun 14 16:37:11 CEST 2019
vlc-android | branch: 3.1.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jun 14 16:32:52 2019 +0200| [cafc745da484a6918f684e8895c49ef5b0c6c6e9] | committer: Geoffrey Métais
TV: Leave video player if device is shut down
> https://code.videolan.org/videolan/vlc-android/commit/cafc745da484a6918f684e8895c49ef5b0c6c6e9
---
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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 cdd45007a..5365ff162 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -764,11 +764,14 @@ public class VideoPlayerActivity extends AppCompatActivity implements IPlaybackS
mPlaybackStarted = false;
return;
}
- mWasPaused = !mService.isPlaying() || (!AndroidDevices.showTvUi(this) && !isInteractive());
+ final boolean tv = AndroidDevices.showTvUi(this);
+ final boolean isInteractive = isInteractive();
+ mWasPaused = !mService.isPlaying() || (!tv && !isInteractive());
if (mWasPaused) mSettings.edit().putBoolean(PreferencesActivity.VIDEO_PAUSED, true).apply();
if (!isFinishing()) {
mCurrentAudioTrack = mService.getAudioTrack();
mCurrentSpuTrack = mService.getSpuTrack();
+ if (tv && !isInteractive) finish(); // Leave player on TV, restauration can be difficult
}
if (mMute) mute(false);
More information about the Android
mailing list