[Android] Disable Chromecast on Chromebooks
Geoffrey Métais
git at videolan.org
Wed Mar 7 15:00:27 CET 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Mar 7 10:55:57 2018 +0100| [6e9dea0f0a26b046434d93d4c4979e1e901dbf91] | committer: Geoffrey Métais
Disable Chromecast on Chromebooks
> https://code.videolan.org/videolan/vlc-android/commit/6e9dea0f0a26b046434d93d4c4979e1e901dbf91
---
vlc-android/src/org/videolan/vlc/gui/ContentActivity.java | 15 ++++++++++-----
.../src/org/videolan/vlc/gui/video/DisplayManager.kt | 5 +++--
.../org/videolan/vlc/gui/video/VideoPlayerActivity.java | 2 +-
3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/ContentActivity.java b/vlc-android/src/org/videolan/vlc/gui/ContentActivity.java
index 2f8fc94b4..d01a698b5 100644
--- a/vlc-android/src/org/videolan/vlc/gui/ContentActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/ContentActivity.java
@@ -52,13 +52,14 @@ import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.gui.video.VideoGridFragment;
import org.videolan.vlc.interfaces.Filterable;
import org.videolan.vlc.media.MediaUtils;
+import org.videolan.vlc.util.AndroidDevices;
public class ContentActivity extends AudioPlayerContainerActivity implements SearchView.OnQueryTextListener, MenuItemCompat.OnActionExpandListener, RendererDelegate.RendererListener, RendererDelegate.RendererPlayer {
public static final String TAG = "VLC/ContentActivity";
protected Menu mMenu;
private SearchView mSearchView;
- private boolean showRenderers = !RendererDelegate.INSTANCE.getRenderers().isEmpty();
+ private boolean showRenderers = !AndroidDevices.isChromeBook && !RendererDelegate.INSTANCE.getRenderers().isEmpty();
@Override
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
@@ -123,15 +124,19 @@ public class ContentActivity extends AudioPlayerContainerActivity implements Sea
@Override
protected void onStart() {
super.onStart();
- RendererDelegate.INSTANCE.addListener(this);
- RendererDelegate.INSTANCE.addPlayerListener(this);
+ if (!AndroidDevices.isChromeBook) {
+ RendererDelegate.INSTANCE.addListener(this);
+ RendererDelegate.INSTANCE.addPlayerListener(this);
+ }
}
@Override
protected void onStop() {
super.onStop();
- RendererDelegate.INSTANCE.removeListener(this);
- RendererDelegate.INSTANCE.removePlayerListener(this);
+ if (!AndroidDevices.isChromeBook) {
+ RendererDelegate.INSTANCE.removeListener(this);
+ RendererDelegate.INSTANCE.removePlayerListener(this);
+ }
}
@Override
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/DisplayManager.kt b/vlc-android/src/org/videolan/vlc/gui/video/DisplayManager.kt
index 901032ce1..aacba91e7 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/DisplayManager.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/DisplayManager.kt
@@ -19,6 +19,7 @@ import org.videolan.libvlc.util.AndroidUtil
import org.videolan.vlc.BuildConfig
import org.videolan.vlc.R
import org.videolan.vlc.RendererDelegate
+import org.videolan.vlc.util.AndroidDevices
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
class DisplayManager(private val activity: Activity, cloneMode: Boolean) : RendererDelegate.RendererPlayer {
@@ -52,9 +53,9 @@ class DisplayManager(private val activity: Activity, cloneMode: Boolean) : Rende
init {
presentation = if (AndroidUtil.isJellyBeanMR1OrLater) createPresentation(cloneMode) else null
- rendererItem = RendererDelegate.selectedRenderer
+ rendererItem = if (!AndroidDevices.isChromeBook) RendererDelegate.selectedRenderer else null
displayType = getCurrentType()
- RendererDelegate.addPlayerListener(this)
+ if (!AndroidDevices.isChromeBook) RendererDelegate.addPlayerListener(this)
}
companion object {
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 8a3e66169..9accd4a29 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2835,7 +2835,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
mHudBinding.progressOverlay.setLayoutParams(layoutParams);
mOverlayBackground = findViewById(R.id.player_overlay_background);
mNavMenu = (ImageView) findViewById(R.id.player_overlay_navmenu);
- if (AndroidUtil.isJellyBeanMR1OrLater) {
+ if (!AndroidDevices.isChromeBook && AndroidUtil.isJellyBeanMR1OrLater) {
mRendererBtn = (ImageView) findViewById(R.id.video_renderer);
onRenderersChanged(RendererDelegate.INSTANCE.getRenderers().isEmpty());
onRendererChanged(RendererDelegate.INSTANCE.getSelectedRenderer());
More information about the Android
mailing list