diff --git a/CHANGES.md b/CHANGES.md index 6aac36d3..3f168bc0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,15 @@ ## develop +## 2024.1.2 + +**2024-07-09** + +- [FIX] `"type": "offer"` の `simulcast` の値が反映されていない問題を修正する + - @voluntas +- [FIX] `"type": "offer"` の `bundle_id` と `spotlight` を保持するように修正する + - @voluntas + ## 2024.1.1 **2024-06-17** diff --git a/package.json b/package.json index 837fabe8..4e6380a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-js-sdk", - "version": "2024.1.1", + "version": "2024.1.2", "description": "WebRTC SFU Sora JavaScript SDK", "main": "dist/sora.js", "module": "dist/sora.mjs", diff --git a/packages/sdk/src/base.ts b/packages/sdk/src/base.ts index f916c467..8604c9e1 100644 --- a/packages/sdk/src/base.ts +++ b/packages/sdk/src/base.ts @@ -62,6 +62,14 @@ export default class ConnectionBase { * ロール(sendonly | sendrecv | recvonly) */ role: string + /** + * サイマルキャスト + */ + simulcast: boolean + /** + * スポットライト + */ + spotlight: boolean /** * チャネルID */ @@ -87,6 +95,10 @@ export default class ConnectionBase { * デバッグフラグ */ debug: boolean + /** + * バンドルID + */ + bundleId: string | null /** * クライアントID */ @@ -229,9 +241,12 @@ export default class ConnectionBase { } this.constraints = null this.debug = debug + this.simulcast = false + this.spotlight = false + this.sessionId = null this.clientId = null + this.bundleId = null this.connectionId = null - this.sessionId = null this.remoteConnectionIds = [] this.stream = null this.ws = null @@ -723,9 +738,14 @@ export default class ConnectionBase { * 接続状態の初期化をするメソッド */ private initializeConnection(): void { + this.simulcast = false + this.spotlight = false + + this.sessionId = null this.clientId = null + this.bundleId = null this.connectionId = null - this.sessionId = null + this.remoteConnectionIds = [] this.stream = null this.ws = null @@ -1391,7 +1411,7 @@ export default class ConnectionBase { } } // simulcast の場合 - if (this.options.simulcast && (this.role === 'sendrecv' || this.role === 'sendonly')) { + if (this.simulcast && (this.role === 'sendrecv' || this.role === 'sendonly')) { const transceiver = this.pc.getTransceivers().find((t) => { if (t.mid === null) { return @@ -1878,11 +1898,17 @@ export default class ConnectionBase { * @param message - type offer メッセージ */ private signalingOnMessageTypeOffer(message: SignalingOfferMessage): void { - this.clientId = message.client_id - this.connectionId = message.connection_id + this.simulcast = message.simulcast + this.spotlight = message.spotlight + + // 互換性を考慮してオプションとする if (message.session_id !== undefined) { this.sessionId = message.session_id } + this.clientId = message.client_id + this.bundleId = message.bundle_id + this.connectionId = message.connection_id + if (message.metadata !== undefined) { this.authMetadata = message.metadata } diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index 292c3e99..fbe8c264 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -105,10 +105,19 @@ export type SignalingOfferMessageDataChannel = { export type SignalingOfferMessage = { type: 'offer' sdp: string + + multistream: boolean + simulcast: boolean + simulcast_multicodec: boolean + spotlight: boolean + + channel_id: string + // 互換性を考慮してオプションとする + session_id?: string client_id: string + bundle_id: string connection_id: string - session_id?: string - bundle_id?: string + metadata?: JSONType config?: RTCConfiguration encodings?: RTCRtpEncodingParameters[]