@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.
- package/dist/watchtogether-sdk.js +24674 -21948
- package/dist/watchtogether-sdk.js.map +1 -1
- package/dist/watchtogether-sdk.min.js +2 -2
- package/example/index.html +7 -1
- package/package.json +1 -1
- package/src/models/auth.js +1 -1
- package/src/models/room.js +1 -1
- package/src/modules/wt-room.js +15 -1
package/example/index.html
CHANGED
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
console.log('Iot message:', r);
|
|
223
223
|
});
|
|
224
224
|
|
|
225
|
-
Instance.auth.
|
|
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
package/src/models/auth.js
CHANGED
package/src/models/room.js
CHANGED
|
@@ -354,7 +354,7 @@ let room = function () {
|
|
|
354
354
|
},
|
|
355
355
|
|
|
356
356
|
destroySessions: () => {
|
|
357
|
-
roomSessions.forEach(session => session.destroy().catch(e => this.
|
|
357
|
+
roomSessions.forEach(session => session.destroy().catch(e => this.__privates.room._log(e)));
|
|
358
358
|
roomSessions.length = 0;
|
|
359
359
|
},
|
|
360
360
|
|
package/src/modules/wt-room.js
CHANGED
|
@@ -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 =
|
|
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 => {
|