我正在开发一个使用exoplayer进行m3u8传输的应用程序,有时我的传输处于脱机状态,因此需要显示背景图像,因此我现在找不到解决此问题的选项。我唯一能找到的是定义背景播放器颜色的shutter_background_color属性,但这不能解决我的问题。我需要显示一个位图图像。
请帮忙!!!
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/pl_aovivo"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:resize_mode="fit"
app:use_artwork="true"
app:shutter_background_color="@color/colorPrimary" />
最佳答案
请勿为此使用艺术品。最好的办法是在承载PlayerView的布局内添加一个不可见的ImageView,并在出现onPlayerError时将其变为可见。