Skip to content

Commit

Permalink
multistreamEnabled をオプションに変更する
Browse files Browse the repository at this point in the history
zztkm committed Jan 27, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent ba3c2ca commit 6f55d24
Showing 2 changed files with 10 additions and 38 deletions.
43 changes: 6 additions & 37 deletions Sora/Configuration.swift
Original file line number Diff line number Diff line change
@@ -89,13 +89,13 @@ public struct Configuration {
///
/// レガシーストリーム機能は 2025 年 6 月リリースの Sora にて廃止します
/// そのため、multistreamEnabled は使用は非推奨です
public var multistreamEnabled: Bool
public var multistreamEnabled: Bool?

/// :nodoc:
var isMultistream: Bool {
switch role {
default:
return multistreamEnabled
return multistreamEnabled ?? true
}
}

@@ -229,43 +229,12 @@ public struct Configuration {
- parameter url: サーバーの URL
- parameter channelId: チャネル ID
- parameter role: ロール
*/
public init(url: URL,
channelId: String,
role: Role)
{
urlCandidates = [url]
self.channelId = channelId
self.role = role
}

/**
初期化します。
- parameter urlCandidates: シグナリングに利用する URL の候補
- parameter channelId: チャネル ID
- parameter role: ロール
*/
public init(urlCandidates: [URL],
channelId: String,
role: Role)
{
self.urlCandidates = urlCandidates
self.channelId = channelId
self.role = role
}

/**
初期化します。

- parameter url: サーバーの URL
- parameter channelId: チャネル ID
- parameter role: ロール
- parameter multistreamEnabled: マルチストリームの可否
- parameter multistreamEnabled: マルチストリームの可否(デフォルトは指定なし)
*/
public init(url: URL,
channelId: String,
role: Role,
multistreamEnabled: Bool)
multistreamEnabled: Bool? = nil)
{
urlCandidates = [url]
self.channelId = channelId
@@ -278,12 +247,12 @@ public struct Configuration {
- parameter urlCandidates: シグナリングに利用する URL の候補
- parameter channelId: チャネル ID
- parameter role: ロール
- parameter multistreamEnabled: マルチストリームの可否
- parameter multistreamEnabled: マルチストリームの可否(デフォルトは指定なし)
*/
public init(urlCandidates: [URL],
channelId: String,
role: Role,
multistreamEnabled: Bool)
multistreamEnabled: Bool? = nil)
{
self.urlCandidates = urlCandidates
self.channelId = channelId
5 changes: 4 additions & 1 deletion Sora/PeerChannel.swift
Original file line number Diff line number Diff line change
@@ -294,7 +294,10 @@ class PeerChannel: NSObject, RTCPeerConnectionDelegate {
message: "did connect to signaling channel")

var role: SignalingRole
var multistream = configuration.multistreamEnabled || configuration.spotlightEnabled == .enabled
var multistream = configuration.multistreamEnabled
if configuration.spotlightEnabled == .enabled {
multistream = true
}
switch configuration.role {
case .sendonly:
role = .sendonly

0 comments on commit 6f55d24

Please sign in to comment.