我有一个PlayerView
,在纵向方向上占据了Activity的上半部分,下半部分显示一些文本。
我需要将控制器置于视频下方,而不重叠视频内容(它始终会显示)。默认情况下,当用户触摸视频时,控制器出现在视频底部,覆盖视频的底部部分。在我的情况下,我需要控制器固定在视频下方,与视频内容没有交集。
我查看了SimpleExoPlayer
和PlayerView
APIs,但是没有找到任何可以这样做的方法。
问题:如何在 ExoPlayer 中将控制器放置在视频下方?
下面是布局的样子:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="@id/video_view"
android:scrollbars="vertical" />
</RelativeLayout>