@reactoo/watchtogether-sdk-js 2.6.81 → 2.6.82
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
|
@@ -1624,17 +1624,18 @@ class RoomSession {
|
|
|
1624
1624
|
else if(simulcastMode === 'controlled') {
|
|
1625
1625
|
const currentSubstream = p.webrtcStuff.selectedSubstream[mid];
|
|
1626
1626
|
const settingsForCurrentSubstream = simulcastBitrates?.[simulcastBitrates.length - 1 - currentSubstream];
|
|
1627
|
+
console.log('test', simulcastBitrates, currentSubstream, settingsForCurrentSubstream)
|
|
1627
1628
|
let directionDecision = 0;
|
|
1628
1629
|
if(p.webrtcStuff?.stats?.[mid]?.length > this._upStatsLength) {
|
|
1629
1630
|
const upMedianStats = this._calculateMedianStats(p.webrtcStuff.stats[mid].slice(this._upStatsLength * -1));
|
|
1630
|
-
if(upMedianStats?.framesPerSecond >= Math.floor(settingsForCurrentSubstream
|
|
1631
|
+
if(upMedianStats?.framesPerSecond >= Math.floor((settingsForCurrentSubstream?.maxFramerate || 30) * 0.7) && upMedianStats?.freezeDurationSinceLast < (this._upStatsLength * this._statsInterval * 0.33) / 1000 && upMedianStats?.freezeCountSinceLast < 3) {
|
|
1631
1632
|
directionDecision = 1;
|
|
1632
1633
|
}
|
|
1633
1634
|
}
|
|
1634
1635
|
|
|
1635
1636
|
if(p.webrtcStuff?.stats?.[mid]?.length > this._downStatsLength) {
|
|
1636
1637
|
const downMedianStats = this._calculateMedianStats(p.webrtcStuff.stats[mid].slice(this._downStatsLength * -1));
|
|
1637
|
-
if(downMedianStats?.framesPerSecond < Math.floor(settingsForCurrentSubstream
|
|
1638
|
+
if(downMedianStats?.framesPerSecond < Math.floor((settingsForCurrentSubstream?.maxFramerate || 30) * 0.7) || downMedianStats?.freezeDurationSinceLast > (this._downStatsLength * this._statsInterval * 0.33) / 1000 || downMedianStats?.freezeCountSinceLast > 5 /* || downMedianStats?.jitter > maxJitter(settingsForCurrentSubstream.maxFramerate) */) {
|
|
1638
1639
|
directionDecision = -1;
|
|
1639
1640
|
}
|
|
1640
1641
|
}
|