@reactoo/watchtogether-sdk-js 2.6.37 → 2.6.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.6.37",
3
+ "version": "2.6.39",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -2003,7 +2003,7 @@ class RoomSession {
2003
2003
  if (!handle) {
2004
2004
  return Promise.reject({
2005
2005
  type: 'error',
2006
- id: 21,
2006
+ id: 31,
2007
2007
  message: 'no local id, connect before publishing',
2008
2008
  data: null
2009
2009
  })
@@ -2342,10 +2342,10 @@ class RoomSession {
2342
2342
  toggleAudio(value = null, source = 'camera0', mid) {
2343
2343
  let handle = this._getHandle(this.handleId);
2344
2344
  if (!handle) {
2345
- return Promise.reject({type: 'error', id: 21, message: 'no local id, connect first', data: null})
2345
+ return Promise.reject({type: 'warning', id: 21, message: 'no local id, connect first', data: null})
2346
2346
  }
2347
2347
  let config = handle.webrtcStuff;
2348
- let transceivers = config.pc?.getTransceivers()?.filter(t => t.currentDirection !== 'inactive');
2348
+ let transceivers = config.pc?.getTransceivers();
2349
2349
  let transceiver = null;
2350
2350
  if(source) {
2351
2351
  transceiver = transceivers?.find(t => t.sender && t.sender.track && t.receiver.track.kind === "audio" && (config.streamMap[source] || []).includes(t.sender.track.id));
@@ -2374,10 +2374,10 @@ class RoomSession {
2374
2374
  toggleVideo(value = null, source = 'camera0', mid) {
2375
2375
  let handle = this._getHandle(this.handleId);
2376
2376
  if (!handle) {
2377
- return Promise.reject({type: 'error', id: 21, message: 'no local id, connect first', data: null})
2377
+ return Promise.reject({type: 'warning', id: 21, message: 'no local id, connect first', data: null})
2378
2378
  }
2379
2379
  let config = handle.webrtcStuff;
2380
- let transceivers = config.pc?.getTransceivers()?.filter(t => t.currentDirection !== 'inactive');
2380
+ let transceivers = config.pc?.getTransceivers();
2381
2381
  let transceiver = null;
2382
2382
  if(source) {
2383
2383
  transceiver = transceivers?.find(t => t.sender && t.sender.track && t.receiver.track.kind === "video" && (config.streamMap[source] || []).includes(t.sender.track.id));