Fix case of no media stream from remote

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-05-10 21:49:23 +02:00
parent f412ee4ca6
commit e3581f03f5

View File

@ -59,6 +59,7 @@ public class MagicPeerConnectionWrapper {
private MediaConstraints mediaConstraints;
private DataChannel magicDataChannel;
private MagicSdpObserver magicSdpObserver;
private MediaStream remoteMediaStream;
private boolean remoteVideoOn;
private boolean remoteAudioOn;
@ -250,8 +251,10 @@ public class MagicPeerConnectionWrapper {
@Override
public void onIceConnectionChange(PeerConnection.IceConnectionState iceConnectionState) {
if (iceConnectionState.equals(PeerConnection.IceConnectionState.CONNECTED)) {
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType
.PEER_CONNECTED, sessionId, null, null));
/*EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType
.PEER_CONNECTED, sessionId, null, null));*/
EventBus.getDefault().post(new MediaStreamEvent(remoteMediaStream, sessionId));
if (hasInitiated) {
sendInitialMediaStatus();
}
@ -288,7 +291,7 @@ public class MagicPeerConnectionWrapper {
@Override
public void onAddStream(MediaStream mediaStream) {
EventBus.getDefault().post(new MediaStreamEvent(mediaStream, sessionId));
remoteMediaStream = mediaStream;
}
@Override