11package com .kk .taurus .avplayer .adapter ;
22
3- import android .graphics . Rect ;
3+ import android .os . Build ;
44import android .view .View ;
55import android .view .ViewGroup ;
66import android .widget .TextView ;
1111
1212import com .kk .taurus .avplayer .R ;
1313import com .kk .taurus .avplayer .bean .RecyclerBaseVideoBean ;
14+ import com .kk .taurus .avplayer .cover .LoadingCover ;
1415import com .kk .taurus .playerbase .entity .DataSource ;
15- import com .kk .taurus .playerbase .render . AspectRatio ;
16+ import com .kk .taurus .playerbase .receiver . ReceiverGroup ;
1617import com .kk .taurus .playerbase .widget .BaseVideoView ;
1718
1819import java .util .List ;
1920
21+ import static com .kk .taurus .avplayer .play .DataInter .ReceiverKey .KEY_LOADING_COVER ;
22+
2023/**
2124 * @author KaraShokZ (张耀中)
2225 * DESCRIPTION
@@ -32,6 +35,11 @@ public RecyclerBaseVideoContentAdapter(List<RecyclerBaseVideoBean> dataList) {
3235 this .dataList = dataList ;
3336 }
3437
38+ public void onDestroy (){
39+ if (typeLiveVideoBvv !=null )
40+ typeLiveVideoBvv .stopPlayback ();
41+ }
42+
3543 @ NonNull
3644 @ Override
3745 public BaseViewHolder onCreateViewHolder (@ NonNull ViewGroup parent , int viewType ) {
@@ -54,9 +62,11 @@ public void onBindViewHolder(@NonNull BaseViewHolder holder, int position) {
5462 if (bean .itemType == 1 ){
5563 if (typeLiveVideoBvv == null ){
5664 typeLiveVideoBvv = holder .getView (R .id .activity_recycler_base_video_type_video_bvv );
57- typeLiveVideoBvv .setOvalRectShape ();
58- // typeLiveVideoBvv.setRoundRectShape(30);
59- typeLiveVideoBvv .setAspectRatio (AspectRatio .AspectRatio_MATCH_PARENT );
65+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP )
66+ typeLiveVideoBvv .setRoundRectShape (30 );
67+ ReceiverGroup receiverGroup = new ReceiverGroup ();
68+ receiverGroup .addReceiver (KEY_LOADING_COVER , new LoadingCover (typeLiveVideoBvv .getContext ()));
69+ typeLiveVideoBvv .setReceiverGroup (receiverGroup );
6070 typeLiveVideoBvv .setDataSource (new DataSource (bean .videoUrl ));
6171 typeLiveVideoBvv .start ();
6272 }
0 commit comments