@reactoo/watchtogether-sdk-js 2.6.74 → 2.6.76
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/dist/watchtogether-sdk.js +2 -2
- package/dist/watchtogether-sdk.min.js +2 -2
- package/example/bulk_join_room/bulk_join_room_2.css +1 -1
- package/example/bulk_join_room/bulk_join_room_2.html +775 -719
- package/example/index.html +1 -1
- package/package.json +1 -1
- package/src/modules/wt-room.js +9 -4
package/example/index.html
CHANGED
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
.then(r => Instance.room.createSession({constructId, roomId:r.roomId, pinHash: r.pinHash, role:'participant', options: {
|
|
213
213
|
simulcast: true,
|
|
214
214
|
simulcastMode: {default: 'controlled', screen: 'manual'}, // controlled, manual, auto ... key is the device source (default = all)
|
|
215
|
-
simulcastDefaultManualSubstream: {default:
|
|
215
|
+
simulcastDefaultManualSubstream: {default:0, screen: 0}, // 2 lowest quality, 0 highest quality ... key is the device source (default = all)
|
|
216
216
|
// those are for videowall (see that 4 fps preview for producer panel)
|
|
217
217
|
simulcastBitrates: [
|
|
218
218
|
{ rid: 'l', active: true, maxBitrate: 180000, maxFramerate: 4, scaleResolutionDownBy: 4, priority: "low" },
|
package/package.json
CHANGED
package/src/modules/wt-room.js
CHANGED
|
@@ -966,6 +966,7 @@ class RoomSession {
|
|
|
966
966
|
isIceRestarting: false,
|
|
967
967
|
stats: {},
|
|
968
968
|
selectedSubstream: {},
|
|
969
|
+
initialSimulcastSubstreamBeenSet: {},
|
|
969
970
|
simulcastSubstreamManualSelect: {},
|
|
970
971
|
simulcastSwitchFailedAttempts: {},
|
|
971
972
|
};
|
|
@@ -1023,6 +1024,7 @@ class RoomSession {
|
|
|
1023
1024
|
isIceRestarting: false,
|
|
1024
1025
|
stats: {},
|
|
1025
1026
|
selectedSubstream: {},
|
|
1027
|
+
initialSimulcastSubstreamBeenSet: {},
|
|
1026
1028
|
simulcastSubstreamManualSelect: {},
|
|
1027
1029
|
simulcastSwitchFailedAttempts: {},
|
|
1028
1030
|
}
|
|
@@ -1262,7 +1264,8 @@ class RoomSession {
|
|
|
1262
1264
|
simulcast = false,
|
|
1263
1265
|
simulcastBitrates = this.simulcastBitrates,
|
|
1264
1266
|
simulcastMode = this.simulcastMode,
|
|
1265
|
-
simulcastDefaultManualSubstream = this.simulcastDefaultManualSubstream
|
|
1267
|
+
simulcastDefaultManualSubstream = this.simulcastDefaultManualSubstream,
|
|
1268
|
+
simulcastInitialSubstream = null
|
|
1266
1269
|
) {
|
|
1267
1270
|
|
|
1268
1271
|
if (this.isConnecting) {
|
|
@@ -1571,6 +1574,7 @@ class RoomSession {
|
|
|
1571
1574
|
mids.forEach(mid => {
|
|
1572
1575
|
|
|
1573
1576
|
const {source, simulcastBitrates} = p.webrtcStuff.tracksMap.find(t => t.mid === mid) || {};
|
|
1577
|
+
const initialSubstreamBeenSet = !!p.webrtcStuff.initialSimulcastSubstreamBeenSet[mid];
|
|
1574
1578
|
const manualSelectedSubstream = p.webrtcStuff.simulcastSubstreamManualSelect?.[mid];
|
|
1575
1579
|
const defaultSelectedSubstream = typeof this.simulcastDefaultManualSubstream === 'object'
|
|
1576
1580
|
? (this.simulcastDefaultManualSubstream[source] !== undefined ? this.simulcastDefaultManualSubstream[source] : this.simulcastDefaultManualSubstream['default'])
|
|
@@ -1584,9 +1588,10 @@ class RoomSession {
|
|
|
1584
1588
|
// do nothing
|
|
1585
1589
|
}
|
|
1586
1590
|
|
|
1587
|
-
else if(simulcastMode === 'manual' || manualSelectedSubstream) {
|
|
1591
|
+
else if(simulcastMode === 'manual' || manualSelectedSubstream || !initialSubstreamBeenSet) {
|
|
1592
|
+
p.webrtcStuff.initialSimulcastSubstreamBeenSet[mid] = true;
|
|
1588
1593
|
const currentSubstream = p.webrtcStuff.selectedSubstream[mid];
|
|
1589
|
-
if(manualSelectedSubstream && currentSubstream !== manualSelectedSubstream) {
|
|
1594
|
+
if(manualSelectedSubstream !== undefined && manualSelectedSubstream !== null && currentSubstream !== manualSelectedSubstream) {
|
|
1590
1595
|
this.selectSubStream(p.handleId, manualSelectedSubstream, undefined, mid, false)
|
|
1591
1596
|
.then(() => {
|
|
1592
1597
|
p.webrtcStuff.simulcastSwitchFailedAttempts[mid] = 0
|
|
@@ -1600,7 +1605,7 @@ class RoomSession {
|
|
|
1600
1605
|
}
|
|
1601
1606
|
});
|
|
1602
1607
|
}
|
|
1603
|
-
else if(defaultSelectedSubstream !== currentSubstream) {
|
|
1608
|
+
else if(defaultSelectedSubstream !== undefined && defaultSelectedSubstream !== null && defaultSelectedSubstream !== currentSubstream) {
|
|
1604
1609
|
this.selectSubStream(p.handleId, defaultSelectedSubstream, undefined, mid, false)
|
|
1605
1610
|
.then(() => {
|
|
1606
1611
|
p.webrtcStuff.simulcastSwitchFailedAttempts[mid] = 0
|