@reactoo/watchtogether-sdk-js 2.5.77 → 2.5.79

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.
@@ -17,7 +17,7 @@
17
17
  <button onclick="unpublish()">unpublish</button>
18
18
  <button onclick="toggleVideo()">toggle video</button>
19
19
  <button onclick="toggleAudio()">toggle audio</button>
20
- <button onclick="hento()">sign to goole</button>
20
+ <button onclick="hento()">get client</button>
21
21
  </div>
22
22
 
23
23
  </div>
@@ -44,9 +44,9 @@
44
44
 
45
45
  function hento() {
46
46
  //Instance.system.getSettings();
47
- Instance.auth.socialAuth({provider: 'youtube', action: 'generateAuthUrl'})
47
+ Instance.system.getClient()
48
48
  .then(r => {
49
- window.open(r.data.redirectUrl);
49
+ console.log(r)
50
50
  })
51
51
 
52
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.5.77",
3
+ "version": "2.5.79",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -208,11 +208,11 @@ let room = function () {
208
208
 
209
209
  },
210
210
 
211
- roomRecorder: ({roomId, operation = 'get', config} = {}) => {
211
+ roomRecorder: ({roomId, operation = 'get', config, destinationIds} = {}) => {
212
212
  return this.__privates.auth.__client
213
213
  .then(client => client.apis.wt.recordRoom({}, {
214
214
  requestBody: {
215
- roomId, operation, config
215
+ roomId, operation, config, destinationIds
216
216
  }
217
217
  }))
218
218
  },
@@ -75,6 +75,12 @@ let system = function () {
75
75
  return this.__privates.auth.__client.then(client => {
76
76
  return client.spec?.components?.schemas
77
77
  })
78
+ },
79
+
80
+ getClient: () => {
81
+ return this.__privates.auth.__client.then(client => {
82
+ return client
83
+ });
78
84
  }
79
85
  }
80
86
  }
@@ -186,7 +186,6 @@ class RoomSession {
186
186
  this.isReclaiming = false;
187
187
  this.isStreaming = false;
188
188
 
189
- this._ipv6Support = false;
190
189
  this._retries = 0;
191
190
  this._maxRetries = 3;
192
191
  this._keepAliveId = null;
@@ -527,6 +526,8 @@ class RoomSession {
527
526
  let event = msg["videoroom"] || null;
528
527
  let list = msg["publishers"] || {};
529
528
  let leaving = msg["leaving"];
529
+ let kicked = msg["kicked"];
530
+
530
531
  //let joining = msg["joining"];
531
532
  let unpublished = msg["unpublished"];
532
533
  let error = msg["error"];
@@ -609,12 +610,12 @@ class RoomSession {
609
610
  this._removeParticipant(this.handleId);
610
611
  if (msg['reason'] === 'kicked') {
611
612
  this.emit('kicked');
612
- this.disconnect().catch(() => {
613
- });
613
+ this.disconnect().catch(() => {});
614
614
  }
615
615
  } else if (leaving) {
616
+ //TODO: shouldnt we detach?
616
617
  this._log('leaving', leaving);
617
- this._removeParticipant(null, leaving);
618
+ this._removeParticipant(null, leaving, true);
618
619
  }
619
620
 
620
621
  if (unpublished === 'ok') {
@@ -625,6 +626,13 @@ class RoomSession {
625
626
  this._removeParticipant(null, unpublished, true); // we do hangup and detach
626
627
  }
627
628
 
629
+ if(kicked === 'ok') {
630
+ // this case shouldn't exist
631
+ } else if(kicked) {
632
+ this._log('kicked', kicked);
633
+ this._removeParticipant(null, kicked, true); // we do hangup and detach
634
+ }
635
+
628
636
  if (error) {
629
637
  this.emit('error', {
630
638
  type: 'error',
@@ -1249,12 +1257,8 @@ class RoomSession {
1249
1257
 
1250
1258
  pc_config["sdpSemantics"] = this.isUnifiedPlan ? "unified-plan" : "plan-b";
1251
1259
 
1252
- let pc_constraints = {
1253
- "optional": [{"DtlsSrtpKeyAgreement": true}]
1254
- };
1255
- if (this._ipv6Support === true) {
1256
- pc_constraints.optional.push({"googIPv6": true});
1257
- }
1260
+ let pc_constraints = {};
1261
+
1258
1262
  if (adapter.browserDetails.browser === "edge") {
1259
1263
  // This is Edge, enable BUNDLE explicitly
1260
1264
  pc_config.bundlePolicy = "max-bundle";