Skip to content

Commit

Permalink
Merge branch 'hotfix/2024.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Jul 9, 2024
2 parents 8953100 + 7d6d6d8 commit c239ea2
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
36 changes: 31 additions & 5 deletions packages/sdk/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ export default class ConnectionBase {
* ロール(sendonly | sendrecv | recvonly)
*/
role: string
/**
* サイマルキャスト
*/
simulcast: boolean
/**
* スポットライト
*/
spotlight: boolean
/**
* チャネルID
*/
Expand All @@ -87,6 +95,10 @@ export default class ConnectionBase {
* デバッグフラグ
*/
debug: boolean
/**
* バンドルID
*/
bundleId: string | null
/**
* クライアントID
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
13 changes: 11 additions & 2 deletions packages/sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down

0 comments on commit c239ea2

Please sign in to comment.