@reactoo/watchtogether-sdk-js 2.5.30 → 2.5.31

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.
@@ -32,7 +32,6 @@
32
32
  <input type="number" id="connection-timeout" placeholder="5000" min="0">
33
33
 
34
34
  <br><br>
35
-
36
35
  <button type="submit" id="join-room">Create users and join room</button>
37
36
 
38
37
  <button type="button" id="leave-room" onclick="leaveParticipants()">Leave room</button>
@@ -52,7 +51,7 @@
52
51
 
53
52
  let participantsCount = 3;
54
53
  let instanceType = "reactooDemo";
55
- let roomId = "0512f218-6a4a-45e1-9d05-d5a0e5afb33d";
54
+ let roomId = "2e705d79-aaa9-4790-a3d7-512858f60932";
56
55
  let pinHash = undefined;
57
56
  let timeoutBetweenParticipantsJoins = 5000;
58
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.5.30",
3
+ "version": "2.5.31",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -964,6 +964,9 @@ class RoomSession {
964
964
  if (this.disconnectingPromise) {
965
965
  return this.disconnectingPromise;
966
966
  }
967
+
968
+ let _hasJoined = this._hasJoined;
969
+
967
970
  clearTimeout(this._messageTimeoutId);
968
971
  clearTimeout(this._dataChannelTimeoutId);
969
972
  this._stopKeepAlive();
@@ -980,7 +983,7 @@ class RoomSession {
980
983
  this._hasJoined = false;
981
984
  this.emit('published', {status: false, hasStream: false});
982
985
  this.emit('joined', false);
983
- this.emit('disconnect');
986
+ this.emit('disconnect', _hasJoined);
984
987
  return Promise.resolve('Disconnected');
985
988
  })
986
989
  return this.disconnectingPromise;
@@ -1050,6 +1053,9 @@ class RoomSession {
1050
1053
  if (this.disconnectingPromise) {
1051
1054
  return this.disconnectingPromise;
1052
1055
  }
1056
+
1057
+ let _isStreaming = this._isStreaming;
1058
+
1053
1059
  this._stopKeepAlive();
1054
1060
  this.disconnectingPromise = this.sendMessage(this.handleId, {
1055
1061
  body: {
@@ -1067,7 +1073,7 @@ class RoomSession {
1067
1073
  this._isStreaming = false;
1068
1074
  this.emit('streaming', false);
1069
1075
  // last event
1070
- this.emit('disconnect');
1076
+ this.emit('disconnect', _isStreaming);
1071
1077
  this.disconnectingPromise = null;
1072
1078
  return Promise.resolve('Disconnected');
1073
1079
  });