@reactoo/watchtogether-sdk-js 2.6.89 → 2.6.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/package.json
CHANGED
package/src/modules/wt-room.js
CHANGED
|
@@ -968,7 +968,6 @@ class RoomSession {
|
|
|
968
968
|
stats: {},
|
|
969
969
|
selectedSubstream: {},
|
|
970
970
|
initialSimulcastSubstreamBeenSet: {},
|
|
971
|
-
simulcastSubstreamManualSelect: {},
|
|
972
971
|
simulcastSwitchFailedAttempts: {},
|
|
973
972
|
};
|
|
974
973
|
|
|
@@ -1026,7 +1025,6 @@ class RoomSession {
|
|
|
1026
1025
|
stats: {},
|
|
1027
1026
|
selectedSubstream: {},
|
|
1028
1027
|
initialSimulcastSubstreamBeenSet: {},
|
|
1029
|
-
simulcastSubstreamManualSelect: {},
|
|
1030
1028
|
simulcastSwitchFailedAttempts: {},
|
|
1031
1029
|
}
|
|
1032
1030
|
};
|
|
@@ -1581,7 +1579,6 @@ class RoomSession {
|
|
|
1581
1579
|
}
|
|
1582
1580
|
|
|
1583
1581
|
const initialSubstreamBeenSet = !!p.webrtcStuff.initialSimulcastSubstreamBeenSet[mid];
|
|
1584
|
-
const manualSelectedSubstream = p.webrtcStuff.simulcastSubstreamManualSelect?.[mid];
|
|
1585
1582
|
const defaultSelectedSubstream = typeof this.simulcastDefaultManualSubstream === 'object'
|
|
1586
1583
|
? (this.simulcastDefaultManualSubstream[source] !== undefined
|
|
1587
1584
|
? this.simulcastDefaultManualSubstream[source]
|
|
@@ -1592,28 +1589,14 @@ class RoomSession {
|
|
|
1592
1589
|
: this.simulcastMode;
|
|
1593
1590
|
const failedAttempts = p.webrtcStuff.simulcastSwitchFailedAttempts[mid] || 0;
|
|
1594
1591
|
|
|
1595
|
-
if((simulcastMode === 'auto'
|
|
1592
|
+
if((simulcastMode === 'auto') /* || failedAttempts > 3 */) {
|
|
1596
1593
|
// do nothing
|
|
1597
1594
|
}
|
|
1598
1595
|
|
|
1599
|
-
else if(simulcastMode === 'manual' ||
|
|
1596
|
+
else if(simulcastMode === 'manual' || !initialSubstreamBeenSet) {
|
|
1600
1597
|
p.webrtcStuff.initialSimulcastSubstreamBeenSet[mid] = true;
|
|
1601
1598
|
const currentSubstream = p.webrtcStuff.selectedSubstream[mid];
|
|
1602
|
-
if(
|
|
1603
|
-
this.selectSubStream(p.handleId, manualSelectedSubstream, undefined, mid, false)
|
|
1604
|
-
.then(() => {
|
|
1605
|
-
p.webrtcStuff.simulcastSwitchFailedAttempts[mid] = 0
|
|
1606
|
-
})
|
|
1607
|
-
.catch(() => {
|
|
1608
|
-
if(!p.webrtcStuff.simulcastSwitchFailedAttempts[mid]) {
|
|
1609
|
-
p.webrtcStuff.simulcastSwitchFailedAttempts[mid] = 1;
|
|
1610
|
-
}
|
|
1611
|
-
else {
|
|
1612
|
-
p.webrtcStuff.simulcastSwitchFailedAttempts[mid]++;
|
|
1613
|
-
}
|
|
1614
|
-
});
|
|
1615
|
-
}
|
|
1616
|
-
else if(defaultSelectedSubstream !== undefined && defaultSelectedSubstream !== null && defaultSelectedSubstream !== currentSubstream) {
|
|
1599
|
+
if(defaultSelectedSubstream !== undefined && defaultSelectedSubstream !== null && defaultSelectedSubstream !== currentSubstream) {
|
|
1617
1600
|
this.selectSubStream(p.handleId, defaultSelectedSubstream, undefined, mid, false)
|
|
1618
1601
|
.then(() => {
|
|
1619
1602
|
p.webrtcStuff.simulcastSwitchFailedAttempts[mid] = 0
|
|
@@ -2972,9 +2955,9 @@ class RoomSession {
|
|
|
2972
2955
|
}
|
|
2973
2956
|
}
|
|
2974
2957
|
|
|
2975
|
-
selectSubStream(handleId, substream = 2, source, mid
|
|
2958
|
+
selectSubStream(handleId, substream = 2, source, mid) {
|
|
2976
2959
|
|
|
2977
|
-
this._log('Select SubStream attempt', handleId, substream, source, mid
|
|
2960
|
+
this._log('Select SubStream attempt', handleId, substream, source, mid);
|
|
2978
2961
|
|
|
2979
2962
|
let handle = this._getHandle(handleId);
|
|
2980
2963
|
if(!handle) {
|
|
@@ -3000,11 +2983,6 @@ class RoomSession {
|
|
|
3000
2983
|
clearTimeout(messageTimeoutId);
|
|
3001
2984
|
this._abortController.signal.removeEventListener('abort', abortResponse);
|
|
3002
2985
|
this.ws.removeEventListener('message', parseResponse);
|
|
3003
|
-
|
|
3004
|
-
if(manual) {
|
|
3005
|
-
config.simulcastSubstreamManualSelect[mid] = substream;
|
|
3006
|
-
}
|
|
3007
|
-
|
|
3008
2986
|
resolve({substream, sender});
|
|
3009
2987
|
}
|
|
3010
2988
|
}
|
|
@@ -3023,8 +3001,7 @@ class RoomSession {
|
|
|
3023
3001
|
}
|
|
3024
3002
|
if(mid !== undefined) {
|
|
3025
3003
|
|
|
3026
|
-
if(
|
|
3027
|
-
config.simulcastSubstreamManualSelect[mid] = substream;
|
|
3004
|
+
if(substream === null) {
|
|
3028
3005
|
resolve({substream, sender: handleId});
|
|
3029
3006
|
return;
|
|
3030
3007
|
}
|