Merge pull request #2866 from nextcloud/feature/1056/sendRaiseHandMessage

Send raise hand signaling message.
This commit is contained in:
Marcel Hibbe 2023-03-17 12:28:09 +01:00 committed by GitHub
commit 28d413c17b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 30 deletions

View file

@ -416,27 +416,20 @@ public class CallActivity extends CallBaseActivity {
raiseHandViewModel.setData(roomToken, isBreakoutRoom);
raiseHandViewModel.getViewState().observe(this, viewState -> {
boolean raised = false;
if (viewState instanceof RaiseHandViewModel.RaisedHandState) {
binding.lowerHandButton.setVisibility(View.VISIBLE);
raised = true;
} else if (viewState instanceof RaiseHandViewModel.LoweredHandState) {
binding.lowerHandButton.setVisibility(View.GONE);
raised = false;
}
// TODO: build&send raiseHand message (if not possible in RaiseHandViewModel, just do it here..)
// if (isConnectionEstablished() && peerConnectionWrapperList != null) {
// if (!hasMCU) {
// for (PeerConnectionWrapper peerConnectionWrapper : peerConnectionWrapperList) {
// peerConnectionWrapper.raiseHand(...);
// }
// } else {
// for (PeerConnectionWrapper peerConnectionWrapper : peerConnectionWrapperList) {
// if (peerConnectionWrapper.getSessionId().equals(webSocketClient.getSessionId())) {
// peerConnectionWrapper.raiseHand(...);
// break;
// }
// }
// }
// }
if (isConnectionEstablished() && peerConnectionWrapperList != null) {
for (PeerConnectionWrapper peerConnectionWrapper : peerConnectionWrapperList) {
peerConnectionWrapper.raiseHand(raised);
}
}
});
callRecordingViewModel = new ViewModelProvider(this, viewModelFactory).get((CallRecordingViewModel.class));

View file

@ -191,21 +191,17 @@ public class PeerConnectionWrapper {
}
public void raiseHand(Boolean raise) {
// TODO: build&send raiseHand message (either here or via RaiseHandViewModel)
// NCMessagePayload ncMessagePayload = new NCMessagePayload();
// ncMessagePayload.setState(raise);
// ncMessagePayload.setTimestamp(System.currentTimeMillis());
//
//
// NCSignalingMessage ncSignalingMessage = new NCSignalingMessage();
//// ncSignalingMessage.setFrom();
// ncSignalingMessage.setTo(sessionId);
//// ncSignalingMessage.setSid();
// ncSignalingMessage.setType("raiseHand");
// ncSignalingMessage.setPayload(ncMessagePayload);
// ncSignalingMessage.setRoomType(videoStreamType);
//
// signalingMessageSender.send(ncSignalingMessage);
NCMessagePayload ncMessagePayload = new NCMessagePayload();
ncMessagePayload.setState(raise);
ncMessagePayload.setTimestamp(System.currentTimeMillis());
NCSignalingMessage ncSignalingMessage = new NCSignalingMessage();
ncSignalingMessage.setTo(sessionId);
ncSignalingMessage.setType("raiseHand");
ncSignalingMessage.setPayload(ncMessagePayload);
ncSignalingMessage.setRoomType(videoStreamType);
signalingMessageSender.send(ncSignalingMessage);
}
/**