Commit afc6b8df authored by Geoffrey Métais's avatar Geoffrey Métais

No Renderer change in player before Android 17

parent 95dc8f88
......@@ -17,15 +17,6 @@
android:textColor="@color/white"
android:textSize="15sp" />
<ImageView
android:id="@+id/video_renderer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_am_renderer_normal_w"
android:focusable="true"
android:visibility="gone"/>
<TextView
android:id="@+id/player_overlay_battery"
android:layout_width="wrap_content"
......
......@@ -51,7 +51,7 @@ class DisplayManager(private val activity: Activity, cloneMode: Boolean) : Rende
}
init {
presentation = createPresentation(cloneMode)
presentation = if (AndroidUtil.isJellyBeanMR1OrLater) createPresentation(cloneMode) else null
rendererItem = RendererDelegate.selectedRenderer
displayType = getCurrentType()
RendererDelegate.addPlayerListener(this)
......@@ -69,7 +69,7 @@ class DisplayManager(private val activity: Activity, cloneMode: Boolean) : Rende
}
private fun updateDisplayType() {
if (getCurrentType() != displayType) activity.recreate()
if (getCurrentType() != displayType && activity is VideoPlayerActivity) activity.recreate()
}
private fun getCurrentType() = when {
......
......@@ -954,8 +954,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
}
private static void start(Context context, Uri uri, String title, boolean fromStart, int openedPosition) {
Intent intent = getIntent(context, uri, title, fromStart, openedPosition);
final Intent intent = getIntent(context, uri, title, fromStart, openedPosition);
context.startActivity(intent);
}
......@@ -2828,9 +2827,11 @@ 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);
mRendererBtn = (ImageView) findViewById(R.id.video_renderer);
onRenderersChanged(RendererDelegate.INSTANCE.getRenderers().isEmpty());
onRendererChanged(RendererDelegate.INSTANCE.getSelectedRenderer());
if (AndroidUtil.isJellyBeanMR1OrLater) {
mRendererBtn = (ImageView) findViewById(R.id.video_renderer);
onRenderersChanged(RendererDelegate.INSTANCE.getRenderers().isEmpty());
onRendererChanged(RendererDelegate.INSTANCE.getSelectedRenderer());
}
if (mSeekButtons) initSeekButton();
resetHudLayout();
updateOverlayPausePlay();
......
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