Fix a few bugs

This commit is contained in:
Mario Danic 2018-10-15 21:57:30 +02:00
parent 8c0050ee3b
commit 54144b1c8c
2 changed files with 15 additions and 7 deletions

View file

@ -1390,10 +1390,6 @@ public class CallController extends BaseController {
@Override
public void onNext(GenericOverall genericOverall) {
if (externalSignalingServer != null) {
webSocketClient.joinRoomWithRoomToken("");
}
if (getActivity() != null) {
getActivity().finish();
}
@ -1514,12 +1510,21 @@ public class CallController extends BaseController {
} else {
hasMCU = webSocketClient != null && webSocketClient.hasMCU();
MediaConstraints mediaConstraintsToUse;
if (hasMCU) {
mediaConstraintsToUse = sdpConstraintsForMCU;
} else {
mediaConstraintsToUse = sdpConstraints;
}
if (sessionId.equals(callSession)) {
magicPeerConnectionWrapper = new MagicPeerConnectionWrapper(peerConnectionFactory,
iceServers, sdpConstraintsForMCU, sessionId, callSession, localMediaStream, hasMCU);
iceServers, mediaConstraintsToUse, sessionId, callSession, localMediaStream, hasMCU);
} else {
magicPeerConnectionWrapper = new MagicPeerConnectionWrapper(peerConnectionFactory,
iceServers, sdpConstraintsForMCU, sessionId, callSession, null, hasMCU);
iceServers, mediaConstraintsToUse, sessionId, callSession, null, hasMCU);
}
magicPeerConnectionWrapperList.add(magicPeerConnectionWrapper);

View file

@ -50,6 +50,8 @@ import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.Nullable;
public class MagicPeerConnectionWrapper {
private static String TAG = "MagicPeerConnectionWrapper";
List<IceCandidate> iceCandidates = new ArrayList<>();
@ -72,7 +74,7 @@ public class MagicPeerConnectionWrapper {
public MagicPeerConnectionWrapper(PeerConnectionFactory peerConnectionFactory,
List<PeerConnection.IceServer> iceServerList,
MediaConstraints mediaConstraints,
String sessionId, String localSession, MediaStream mediaStream,
String sessionId, String localSession, @Nullable MediaStream mediaStream,
boolean hasMCU) {
this.localMediaStream = mediaStream;
@ -346,6 +348,7 @@ public class MagicPeerConnectionWrapper {
EventBus.getDefault().post(new SessionDescriptionSendEvent(sessionDescriptionWithPreferredCodec, sessionId,
sessionDescription.type.canonicalForm().toLowerCase(), null));
if (peerConnection != null) {
peerConnection.setLocalDescription(magicSdpObserver, sessionDescriptionWithPreferredCodec);
}