Skip to content

Commit

Permalink
Merge pull request #207 from shiguredo/feature/fix-handle-turn-uri-as…
Browse files Browse the repository at this point in the history
…-string

URL 構造体が TURN URI に対応していないのに、URL に変換していたのを修正する
  • Loading branch information
zztkm authored Aug 9, 2024
2 parents f422d9c + a48a750 commit 0927a8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
- `WrapperVideoEncoderFactory.shared.simulcastEnabled` の判定条件から `Configuration.spotlightEnabled` を削除する
- <https://github.com/shiguredo/sora-ios-sdk/commit/44f3b81fd81694f3f670e3de568afc2a6bab5f9f> の修正漏れ
- @zztkm
- [FIX] URL 構造体が TURN URI に対応していないのに、URL に変換していたのを修正する
- 意図しないエスケープが発生しないようにした
- @zztkm

## 2024.2.0

Expand Down
10 changes: 6 additions & 4 deletions Sora/ICEServerInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ public final class ICEServerInfo {
// MARK: プロパティ

/// URL のリスト
public var urls: [URL] = []
///
/// TURN URI はそのまま文字列として処理する
public var urls: [String] = []

/// ユーザー名
public var userName: String?
Expand All @@ -20,7 +22,7 @@ public final class ICEServerInfo {
public var tlsSecurityPolicy: TLSSecurityPolicy = .secure

var nativeValue: RTCIceServer {
RTCIceServer(urlStrings: urls.map { url in url.absoluteString },
RTCIceServer(urlStrings: urls,
username: userName,
credential: credential,
tlsCertPolicy: tlsSecurityPolicy.nativeValue)
Expand All @@ -29,7 +31,7 @@ public final class ICEServerInfo {
// MARK: 初期化

/// 初期化します。
public init(urls: [URL],
public init(urls: [String],
userName: String?,
credential: String?,
tlsSecurityPolicy: TLSSecurityPolicy)
Expand Down Expand Up @@ -60,7 +62,7 @@ extension ICEServerInfo: Codable {

public convenience init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
let urls = try container.decode([URL].self, forKey: .urls)
let urls = try container.decode([String].self, forKey: .urls)
let userName = try container.decodeIfPresent(String.self, forKey: .userName)
let credential = try container.decodeIfPresent(String.self, forKey: .credential)
self.init(urls: urls,
Expand Down

0 comments on commit 0927a8f

Please sign in to comment.