外线玩家自定义叠加层



我正在使用ExoPlayer作为我的应用程序的播放器。我已经看到他们提供了一堆随时可用的播放器控件,这些控件在某种程度上是可定制的,这符合我的兴趣。

但是,我的应用程序有一堆其他自定义控件(即记分牌(,我想自己更新。因此,如果我使用外星玩家自定义:

<com.google.android.exoplayer2.ui.SimpleExoPlayerView android:id="@+id/player"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent"
app:controller_layout_id="@layout/custom_controls"/>

我把我的记分牌放在这个布局中,我无法以编程方式获取这些控件来更新它们(或者至少我没有看到任何getPlaybackControlsgetController方法(。

我想利用内置计时器、播放/暂停控件、时间栏等。

在尝试理解 pskink 所说的话之后,如果您使用 app:controller_layout_id 并为 SimpleExoPlayerView 指定 PlaybackControlView,则可以通过使用 SimpleExoPlayerView 实例本身的 findViewById 来获取任何元素,例如播放、暂停、重复切换 ImageButtons,而不是尝试膨胀表示 PlaybackControlView 的 xml。

最新更新