@reactoo/watchtogether-sdk-js 2.5.99 → 2.6.1

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.5.99",
3
+ "version": "2.6.1",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -71,6 +71,11 @@ let roomSession = function ({roomId, pinHash, role}, room, wt) {
71
71
  return room.constructId;
72
72
  },
73
73
 
74
+ // needs to be called before connect or it doesn't have any effect
75
+ changeUserRole: function (newRole) {
76
+ role = newRole;
77
+ },
78
+
74
79
  kill: function () {
75
80
  clearTimeout(alpTimeoutId);
76
81
  this.detachPlayer();
@@ -85,7 +90,6 @@ let roomSession = function ({roomId, pinHash, role}, room, wt) {
85
90
  return wt.room.destroySession(room.constructId)
86
91
  },
87
92
 
88
-
89
93
  iceRestart: function () {
90
94
  return room._iceRestart(room.handleId);
91
95
  },
@@ -1169,9 +1169,9 @@ class RoomSession {
1169
1169
 
1170
1170
  let isStreaming = this.isStreaming;
1171
1171
  this.isDisconnecting = true;
1172
- return this.sendMessage(this.handleId, {body: {"request": "stop"}}, false, true)
1173
- .then(() => this._removeParticipant(this.handleId))
1172
+ return this._removeParticipant(this.handleId)
1174
1173
  .finally(() => {
1174
+ this.sendMessage(this.handleId, {body: {"request": "stop"}}, true);
1175
1175
  this._wipeListeners();
1176
1176
  this._send({"janus": "destroy"}, true);
1177
1177
  if (this.ws && this.ws.readyState === 1) {