@reactoo/watchtogether-sdk-js 2.6.39 → 2.6.41

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.39",
3
+ "version": "2.6.41",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -2342,7 +2342,12 @@ 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: 'warning', id: 21, message: 'no local id, connect first', data: null})
2345
+ this.emit('error', {
2346
+ type: 'warning',
2347
+ id: 21,
2348
+ message: 'no local id, connect first', data: null
2349
+ });
2350
+ return;
2346
2351
  }
2347
2352
  let config = handle.webrtcStuff;
2348
2353
  let transceivers = config.pc?.getTransceivers();
@@ -2374,7 +2379,12 @@ class RoomSession {
2374
2379
  toggleVideo(value = null, source = 'camera0', mid) {
2375
2380
  let handle = this._getHandle(this.handleId);
2376
2381
  if (!handle) {
2377
- return Promise.reject({type: 'warning', id: 21, message: 'no local id, connect first', data: null})
2382
+ this.emit('error', {
2383
+ type: 'warning',
2384
+ id: 21,
2385
+ message: 'no local id, connect first', data: null
2386
+ });
2387
+ return;
2378
2388
  }
2379
2389
  let config = handle.webrtcStuff;
2380
2390
  let transceivers = config.pc?.getTransceivers();