Akh*_*thi 3 video android exoplayer visibilitychange exoplayer2.x
如图和视频所示,我在使用样式化播放器视图时遇到问题。
我已将controllerShowTimeoutMs 设置为2 秒,但我得到的结果如下图所示...
或者如本视频中... YouTube 链接
当控制器在 2 秒内没有收到任何输入时,播放器的默认时间栏的可见性将会更改。
2 秒后,所有控件的可见性再次发生变化。
我想让所有控件在两秒钟内同时消失。
我尝试检查很多事情,但找不到问题的原因......
下面是 Exoplayer 的 XML 代码
<com.google.android.exoplayer2.ui.StyledPlayerView
android:id="@+id/home_exoplayer_view"
android:layout_width="match_parent"
android:layout_height="0dp"
app:controller_layout_id="@layout/exo_control_layout_main"
app:layout_constraintDimensionRatio="16:9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:shutter_background_color="?colorTextBackgroundBlack"
app:use_controller="true"
app:show_buffering="always"
app:player_layout_id="@layout/exo_player_layout_main"
/>
Run Code Online (Sandbox Code Playgroud)
而在我的片段中
//Autohide controller in below Mili seconds unless the user taps
exoPlayerView.controllerShowTimeoutMs = 2000
//Don't show controller when playback starts
exoPlayerView.controllerAutoShow = false
Run Code Online (Sandbox Code Playgroud)
小智 7
简单的解决方法是禁用动画。就像这样
<com.google.android.exoplayer2.ui.StyledPlayerView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:animation_enabled="false" />
Run Code Online (Sandbox Code Playgroud)
更多细节请参见 StyledPlayerControlViewLayoutManager.hide()
归档时间: |
|
查看次数: |
1315 次 |
最近记录: |