Skip to content

can't set elevation when use two StyledPlayerView in android 7 #10424

@sajjadshahbazi

Description

@sajjadshahbazi

ExoPlayer Version

2.17.1

Devices that reproduce the issue

  • any devices of android 7

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

I have two StyledPlayerView, which one of them for the main video and another for the playback advertisement.
while playing the main movie we want to play an advertisement over the main film(when playing the advertisement we paused the main video), but the StyledPlayerView of the advertisement playing behind the StyledPlayerView of the main video in the android 7 version, while on another android device is correct. To solve this problem I became changed the visibility of StyledPlayerViews, which came a new problem on all android versions.
the new problem is: change the bottom margin after any time gone and visible StyledPlayerView of the main video, while I don't have logic for change margins.

please guide me

Expected result

I expect to StyledPlayerView of advertisement over StyledPlayerView of the mani video in all android versions.

Actual result

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/motionLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:keepScreenOn="true"
    android:layoutDirection="rtl"
    app:layoutDescription="@xml/activity_tv_media_player_scene"
    tools:context=".mediaPlayer.player.TvVideoPlayerActivity">

    <com.google.android.exoplayer2.ui.StyledPlayerView
        android:id="@+id/playerView"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:background="@color/black"
        app:animation_enabled="false"
        app:controller_layout_id="@layout/exo_playback_control_view"
        app:hide_during_ads="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:resize_mode="fit"
        app:show_buffering="never" />

    ...
    
        <com.google.android.exoplayer2.ui.StyledPlayerView
        android:id="@+id/playerAdView"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:background="@color/black"
        android:focusable="true"
        app:animation_enabled="false"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:resize_mode="fit"
        app:show_buffering="never"
        app:use_controller="false"
        />


</androidx.constraintlayout.motion.widget.MotionLayout>

exo_playback_control_view :

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layoutDirection="rtl"
    android:elevation="10dp"
    >

   ... 
   
    <com.google.android.exoplayer2.ui.DefaultTimeBar
        android:id="@id/exo_progress"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/playerSpaceHorizontalTimeBarOfController"
        android:layout_marginEnd="@dimen/playerSpaceHorizontalTimeBarOfController"
        android:layout_marginBottom="@dimen/playerSpaceBottomTimeBarOfController"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:played_color="@color/white"
        app:scrubber_color="@color/blue"
        app:scrubber_drawable="@drawable/seekerbar_thumb"
        android:nextFocusDown="@id/exo_pause"
        app:scrubber_dragged_size="2dp"
        app:scrubber_enabled_size="1dp"
        app:animation_enabled="false"
        />

</androidx.constraintlayout.widget.ConstraintLayout>

Media

vmap link : https://castqqq.free.beeceptor.com/test01

the main video has a token that has expired time.

Bug Report

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions