diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index 8975b4a88..496883fdd 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -218,8 +218,6 @@ public class CallActivity extends AppCompatActivity { // And finally, with our VideoRenderer ready, we // can add our renderer to the VideoTrack. localVideoTrack.addRenderer(localRenderer); - - } @@ -291,7 +289,7 @@ public class CallActivity extends AppCompatActivity { localPeer.setRemoteDescription(new MagicSdpObserver(), sessionDescription); } - }, new MediaConstraints()); + }, sdpConstraints); } }, sdpConstraints); } diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCIceCandidate.java b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCIceCandidate.java new file mode 100644 index 000000000..a0c4c146f --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCIceCandidate.java @@ -0,0 +1,39 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * Copyright (C) 2017 Mario Danic + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.nextcloud.talk.api.models.json.signaling; + +import com.bluelinelabs.logansquare.annotation.JsonField; +import com.bluelinelabs.logansquare.annotation.JsonObject; + +import lombok.Data; + +@Data +@JsonObject +public class NCIceCandidate { + @JsonField(name = "sdpMLineIndex") + String sdpMLineIndex; + + @JsonField(name = "sdpMid") + String sdpMid; + + @JsonField(name = "candidate") + String candidate; +} diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessagePayload.java b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessagePayload.java new file mode 100644 index 000000000..e63d1dd9b --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessagePayload.java @@ -0,0 +1,42 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * Copyright (C) 2017 Mario Danic + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.nextcloud.talk.api.models.json.signaling; + +import com.bluelinelabs.logansquare.annotation.JsonField; +import com.bluelinelabs.logansquare.annotation.JsonObject; + +import lombok.Data; + +@Data +@JsonObject +public class NCMessagePayload { + @JsonField(name = "type") + String type; + + @JsonField(name = "sdp") + String sdp; + + @JsonField(name = "nick") + String nick; + + @JsonField(name = "candidate") + NCIceCandidate iceCandidate; +} diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessageWrapper.java b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessageWrapper.java new file mode 100644 index 000000000..25afd2467 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessageWrapper.java @@ -0,0 +1,40 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * Copyright (C) 2017 Mario Danic + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.nextcloud.talk.api.models.json.signaling; + +import com.bluelinelabs.logansquare.annotation.JsonField; +import com.bluelinelabs.logansquare.annotation.JsonObject; + +import lombok.Data; + +@Data +@JsonObject +public class NCMessageWrapper { + @JsonField(name = "fn") + NCSignalingMessage signalingMessage; + + // always a "message" + @JsonField(name = "ev") + String ev; + + @JsonField(name = "sessionId") + String sessionId; +} diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCSignalingMessage.java b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCSignalingMessage.java index 6b20fa419..1e3ff287e 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCSignalingMessage.java +++ b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCSignalingMessage.java @@ -23,8 +23,6 @@ package com.nextcloud.talk.api.models.json.signaling; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import java.util.HashMap; - import lombok.Data; @Data @@ -34,12 +32,11 @@ public class NCSignalingMessage { String from; @JsonField(name = "to") String to; - @JsonField(name = "sid") - String sid; @JsonField(name = "type") String type; @JsonField(name = "payload") - HashMap payload; + NCMessagePayload payload; @JsonField(name = "roomType") String roomType; + } diff --git a/app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionObserver.java b/app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionObserver.java index 8ca7b7073..911be4dae 100644 --- a/app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionObserver.java +++ b/app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionObserver.java @@ -62,7 +62,6 @@ public class MagicPeerConnectionObserver implements PeerConnection.Observer { @Override public void onAddStream(MediaStream mediaStream) { - } @Override