Skip to content

Commit

Permalink
Merge branch 'hotfix/2022.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Feb 10, 2023
2 parents de0e714 + fe054dd commit 6a55d1a
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

## develop

## 2022.3.2

- [FIX] ミュート状態で接続すると、replace(Video|Audio)Track しても画像・音声データが送信されないのを修正
- @melpon

## 2022.3.1

- [FIX] e2ee が有効で無い場合の判定は null かどうかに修正する
Expand Down
4 changes: 4 additions & 0 deletions dist/base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ export default class ConnectionBase {
* Lyra インスタンス
*/
private lyra?;
/**
* キーとなる sender が setupSenderTransform で初期化済みかどうか
*/
private senderStreamInitialized;
constructor(signalingUrlCandidates: string | string[], role: string, channelId: string, metadata: JSONType, options: ConnectionOptions, debug: boolean);
/**
* SendRecv Object で発火するイベントのコールバックを設定するメソッド
Expand Down
17 changes: 14 additions & 3 deletions dist/sora.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* sora-js-sdk
* WebRTC SFU Sora JavaScript SDK
* @version: 2022.3.1
* @version: 2022.3.2
* @author: Shiguredo Inc.
* @license: Apache-2.0
**/
Expand Down Expand Up @@ -2252,7 +2252,7 @@
}
const message = {
type: "connect",
sora_client: "Sora JavaScript SDK 2022.3.1",
sora_client: "Sora JavaScript SDK 2022.3.2",
environment: window.navigator.userAgent,
role: role,
channel_id: channelId,
Expand Down Expand Up @@ -2598,6 +2598,10 @@
* カスタム音声コーデックが有効になっていない場合には空のままとなる
*/
this.midToAudioCodecType = new Map();
/**
* キーとなる sender が setupSenderTransform で初期化済みかどうか
*/
this.senderStreamInitialized = new WeakSet();
this.role = role;
this.channelId = channelId;
this.metadata = metadata;
Expand Down Expand Up @@ -2810,6 +2814,7 @@
}
stream.addTrack(audioTrack);
await transceiver.sender.replaceTrack(audioTrack);
await this.setupSenderTransform(transceiver.sender);
}
/**
* video track を入れ替えするメソッド
Expand Down Expand Up @@ -2840,6 +2845,7 @@
}
stream.addTrack(videoTrack);
await transceiver.sender.replaceTrack(videoTrack);
await this.setupSenderTransform(transceiver.sender);
}
/**
* connect 処理中に例外が発生した場合の切断処理をするメソッド
Expand Down Expand Up @@ -3741,6 +3747,10 @@
if ((this.e2ee === null && this.lyra === undefined) || sender.track === null) {
return;
}
// 既に初期化済み
if (this.senderStreamInitialized.has(sender)) {
return;
}
// TODO(sile): WebRTC Encoded Transform の型が提供されるようになったら ignore を外す
// @ts-ignore
// eslint-disable-next-line
Expand All @@ -3760,6 +3770,7 @@
else {
readable.pipeTo(senderStreams.writable).catch((e) => console.warn(e));
}
this.senderStreamInitialized.add(sender);
}
/**
* E2EE あるいはカスタムコーデックが有効になっている場合に、受信側の WebRTC Encoded Transform をセットアップする
Expand Down Expand Up @@ -5154,7 +5165,7 @@
* @public
*/
version: function () {
return "2022.3.1";
return "2022.3.2";
},
/**
* WebRTC のユーティリティ関数群
Expand Down
17 changes: 14 additions & 3 deletions dist/sora.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* sora-js-sdk
* WebRTC SFU Sora JavaScript SDK
* @version: 2022.3.1
* @version: 2022.3.2
* @author: Shiguredo Inc.
* @license: Apache-2.0
**/
Expand Down Expand Up @@ -2246,7 +2246,7 @@ function createSignalingMessage(offerSDP, role, channelId, metadata, options, re
}
const message = {
type: "connect",
sora_client: "Sora JavaScript SDK 2022.3.1",
sora_client: "Sora JavaScript SDK 2022.3.2",
environment: window.navigator.userAgent,
role: role,
channel_id: channelId,
Expand Down Expand Up @@ -2592,6 +2592,10 @@ class ConnectionBase {
* カスタム音声コーデックが有効になっていない場合には空のままとなる
*/
this.midToAudioCodecType = new Map();
/**
* キーとなる sender が setupSenderTransform で初期化済みかどうか
*/
this.senderStreamInitialized = new WeakSet();
this.role = role;
this.channelId = channelId;
this.metadata = metadata;
Expand Down Expand Up @@ -2804,6 +2808,7 @@ class ConnectionBase {
}
stream.addTrack(audioTrack);
await transceiver.sender.replaceTrack(audioTrack);
await this.setupSenderTransform(transceiver.sender);
}
/**
* video track を入れ替えするメソッド
Expand Down Expand Up @@ -2834,6 +2839,7 @@ class ConnectionBase {
}
stream.addTrack(videoTrack);
await transceiver.sender.replaceTrack(videoTrack);
await this.setupSenderTransform(transceiver.sender);
}
/**
* connect 処理中に例外が発生した場合の切断処理をするメソッド
Expand Down Expand Up @@ -3735,6 +3741,10 @@ class ConnectionBase {
if ((this.e2ee === null && this.lyra === undefined) || sender.track === null) {
return;
}
// 既に初期化済み
if (this.senderStreamInitialized.has(sender)) {
return;
}
// TODO(sile): WebRTC Encoded Transform の型が提供されるようになったら ignore を外す
// @ts-ignore
// eslint-disable-next-line
Expand All @@ -3754,6 +3764,7 @@ class ConnectionBase {
else {
readable.pipeTo(senderStreams.writable).catch((e) => console.warn(e));
}
this.senderStreamInitialized.add(sender);
}
/**
* E2EE あるいはカスタムコーデックが有効になっている場合に、受信側の WebRTC Encoded Transform をセットアップする
Expand Down Expand Up @@ -5148,7 +5159,7 @@ var sora = {
* @public
*/
version: function () {
return "2022.3.1";
return "2022.3.2";
},
/**
* WebRTC のユーティリティ関数群
Expand Down
13 changes: 8 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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": "2022.3.1",
"version": "2022.3.2",
"description": "WebRTC SFU Sora JavaScript SDK",
"main": "dist/sora.js",
"module": "dist/sora.mjs",
Expand Down
11 changes: 11 additions & 0 deletions packages/sdk/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ export default class ConnectionBase {
* Lyra インスタンス
*/
private lyra?: LyraState;
/**
* キーとなる sender が setupSenderTransform で初期化済みかどうか
*/
private senderStreamInitialized: WeakSet<RTCRtpSender> = new WeakSet();

constructor(
signalingUrlCandidates: string | string[],
Expand Down Expand Up @@ -421,6 +425,7 @@ export default class ConnectionBase {
}
stream.addTrack(audioTrack);
await transceiver.sender.replaceTrack(audioTrack);
await this.setupSenderTransform(transceiver.sender);
}

/**
Expand Down Expand Up @@ -452,6 +457,7 @@ export default class ConnectionBase {
}
stream.addTrack(videoTrack);
await transceiver.sender.replaceTrack(videoTrack);
await this.setupSenderTransform(transceiver.sender);
}

/**
Expand Down Expand Up @@ -1390,6 +1396,10 @@ export default class ConnectionBase {
if ((this.e2ee === null && this.lyra === undefined) || sender.track === null) {
return;
}
// 既に初期化済み
if (this.senderStreamInitialized.has(sender)) {
return;
}

// TODO(sile): WebRTC Encoded Transform の型が提供されるようになったら ignore を外す
// @ts-ignore
Expand All @@ -1409,6 +1419,7 @@ export default class ConnectionBase {
} else {
readable.pipeTo(senderStreams.writable).catch((e) => console.warn(e));
}
this.senderStreamInitialized.add(sender);
}

/**
Expand Down

0 comments on commit 6a55d1a

Please sign in to comment.