Commit 6e9dea0f authored by Geoffrey Métais's avatar Geoffrey Métais

Disable Chromecast on Chromebooks

parent 142154e3
......@@ -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
......
......@@ -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 {
......
......@@ -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());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment