优化麦圈显示延迟,拍卖房麦位丢失。
This commit is contained in:
@@ -137,7 +137,7 @@ public class CommonAppContext extends MultiDexApplication implements Application
|
||||
@Getter
|
||||
public UnreadCountEvent unreadCountEvent;
|
||||
|
||||
public static int selectRelease = 1;
|
||||
public static int selectRelease = -1;
|
||||
|
||||
public int is_open = 0;//主题的开关
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ public class AgoraManager {
|
||||
private Disposable disposableC;
|
||||
|
||||
// UI 刷新最小间隔(ms)
|
||||
private static final long SOUND_UI_INTERVAL = 200;
|
||||
private static final long SOUND_UI_INTERVAL = 50;
|
||||
|
||||
private final Handler uiHandler = new Handler(Looper.getMainLooper());
|
||||
private long lastDispatchTime = 0;
|
||||
@@ -210,7 +210,7 @@ public class AgoraManager {
|
||||
try {
|
||||
rtcEngine.setAudioProfile(Constants.AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO,
|
||||
Constants.AUDIO_SCENARIO_GAME_STREAMING);
|
||||
rtcEngine.enableAudioVolumeIndication(200, 3, true);
|
||||
rtcEngine.enableAudioVolumeIndication(500, 3, true);
|
||||
rtcEngine.setClientRole(Constants.CLIENT_ROLE_BROADCASTER);
|
||||
rtcEngine.muteLocalAudioStream(true); // 默认静音
|
||||
rtcEngine.muteAllRemoteAudioStreams(false); // 监听远端的音频
|
||||
@@ -562,18 +562,15 @@ public class AgoraManager {
|
||||
// 1️⃣ 构建局部 Map(声网线程私有)
|
||||
Map<String, Integer> localMap = new HashMap<>();
|
||||
for (AudioVolumeInfo info : speakers) {
|
||||
String userId = "";
|
||||
if (info.uid == 0) {
|
||||
userId = SpUtil.getUserId()+"";
|
||||
}else {
|
||||
userId = String.valueOf(info.uid);
|
||||
}
|
||||
String userId = (info.uid == 0)
|
||||
? SpUtil.getUserId()+""
|
||||
: String.valueOf(info.uid);
|
||||
localMap.put(userId, info.volume);
|
||||
}
|
||||
|
||||
long now = SystemClock.uptimeMillis();
|
||||
if (now - lastDispatchTime < SOUND_UI_INTERVAL) return;
|
||||
lastDispatchTime = now;
|
||||
// long now = SystemClock.uptimeMillis();
|
||||
// if (now - lastDispatchTime < SOUND_UI_INTERVAL) return;
|
||||
// lastDispatchTime = now;
|
||||
|
||||
// 2️⃣ 只把“不可变快照”丢给 UI
|
||||
uiHandler.post(() -> dispatchVolume(localMap));
|
||||
|
||||
@@ -191,6 +191,8 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
||||
LogUtils.e("这是一个很诡异的东西 " + (mParser == null) +",pitBean.getMic_cycle():"+pitBean.getMic_cycle());
|
||||
if (mParser != null) {
|
||||
mParser = null;
|
||||
mIvRipple.stopAnimation(); // 停止当前播放的动画
|
||||
mIvRipple.setVideoItem(null);
|
||||
}
|
||||
micCycle = pitBean.getMic_cycle();
|
||||
mParser = new SVGAParser(getContext());
|
||||
@@ -238,7 +240,6 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
||||
mIvRipple.setScaleY(1.1f);
|
||||
}
|
||||
if (!isMentorShip) {
|
||||
|
||||
//心动值
|
||||
//显示心动
|
||||
if ("1".equals(pitBean.getShutup())) {
|
||||
@@ -285,7 +286,6 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
||||
if (soundLevelUpdateListener != null){
|
||||
AgoraManager.getInstance().removeSoundLevelListener(soundLevelUpdateListener);
|
||||
}
|
||||
|
||||
soundLevelUpdateListener = new SoundLevelUpdateListener() {
|
||||
@Override
|
||||
public void onRemoteSoundLevelUpdate(String userId, int soundLevel) {
|
||||
|
||||
@@ -1926,6 +1926,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
mRoomInfoResp?.user_info?.pit_number = 0
|
||||
}
|
||||
mRoomInfoResp?.room_info?.pit_list!![0] = RoomPitBean(pitNumber)
|
||||
|
||||
if (RoomType.fromTypeId(mRoomInfoResp?.room_info?.type_id.toString()) == RoomType.AUCTION){
|
||||
mRoomInfoResp?.room_auction?.auction_list?.forEach { it ->
|
||||
if (it.user_id.equals(SpUtil.getUserId().toString())) {
|
||||
mRoomInfoResp?.user_info?.pit_number = 9527
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (roomType == RoomType.DATING && mRoomInfoResp?.room_info?.label_id == "2" && (pitNumber.isNullOrEmpty() || (pitNumber.toInt() != 9 && pitNumber.toInt() != 10))) {
|
||||
@@ -3062,6 +3070,15 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
} else {
|
||||
mBinding?.rlMisc?.visibility = View.GONE
|
||||
}
|
||||
|
||||
if (RoomType.fromTypeId(mRoomInfoResp?.room_info?.type_id.toString()) == RoomType.AUCTION){
|
||||
mRoomInfoResp?.room_auction?.auction_list?.forEach { it ->
|
||||
if (it.user_id.equals(SpUtil.getUserId().toString())) {
|
||||
mRoomInfoResp?.user_info?.pit_number = 9527
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//是否在麦上显示状态
|
||||
if (mRoomInfoResp?.user_info?.pit_number != 0) {
|
||||
maiStatus = false
|
||||
|
||||
Reference in New Issue
Block a user