我正在使用下面的方法将mini_控制器集成到我的chromecast应用程序中。但是,我总是看到progressbar而不是mini controller中的pause/play按钮。
<fragment
android:id="@+id/cast_mini_controller"
class="com.google.android.gms.cast.framework.media.widget.MiniControllerFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:castControlButtons="@array/cast_mini_controller_control_buttons"
app:castProgressBarColor="@color/colorPrimary"
app:castShowImageThumbnail="true" />
有谁能提出可能的问题吗?
我试了很多文章,但没有一篇能解决这个问题。一切正常,除了我不能通过我的应用程序中的迷你控制器暂停Chromecast视频,因为它总是显示ProgressBar。
注意:我的应用程序正在使用排队机制以便一次加载视频块。
最佳答案
确保为片段指定了正确的按钮集:
<array name="cast_mini_controller_control_buttons">
<item>@id/cast_button_type_rewind_30_seconds</item>
<item>@id/cast_button_type_play_pause_toggle</item>
<item>@id/cast_button_type_forward_30_seconds</item>
</array>