mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 11:39:42 +01:00
Some progress
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
ef714afe68
commit
eb9d7ec0d7
@ -632,7 +632,7 @@ public class CallActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.BACKGROUND)
|
||||
public void onMessageEvent(SessionDescriptionSendEvent sessionDescriptionSend) {
|
||||
public void onMessageEvent(SessionDescriptionSendEvent sessionDescriptionSend) throws IOException {
|
||||
Log.d("MARIO_123", "SENDING " + sessionDescriptionSend.getType());
|
||||
String credentials = ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken());
|
||||
NCMessageWrapper ncMessageWrapper = new NCMessageWrapper();
|
||||
@ -656,8 +656,13 @@ public class CallActivity extends AppCompatActivity {
|
||||
ncSignalingMessage.setPayload(ncMessagePayload);
|
||||
ncMessageWrapper.setSignalingMessage(ncSignalingMessage);
|
||||
|
||||
List<NCMessageWrapper> ncMessageWrappers = new ArrayList<>();
|
||||
ncMessageWrappers.add(ncMessageWrapper);
|
||||
|
||||
Log.d("MARIO_123", LoganSquare.serialize(ncMessageWrappers));
|
||||
|
||||
ncApi.sendSignalingMessages(credentials, ApiHelper.getUrlForSignaling(userEntity.getBaseUrl()),
|
||||
ncMessageWrapper)
|
||||
ncMessageWrappers)
|
||||
.subscribeOn(Schedulers.newThread())
|
||||
.subscribe(new Observer<Integer>() {
|
||||
@Override
|
||||
|
@ -33,6 +33,7 @@ import com.nextcloud.talk.api.models.json.signaling.NCMessageWrapper;
|
||||
import com.nextcloud.talk.api.models.json.signaling.SignalingOverall;
|
||||
import com.nextcloud.talk.api.models.json.userprofile.UserProfileOverall;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
@ -168,7 +169,7 @@ public interface NcApi {
|
||||
*/
|
||||
@POST
|
||||
Observable<Integer> sendSignalingMessages(@Header("Authorization") String authorization, @Url String url,
|
||||
@Body NCMessageWrapper ncMessageWrapper);
|
||||
@Body List<NCMessageWrapper> ncMessageWrapper);
|
||||
|
||||
/*
|
||||
Server URL is: baseUrl + ocsApiVersion + spreedApiVersion + /signaling
|
||||
|
@ -36,7 +36,4 @@ public class NCIceCandidate {
|
||||
|
||||
@JsonField(name = "candidate")
|
||||
String candidate;
|
||||
|
||||
@JsonField(name = "type")
|
||||
String type;
|
||||
}
|
||||
|
@ -90,6 +90,9 @@ public class PeerConnectionWrapper {
|
||||
|
||||
@Override
|
||||
public void onIceGatheringChange(PeerConnection.IceGatheringState iceGatheringState) {
|
||||
if (iceGatheringState.equals(PeerConnection.IceGatheringState.COMPLETE)) {
|
||||
sendLocalCandidates();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -150,7 +153,6 @@ public class PeerConnectionWrapper {
|
||||
// We've just set our local SDP so time to send it, drain
|
||||
// remote and send local ICE candidates.
|
||||
Log.d("MARIO", "SENDING ANSWER FROM OBSERVER");
|
||||
sendLocalCandidates();
|
||||
EventBus.getDefault().post(new SessionDescriptionSendEvent(peerConnection.getLocalDescription
|
||||
(),
|
||||
sessionId,
|
||||
@ -162,7 +164,6 @@ public class PeerConnectionWrapper {
|
||||
public void onCreateSuccess(SessionDescription sessionDescription) {
|
||||
super.onCreateSuccess(sessionDescription);
|
||||
peerConnection.setLocalDescription(magicSdpObserver, sessionDescription);
|
||||
sendLocalCandidates();
|
||||
}
|
||||
|
||||
}, mediaConstraints);
|
||||
|
Loading…
Reference in New Issue
Block a user