同步PIKO:完成声网个播PK功能
This commit is contained in:
@@ -72,7 +72,8 @@ public class RtcEngineHandler extends Handler {
|
||||
// 如果麦上没有自己,并且自己在说话,要把自己变成听众
|
||||
AudioEngineManager.get().setRole(Constants.CLIENT_ROLE_AUDIENCE);
|
||||
} else if (micPosition == Integer.MIN_VALUE &&
|
||||
uid != AuthModel.get().getCurrentUid()) {
|
||||
uid != AuthModel.get().getCurrentUid() &&
|
||||
!(AvRoomDataManager.get().isSingleRoom() && AvRoomDataManager.get().isOpenAnotherPKMode())) {
|
||||
// 如果麦上没有这个人,要把他静音
|
||||
AudioEngineManager.get().setRemoteMute(uid, true);
|
||||
}
|
||||
|
@@ -12,6 +12,8 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.chwl.core.SdkConfig;
|
||||
import com.chwl.core.manager.AvRoomDataManager;
|
||||
import com.chwl.core.room.bean.RoomInfo;
|
||||
import com.chwl.library.common.application.Env;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.chwl.core.XConstants;
|
||||
@@ -26,6 +28,8 @@ import java.util.Locale;
|
||||
|
||||
import io.agora.rtc2.Constants;
|
||||
import io.agora.rtc2.RtcEngine;
|
||||
import io.agora.rtc2.video.ChannelMediaInfo;
|
||||
import io.agora.rtc2.video.ChannelMediaRelayConfiguration;
|
||||
|
||||
|
||||
/**
|
||||
@@ -151,11 +155,27 @@ public class RtcEngineManager extends BaseEngine {
|
||||
|
||||
@Override
|
||||
public void connectOtherRoom(String roomId, long userUid) {
|
||||
RoomInfo curRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (curRoomInfo == null) {
|
||||
return;
|
||||
}
|
||||
ChannelMediaInfo srcChannelInfo = new ChannelMediaInfo(null, null, 0);
|
||||
ChannelMediaRelayConfiguration mediaRelayConfiguration = new ChannelMediaRelayConfiguration();
|
||||
mediaRelayConfiguration.setSrcChannelInfo(srcChannelInfo);
|
||||
|
||||
ChannelMediaInfo destChannelInfo = new ChannelMediaInfo(roomId, null, 0);
|
||||
mediaRelayConfiguration.setDestChannelInfo(roomId, destChannelInfo);
|
||||
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.startOrUpdateChannelMediaRelay(mediaRelayConfiguration);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disconnectOtherRoom() {
|
||||
|
||||
if (mRtcEngine != null) {
|
||||
mRtcEngine.stopChannelMediaRelay();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user