@reactoo/watchtogether-sdk-js 2.7.81 → 2.7.83

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.
@@ -222,7 +222,7 @@
222
222
  console.log('Iot message:', r);
223
223
  });
224
224
 
225
- Instance.auth.deviceLogin(true) // login as browser
225
+ Instance.auth.login('dusan1','abc123ABC') // login as browser
226
226
  .then(r => Instance.iot.iotLogin()) // login to mqtt
227
227
  .then(r => {
228
228
  if(roomId) {
@@ -527,6 +527,12 @@
527
527
  sess.sendSystemMessage('customData', {some: 'data'})
528
528
  }
529
529
 
530
+ window.testUnsetAttributesObject = function() {
531
+ Instance.room.updateAttribute({id:'boha', roomId: roomId, operation: 'setAll', attributeName:'layoutAttributes', value: {cicina:'kuchyna'}})
532
+ .then(r => console.log(r))
533
+ .catch(e => console.log(e))
534
+ }
535
+
530
536
  </script>
531
537
 
532
538
  </body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.7.81",
3
+ "version": "2.7.83",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "dist/watchtogether-sdk.min.js",
6
6
  "module": "dist/watchtogether-sdk.min.js",
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- import {wait, getBrowserFingerprint} from "./utils";
3
+ import {getBrowserFingerprint} from "./utils";
4
4
 
5
5
  let auth = function () {
6
6
  return {
@@ -354,7 +354,7 @@ let room = function () {
354
354
  },
355
355
 
356
356
  destroySessions: () => {
357
- roomSessions.forEach(session => session.destroy().catch(e => this.log(e)));
357
+ roomSessions.forEach(session => session.destroy().catch(e => this.__privates.room._log(e)));
358
358
  roomSessions.length = 0;
359
359
  },
360
360
 
@@ -6,6 +6,10 @@ import {decodeJanusDisplay, generateUUID, maxJitter, median, wait} from "../mode
6
6
 
7
7
  class Room {
8
8
 
9
+ static noop() {
10
+
11
+ }
12
+
9
13
  constructor(debug) {
10
14
  this.debug = debug;
11
15
  this.sessions = [];
@@ -19,10 +23,19 @@ class Room {
19
23
  this.safariVp8 = safariVp8;
20
24
  })
21
25
 
26
+ this._log = Room.noop;
27
+ if (this.debug) {
28
+ this._enableDebug();
29
+ }
30
+
22
31
  // Let's get it started
23
32
  this.whenInitialized = this.initialize();
24
33
  }
25
34
 
35
+ _enableDebug() {
36
+ this._log = console.log.bind(console);
37
+ }
38
+
26
39
  initialize() {
27
40
  return this.safariVp8TestPromise
28
41
  .then(() => this);
@@ -260,7 +273,7 @@ class RoomSession {
260
273
  this._aqIntervalCounter = 0;
261
274
  this._aqIntervalDivisor = 4;
262
275
  this._aqTimeoutId = null;
263
- this._sendMessageTimeout = 5000;
276
+ this._sendMessageTimeout = 10000;
264
277
  this._retries = 0;
265
278
  this._maxRetries = 5;
266
279
  this._keepAliveId = null;
@@ -498,6 +511,7 @@ class RoomSession {
498
511
  }
499
512
 
500
513
  if (this._retries < this._maxRetries) {
514
+ //TODO: clear this timeout
501
515
  setTimeout(() => {
502
516
  this._retries++;
503
517
  this._reconnect().catch(e => {