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.setData(roomToken, isBreakoutRoom);
raiseHandViewModel.getViewState().observe(this, viewState -> { raiseHandViewModel.getViewState().observe(this, viewState -> {
boolean raised = false;
if (viewState instanceof RaiseHandViewModel.RaisedHandState) { if (viewState instanceof RaiseHandViewModel.RaisedHandState) {
binding.lowerHandButton.setVisibility(View.VISIBLE); binding.lowerHandButton.setVisibility(View.VISIBLE);
raised = true;
} else if (viewState instanceof RaiseHandViewModel.LoweredHandState) { } else if (viewState instanceof RaiseHandViewModel.LoweredHandState) {
binding.lowerHandButton.setVisibility(View.GONE); 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 (isConnectionEstablished() && peerConnectionWrapperList != null) { for (PeerConnectionWrapper peerConnectionWrapper : peerConnectionWrapperList) {
// if (!hasMCU) { peerConnectionWrapper.raiseHand(raised);
// for (PeerConnectionWrapper peerConnectionWrapper : peerConnectionWrapperList) { }
// peerConnectionWrapper.raiseHand(...); }
// }
// } else {
// for (PeerConnectionWrapper peerConnectionWrapper : peerConnectionWrapperList) {
// if (peerConnectionWrapper.getSessionId().equals(webSocketClient.getSessionId())) {
// peerConnectionWrapper.raiseHand(...);
// break;
// }
// }
// }
// }
}); });
callRecordingViewModel = new ViewModelProvider(this, viewModelFactory).get((CallRecordingViewModel.class)); callRecordingViewModel = new ViewModelProvider(this, viewModelFactory).get((CallRecordingViewModel.class));

View File

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