@reactoo/watchtogether-sdk-js 2.7.90 → 2.7.91
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/example/index.html
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
//https://studio.reactoo.com/room/edf441b3-7415-49c4-9557-273cb93bc746/LJj4W2Cz-nG3U-lb0R-TAaY-o7Thmb8xHSbE
|
|
34
34
|
|
|
35
|
-
let roomId = "
|
|
35
|
+
let roomId = "5703bcd6-a11e-4a73-bd14-12ed57227a8c"; // It will create room automatically if not set
|
|
36
36
|
let pinHash = null;
|
|
37
37
|
|
|
38
38
|
let participants = document.querySelector('.participants');
|
package/package.json
CHANGED
package/src/modules/wt-room.js
CHANGED
|
@@ -254,12 +254,12 @@ class RoomSession {
|
|
|
254
254
|
this.apisecret = null;
|
|
255
255
|
this.handleId = null;
|
|
256
256
|
this.ws = null;
|
|
257
|
+
this.isSupposeToBeConnected = false;
|
|
257
258
|
this.isRestarting = false;
|
|
258
259
|
this.isConnecting = false;
|
|
259
260
|
this.isDisconnecting = false;
|
|
260
261
|
this.isConnected = false;
|
|
261
262
|
this.isPublished = false;
|
|
262
|
-
this.isReclaiming = false;
|
|
263
263
|
this.isStreaming = false;
|
|
264
264
|
this.isMuted = [];
|
|
265
265
|
this.isVideoEnabled = false;
|
|
@@ -618,6 +618,12 @@ class RoomSession {
|
|
|
618
618
|
}
|
|
619
619
|
|
|
620
620
|
_longPoll() {
|
|
621
|
+
|
|
622
|
+
if(!this.isSupposeToBeConnected) {
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
|
|
621
627
|
let longpoll = this.server + "/" + this.sessionId + "?rid=" + new Date().getTime();
|
|
622
628
|
if(this._maxev)
|
|
623
629
|
longpoll = longpoll + "&maxev=" + this._maxev;
|
|
@@ -1612,6 +1618,8 @@ class RoomSession {
|
|
|
1612
1618
|
enableDtx = false
|
|
1613
1619
|
) {
|
|
1614
1620
|
|
|
1621
|
+
this.isSupposeToBeConnected = true;
|
|
1622
|
+
|
|
1615
1623
|
if (this.isConnecting) {
|
|
1616
1624
|
return Promise.reject({type: 'warning', id: 16, message: 'connection already in progress'});
|
|
1617
1625
|
}
|
|
@@ -1657,6 +1665,8 @@ class RoomSession {
|
|
|
1657
1665
|
|
|
1658
1666
|
disconnect() {
|
|
1659
1667
|
|
|
1668
|
+
this.isSupposeToBeConnected = false;
|
|
1669
|
+
|
|
1660
1670
|
if (this.isDisconnecting) {
|
|
1661
1671
|
return Promise.resolve();
|
|
1662
1672
|
}
|
|
@@ -1689,6 +1699,8 @@ class RoomSession {
|
|
|
1689
1699
|
|
|
1690
1700
|
startStream(streamId, server, iceServers, token, userId) {
|
|
1691
1701
|
|
|
1702
|
+
this.isSupposeToBeConnected = true;
|
|
1703
|
+
|
|
1692
1704
|
if (this.isConnecting) {
|
|
1693
1705
|
return Promise.reject({type: 'warning', id: 16, message: 'connection error', data: 'Connection is in progress'});
|
|
1694
1706
|
}
|