OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 sendPostMessage(MessageType.LEAVE, leaveUrl, null); | 124 sendPostMessage(MessageType.LEAVE, leaveUrl, null); |
125 } | 125 } |
126 roomState = ConnectionState.CLOSED; | 126 roomState = ConnectionState.CLOSED; |
127 if (wsClient != null) { | 127 if (wsClient != null) { |
128 wsClient.disconnect(true); | 128 wsClient.disconnect(true); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 // Helper functions to get connection, post message and leave message URLs | 132 // Helper functions to get connection, post message and leave message URLs |
133 private String getConnectionUrl(RoomConnectionParameters connectionParameters)
{ | 133 private String getConnectionUrl(RoomConnectionParameters connectionParameters)
{ |
134 return connectionParameters.roomUrl + "/" + ROOM_JOIN + "/" + connectionPara
meters.roomId; | 134 StringBuilder builder = new StringBuilder( |
| 135 connectionParameters.roomUrl + "/" + ROOM_JOIN + "/" + connectionParamet
ers.roomId); |
| 136 if (connectionParameters.colliderUrl != null) { |
| 137 // TODO false for wstls to disable https, should be option later or if URL
is http |
| 138 builder.append("?wstls=false"); |
| 139 builder.append("?debug=loopback"); |
| 140 builder.append("?ts="); |
| 141 builder.append("?wshpp=").append(connectionParameters.colliderUrl); |
| 142 } |
| 143 return builder.toString(); |
135 } | 144 } |
136 | 145 |
137 private String getMessageUrl( | 146 private String getMessageUrl( |
138 RoomConnectionParameters connectionParameters, SignalingParameters signali
ngParameters) { | 147 RoomConnectionParameters connectionParameters, SignalingParameters signali
ngParameters) { |
139 return connectionParameters.roomUrl + "/" + ROOM_MESSAGE + "/" + connectionP
arameters.roomId | 148 return connectionParameters.roomUrl + "/" + ROOM_MESSAGE + "/" + connectionP
arameters.roomId |
140 + "/" + signalingParameters.clientId; | 149 + "/" + signalingParameters.clientId; |
141 } | 150 } |
142 | 151 |
143 private String getLeaveUrl( | 152 private String getLeaveUrl( |
144 RoomConnectionParameters connectionParameters, SignalingParameters signali
ngParameters) { | 153 RoomConnectionParameters connectionParameters, SignalingParameters signali
ngParameters) { |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 jsonPut(json, "candidate", candidate.sdp); | 419 jsonPut(json, "candidate", candidate.sdp); |
411 return json; | 420 return json; |
412 } | 421 } |
413 | 422 |
414 // Converts a JSON candidate to a Java object. | 423 // Converts a JSON candidate to a Java object. |
415 IceCandidate toJavaCandidate(JSONObject json) throws JSONException { | 424 IceCandidate toJavaCandidate(JSONObject json) throws JSONException { |
416 return new IceCandidate( | 425 return new IceCandidate( |
417 json.getString("id"), json.getInt("label"), json.getString("candidate"))
; | 426 json.getString("id"), json.getInt("label"), json.getString("candidate"))
; |
418 } | 427 } |
419 } | 428 } |
OLD | NEW |