mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +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.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Parcelable;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
@ -175,7 +176,7 @@ public class CallActivity extends AppCompatActivity {
|
|||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
roomToken = getIntent().getExtras().getString("roomToken", "");
|
roomToken = getIntent().getExtras().getString("roomToken", "");
|
||||||
userEntity = Parcels.unwrap(getIntent().getExtras().getParcelable("userEntity"));
|
userEntity = Parcels.unwrap((Parcelable) getIntent().getExtras().get("userEntity"));
|
||||||
callSession = "0";
|
callSession = "0";
|
||||||
|
|
||||||
credentials = ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken());
|
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();
|
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.JsonField;
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -31,6 +33,9 @@ public class IceServer {
|
|||||||
@JsonField(name = "url")
|
@JsonField(name = "url")
|
||||||
String url;
|
String url;
|
||||||
|
|
||||||
|
@JsonField(name = "urls")
|
||||||
|
List<String> urls;
|
||||||
|
|
||||||
@JsonField(name = "username")
|
@JsonField(name = "username")
|
||||||
String username;
|
String username;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user