如何解决如何在exoplayer中显示和隐藏自定义控制器
我的exoplayer具有以下子组件
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/id_exo_player_view"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@android:color/darker_gray"
android:src="@android:drawable/ic_media_play"
app:controller_layout_id="@layout/custom_exoplayer_controller"
app:fastforward_increment="5000"
app:resize_mode="fixed_height"
app:rewind_increment="5000"
app:show_buffering="when_playing"
app:use_controller="true">
...
...
<ImageButton
android:id="@+id/idExoVolumeUp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="100dp"
android:background="#00000000"
android:src="@drawable/exo_controls_rewind"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
...
...
</com.google.android.exoplayer2.ui.PlayerView>
我有一个自定义布局,以显示进度条,并且仅在默认实现下播放/暂停。
custom_exoplayer_controller.xml
<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:id="@+id/id_exo_custom_controller"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/progressbar_layout"
...
...
...
</androidx.constraintlayout.widget.ConstraintLayout>
问题是由于子组件而我点击屏幕时,custom_exoplayer_controller.xml
组件未显示,其中有播放/暂停和进度/搜索栏组件,并且使用了exoplayer默认ID。
因此,我需要一种在单击任何按钮时在exoplayer中显示/隐藏自定义组件的方法。有可能吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。