mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-26 23:25:20 +03:00
Merge pull request #2866 from nextcloud/feature/1056/sendRaiseHandMessage
Send raise hand signaling message.
This commit is contained in:
commit
28d413c17b
2 changed files with 19 additions and 30 deletions
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue