@reactoo/watchtogether-sdk-js 2.5.98 → 2.6.0

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.98",
3
+ "version": "2.6.0",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
@@ -71,7 +71,7 @@ let roomSession = function ({roomId, pinHash, role}, room, wt) {
71
71
  return room.constructId;
72
72
  },
73
73
 
74
- destroy: function () {
74
+ kill: function () {
75
75
  clearTimeout(alpTimeoutId);
76
76
  this.detachPlayer();
77
77
  return room.destroy()
@@ -81,6 +81,11 @@ let roomSession = function ({roomId, pinHash, role}, room, wt) {
81
81
  });
82
82
  },
83
83
 
84
+ destroy: function() {
85
+ return wt.room.destroySession(room.constructId)
86
+ },
87
+
88
+
84
89
  iceRestart: function () {
85
90
  return room._iceRestart(room.handleId);
86
91
  },
@@ -313,7 +313,7 @@ let room = function () {
313
313
  destroySession: (constructId) => {
314
314
  let sessionIndex = roomSessions.findIndex(session => session.constructId === constructId);
315
315
  if (sessionIndex > -1) {
316
- return roomSessions[sessionIndex].destroy()
316
+ return roomSessions[sessionIndex].kill()
317
317
  .finally(() => {
318
318
  roomSessions.splice(sessionIndex, 1);
319
319
  return true
@@ -325,7 +325,7 @@ let room = function () {
325
325
  destroySessionBySessionId: (sessionId) => {
326
326
  let sessionIndex = roomSessions.findIndex(session => session.sessionId === sessionId);
327
327
  if (sessionIndex > -1) {
328
- return roomSessions[sessionIndex].destroy()
328
+ return roomSessions[sessionIndex].kill()
329
329
  .finally(() => {
330
330
  roomSessions.splice(sessionIndex, 1);
331
331
  return true
@@ -19,7 +19,7 @@ let streamingSession = function({roomId, pinHash, streamId, href, iceServers, a
19
19
  return room.constructId;
20
20
  },
21
21
 
22
- destroy: function () {
22
+ kill: function () {
23
23
  return room.destroy()
24
24
  .finally(() => {
25
25
  this.$clear();
@@ -27,6 +27,10 @@ let streamingSession = function({roomId, pinHash, streamId, href, iceServers, a
27
27
  });
28
28
  },
29
29
 
30
+ destroy: function() {
31
+ return wt.room.destroySession(room.constructId)
32
+ },
33
+
30
34
  connect: function() {
31
35
  if(roomId) {
32
36
  return Promise.all([wt.room.getRoomById(roomId, pinHash), wt.user.getUserSelf()])
@@ -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) {