mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
Add support for TURN
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
9bada8f1d1
commit
fe956853aa
@ -27,6 +27,7 @@ package com.nextcloud.talk.activities;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
@ -175,7 +176,7 @@ public class CallActivity extends AppCompatActivity {
|
||||
ButterKnife.bind(this);
|
||||
|
||||
roomToken = getIntent().getExtras().getString("roomToken", "");
|
||||
userEntity = Parcels.unwrap(getIntent().getExtras().getParcelable("userEntity"));
|
||||
userEntity = Parcels.unwrap((Parcelable) getIntent().getExtras().get("userEntity"));
|
||||
callSession = "0";
|
||||
|
||||
credentials = ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken());
|
||||
@ -342,6 +343,21 @@ public class CallActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < signalingSettingsOverall.getOcs().getSettings().getTurnServers().size();
|
||||
i++) {
|
||||
iceServer = signalingSettingsOverall.getOcs().getSettings().getTurnServers().get(i);
|
||||
for (int j = 0; j < iceServer.getUrls().size(); j++) {
|
||||
if (TextUtils.isEmpty(iceServer.getUsername()) || TextUtils.isEmpty(iceServer
|
||||
.getCredential())) {
|
||||
iceServers.add(new PeerConnection.IceServer(iceServer.getUrls().get(j)));
|
||||
} else {
|
||||
iceServers.add(new PeerConnection.IceServer(iceServer.getUrls().get(j),
|
||||
iceServer.getUsername(), iceServer.getCredential()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
joinRoomAndCall();
|
||||
|
||||
}
|
||||
|
@ -23,6 +23,8 @@ package com.nextcloud.talk.api.models.json.signaling.settings;
|
||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ -31,6 +33,9 @@ public class IceServer {
|
||||
@JsonField(name = "url")
|
||||
String url;
|
||||
|
||||
@JsonField(name = "urls")
|
||||
List<String> urls;
|
||||
|
||||
@JsonField(name = "username")
|
||||
String username;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user