mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-22 13:09:46 +01:00
Merge pull request #2572 from nextcloud/fix-participant-display-items-not-updated-on-events
Fix ParticipantDisplayItems not updated on events
This commit is contained in:
commit
bff96f1b81
@ -2164,21 +2164,22 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onMessageEvent(PeerConnectionEvent peerConnectionEvent) {
|
public void onMessageEvent(PeerConnectionEvent peerConnectionEvent) {
|
||||||
String sessionId = peerConnectionEvent.getSessionId();
|
String sessionId = peerConnectionEvent.getSessionId();
|
||||||
|
String participantDisplayItemId = sessionId + "-" + peerConnectionEvent.getVideoStreamType();
|
||||||
|
|
||||||
if (peerConnectionEvent.getPeerConnectionEventType() ==
|
if (peerConnectionEvent.getPeerConnectionEventType() ==
|
||||||
PeerConnectionEvent.PeerConnectionEventType.PEER_CONNECTED) {
|
PeerConnectionEvent.PeerConnectionEventType.PEER_CONNECTED) {
|
||||||
if (webSocketClient != null && webSocketClient.getSessionId() != null && webSocketClient.getSessionId().equals(sessionId)) {
|
if (webSocketClient != null && webSocketClient.getSessionId() != null && webSocketClient.getSessionId().equals(sessionId)) {
|
||||||
updateSelfVideoViewConnected(true);
|
updateSelfVideoViewConnected(true);
|
||||||
} else if (participantDisplayItems.get(sessionId) != null) {
|
} else if (participantDisplayItems.get(participantDisplayItemId) != null) {
|
||||||
participantDisplayItems.get(sessionId).setConnected(true);
|
participantDisplayItems.get(participantDisplayItemId).setConnected(true);
|
||||||
participantsAdapter.notifyDataSetChanged();
|
participantsAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
|
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
|
||||||
PeerConnectionEvent.PeerConnectionEventType.PEER_DISCONNECTED) {
|
PeerConnectionEvent.PeerConnectionEventType.PEER_DISCONNECTED) {
|
||||||
if (webSocketClient != null && webSocketClient.getSessionId() != null && webSocketClient.getSessionId().equals(sessionId)) {
|
if (webSocketClient != null && webSocketClient.getSessionId() != null && webSocketClient.getSessionId().equals(sessionId)) {
|
||||||
updateSelfVideoViewConnected(false);
|
updateSelfVideoViewConnected(false);
|
||||||
} else if (participantDisplayItems.get(sessionId) != null) {
|
} else if (participantDisplayItems.get(participantDisplayItemId) != null) {
|
||||||
participantDisplayItems.get(sessionId).setConnected(false);
|
participantDisplayItems.get(participantDisplayItemId).setConnected(false);
|
||||||
participantsAdapter.notifyDataSetChanged();
|
participantsAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
|
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
|
||||||
@ -2200,20 +2201,20 @@ public class CallActivity extends CallBaseActivity {
|
|||||||
}
|
}
|
||||||
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
|
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
|
||||||
PeerConnectionEvent.PeerConnectionEventType.NICK_CHANGE) {
|
PeerConnectionEvent.PeerConnectionEventType.NICK_CHANGE) {
|
||||||
if (participantDisplayItems.get(sessionId) != null) {
|
if (participantDisplayItems.get(participantDisplayItemId) != null) {
|
||||||
participantDisplayItems.get(sessionId).setNick(peerConnectionEvent.getNick());
|
participantDisplayItems.get(participantDisplayItemId).setNick(peerConnectionEvent.getNick());
|
||||||
participantsAdapter.notifyDataSetChanged();
|
participantsAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
|
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
|
||||||
PeerConnectionEvent.PeerConnectionEventType.VIDEO_CHANGE && !isVoiceOnlyCall) {
|
PeerConnectionEvent.PeerConnectionEventType.VIDEO_CHANGE && !isVoiceOnlyCall) {
|
||||||
if (participantDisplayItems.get(sessionId) != null) {
|
if (participantDisplayItems.get(participantDisplayItemId) != null) {
|
||||||
participantDisplayItems.get(sessionId).setStreamEnabled(peerConnectionEvent.getChangeValue());
|
participantDisplayItems.get(participantDisplayItemId).setStreamEnabled(peerConnectionEvent.getChangeValue());
|
||||||
participantsAdapter.notifyDataSetChanged();
|
participantsAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
|
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
|
||||||
PeerConnectionEvent.PeerConnectionEventType.AUDIO_CHANGE) {
|
PeerConnectionEvent.PeerConnectionEventType.AUDIO_CHANGE) {
|
||||||
if (participantDisplayItems.get(sessionId) != null) {
|
if (participantDisplayItems.get(participantDisplayItemId) != null) {
|
||||||
participantDisplayItems.get(sessionId).setAudioEnabled(peerConnectionEvent.getChangeValue());
|
participantDisplayItems.get(participantDisplayItemId).setAudioEnabled(peerConnectionEvent.getChangeValue());
|
||||||
participantsAdapter.notifyDataSetChanged();
|
participantsAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
|
} else if (peerConnectionEvent.getPeerConnectionEventType() ==
|
||||||
|
@ -345,7 +345,7 @@ public class PeerConnectionWrapper {
|
|||||||
Log.d("iceConnectionChangeTo: ", iceConnectionState.name() + " over " + peerConnection.hashCode() + " " + sessionId);
|
Log.d("iceConnectionChangeTo: ", iceConnectionState.name() + " over " + peerConnection.hashCode() + " " + sessionId);
|
||||||
if (iceConnectionState == PeerConnection.IceConnectionState.CONNECTED) {
|
if (iceConnectionState == PeerConnection.IceConnectionState.CONNECTED) {
|
||||||
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType.PEER_CONNECTED,
|
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType.PEER_CONNECTED,
|
||||||
sessionId, null, null, null));
|
sessionId, null, null, videoStreamType));
|
||||||
|
|
||||||
if (!isMCUPublisher) {
|
if (!isMCUPublisher) {
|
||||||
EventBus.getDefault().post(new MediaStreamEvent(remoteStream, sessionId, videoStreamType));
|
EventBus.getDefault().post(new MediaStreamEvent(remoteStream, sessionId, videoStreamType));
|
||||||
@ -356,7 +356,7 @@ public class PeerConnectionWrapper {
|
|||||||
}
|
}
|
||||||
} else if (iceConnectionState == PeerConnection.IceConnectionState.COMPLETED) {
|
} else if (iceConnectionState == PeerConnection.IceConnectionState.COMPLETED) {
|
||||||
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType.PEER_CONNECTED,
|
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType.PEER_CONNECTED,
|
||||||
sessionId, null, null, null));
|
sessionId, null, null, videoStreamType));
|
||||||
} else if (iceConnectionState == PeerConnection.IceConnectionState.CLOSED) {
|
} else if (iceConnectionState == PeerConnection.IceConnectionState.CLOSED) {
|
||||||
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType
|
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType
|
||||||
.PEER_CLOSED, sessionId, null, null, videoStreamType));
|
.PEER_CLOSED, sessionId, null, null, videoStreamType));
|
||||||
@ -364,12 +364,12 @@ public class PeerConnectionWrapper {
|
|||||||
iceConnectionState == PeerConnection.IceConnectionState.NEW ||
|
iceConnectionState == PeerConnection.IceConnectionState.NEW ||
|
||||||
iceConnectionState == PeerConnection.IceConnectionState.CHECKING) {
|
iceConnectionState == PeerConnection.IceConnectionState.CHECKING) {
|
||||||
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType.PEER_DISCONNECTED,
|
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType.PEER_DISCONNECTED,
|
||||||
sessionId, null, null, null));
|
sessionId, null, null, videoStreamType));
|
||||||
} else if (iceConnectionState == PeerConnection.IceConnectionState.FAILED) {
|
} else if (iceConnectionState == PeerConnection.IceConnectionState.FAILED) {
|
||||||
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType.PEER_DISCONNECTED,
|
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType.PEER_DISCONNECTED,
|
||||||
sessionId, null, null, null));
|
sessionId, null, null, videoStreamType));
|
||||||
if (isMCUPublisher) {
|
if (isMCUPublisher) {
|
||||||
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType.PUBLISHER_FAILED, sessionId, null, null, null));
|
EventBus.getDefault().post(new PeerConnectionEvent(PeerConnectionEvent.PeerConnectionEventType.PUBLISHER_FAILED, sessionId, null, null, videoStreamType));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user