直播间闪烁问题

This commit is contained in:
18401019693 2022-11-30 17:37:20 +08:00
parent 9a1cefdb70
commit 70b05b85d7
21 changed files with 84 additions and 20 deletions

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@drawable/loading_00000"
android:duration="100" />
<item
android:drawable="@drawable/loading_00001"
android:duration="100" />
<item
android:drawable="@drawable/loading_00002"
android:duration="100" />
<item
android:drawable="@drawable/loading_00003"
android:duration="100" />
<item
android:drawable="@drawable/loading_00004"
android:duration="100" />
<item
android:drawable="@drawable/loading_00005"
android:duration="100" />
<item
android:drawable="@drawable/loading_00006"
android:duration="100" />
<item
android:drawable="@drawable/loading_00007"
android:duration="100" />
<item
android:drawable="@drawable/loading_00008"
android:duration="100" />
<item
android:drawable="@drawable/loading_00009"
android:duration="100" />
<item
android:drawable="@drawable/loading_00010"
android:duration="100" />
<item
android:drawable="@drawable/loading_00011"
android:duration="100" />
<item
android:drawable="@drawable/loading_00012"
android:duration="100" />
<item
android:drawable="@drawable/loading_00013"
android:duration="100" />
<item
android:drawable="@drawable/loading_00014"
android:duration="100" />
<item
android:drawable="@drawable/loading_00015"
android:duration="100" />
</animation-list>

View File

@ -55,7 +55,6 @@ public class VerticalPagerAdapter extends androidx.viewpager.widget.PagerAdapter
ImageView ivLoading = view.findViewById(R.id.iv_loading);
AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
frameAnimation.start();
// ImgLoader.displayGif(mContext, R.drawable.live_loading, ivLoading);
view.setId(position);
container.addView(view);
return view;
@ -63,6 +62,7 @@ public class VerticalPagerAdapter extends androidx.viewpager.widget.PagerAdapter
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView(container.findViewById(position));
// container.removeView(container.findViewById(position));
}
}

View File

@ -32,6 +32,7 @@ import com.tencent.live2.V2TXLivePlayer;
import com.tencent.live2.V2TXLivePlayerObserver;
import com.tencent.live2.impl.V2TXLivePlayerImpl;
import com.tencent.rtmp.ui.TXCloudVideoView;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient;
import com.yunbao.common.utils.DialogUitl;
@ -164,13 +165,14 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
public void hideCover() {
// if (mCover != null) {
// if (mCover.getVisibility()==View.VISIBLE){
// new Handler().postDelayed(new Runnable() {
// @Override
// public void run() {
// mCover.setVisibility(View.GONE);
// mLoading2.setVisibility(View.GONE);
// }
// },200);
//// new Handler().postDelayed(new Runnable() {
//// @Override
//// public void run() {
////
//// }
//// },200);
// mCover.setVisibility(View.GONE);
// mLoading2.setVisibility(View.GONE);
// }
//
//

View File

@ -6,6 +6,7 @@ import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.drawable.AnimationDrawable;
import android.os.CountDownTimer;
import android.os.Handler;
import android.text.TextUtils;
@ -59,7 +60,6 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.utils.formatBigNum;
import com.yunbao.common.views.weight.LiveFloatView;
import com.yunbao.common.views.weight.LiveLoadingViewHolder;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAudienceActivity;
@ -125,7 +125,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
private ImageView btnSmallScreen;
private Intent mIntent;
//直播间背景
private ImageView liveBack;
private ImageView liveBack, ivBg, ivLoading;
private View mask;
//侧滑布局
@ -183,6 +183,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
private boolean isEnterRoom = false;
private boolean kick = false;
private View loading;
public PortraitLiveManager setQuitF(boolean quitF) {
isQuitF = quitF;
return this;
@ -204,6 +206,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
playContainer = mRootContainer.findViewById(R.id.play_container);
mViewPager = mRootContainer.findViewById(R.id.viewPager);
btnSmallScreen = mRootContainer.findViewById(R.id.btn_small_screen);
loading = mRootContainer.findViewById(R.id.loading);
ivBg = mRootContainer.findViewById(R.id.iv_bg);
ivLoading = mRootContainer.findViewById(R.id.iv_loading);
mSecondPage = (ViewGroup) LayoutInflater.from(mContext).inflate(R.layout.view_audience_page, mViewPager, false);
mContainerWrap = mSecondPage.findViewById(R.id.container_wrap);
mContainer = mSecondPage.findViewById(R.id.container);
@ -253,6 +258,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
.setParametersModel(openParametersModel
.setmLiveType(mLiveType)
.setmLiveTypeVal(mLiveTypeVal)));
loading.setVisibility(View.VISIBLE);
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), ivBg);
AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
frameAnimation.start();
if (mLivePlayViewHolder == null) {
mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, 1);
mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager());
@ -279,8 +288,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
LivePlayRyViewHolder.leave.setVisibility(View.GONE);
}
//直播间背景
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack, 400, 600);
//ImageLoadUtils.loadUrlToBlur(mContext,mLiveBean.getAvatar(),400,600,liveBack);
mask.setVisibility(View.VISIBLE);
mLivePlayViewHolder.setLiveBean(mLiveBean);
mLivePlayViewHolder.setCover(mLiveBean.getAvatar());
@ -333,12 +343,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
public void onSuccess(EnterRoomNewModel data) {
mLivePlayViewHolder.setLiveBeanLandscape(data.getLiveInfo().getLandscape());
//是否热度卡加成
liveHandler.postDelayed(new Runnable() {
@Override
public void run() {
mLiveRoomViewHolder.getIsHot(data.getIsUseHotCard());
}
}, 700);
liveHandler.postDelayed(() -> mLiveRoomViewHolder.getIsHot(data.getIsUseHotCard()), 700);
isEnterRoom = true;
//延时1秒发送
@ -547,6 +552,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel));
}
}
liveHandler.postDelayed(() -> loading.setVisibility(View.GONE),700);
}
@ -874,7 +880,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
@Override
public void onCancel() {
// ((LiveAudienceActivity) mContext).setEnableScroll(true);
// ((LiveAudienceActivity) mContext).setEnableScroll(true);
}
});

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.yunbao.common.views.weight.MyDrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -53,6 +52,9 @@
android:visibility="gone" />
</FrameLayout>
<include
android:id="@+id/loading"
layout="@layout/layout_portrait_live_item" />
</com.yunbao.common.views.weight.MyDrawerLayout>