@100mslive/hms-video-store 0.2.53 → 0.2.55
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/hms-video-store.cjs.development.js +21 -10
- package/dist/hms-video-store.cjs.development.js.map +1 -1
- package/dist/hms-video-store.cjs.production.min.js +1 -1
- package/dist/hms-video-store.cjs.production.min.js.map +1 -1
- package/dist/hms-video-store.esm.js +21 -10
- package/dist/hms-video-store.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/core/hmsSDKStore/HMSSDKActions.ts +23 -11
package/package.json
CHANGED
|
@@ -1056,20 +1056,28 @@ export class HMSSDKActions implements IHMSActions {
|
|
|
1056
1056
|
}, action);
|
|
1057
1057
|
};
|
|
1058
1058
|
|
|
1059
|
-
private syncTrackState = (
|
|
1059
|
+
private syncTrackState = (
|
|
1060
|
+
action: 'trackAdded' | 'trackUpdate',
|
|
1061
|
+
track: SDKHMSTrack,
|
|
1062
|
+
peer: sdkTypes.HMSPeer,
|
|
1063
|
+
) => {
|
|
1060
1064
|
console.time('trackUpdate');
|
|
1061
1065
|
this.setState(draftStore => {
|
|
1062
1066
|
const draftPeer = draftStore.peers[peer.peerId];
|
|
1063
1067
|
const hmsTrack = SDKToHMS.convertTrack(track);
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
if (hmsTrack.
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1068
|
+
if (action === 'trackAdded') {
|
|
1069
|
+
draftStore.tracks[track.trackId] = hmsTrack;
|
|
1070
|
+
if (hmsTrack.source === 'regular') {
|
|
1071
|
+
if (hmsTrack.type === 'audio') {
|
|
1072
|
+
draftPeer.audioTrack = hmsTrack.id;
|
|
1073
|
+
} else {
|
|
1074
|
+
draftPeer.videoTrack = hmsTrack.id;
|
|
1075
|
+
}
|
|
1076
|
+
} else if (!draftPeer.auxiliaryTracks.includes(hmsTrack.id)) {
|
|
1077
|
+
draftPeer.auxiliaryTracks.push(hmsTrack.id);
|
|
1070
1078
|
}
|
|
1071
|
-
} else
|
|
1072
|
-
|
|
1079
|
+
} else {
|
|
1080
|
+
Object.assign(draftStore.tracks[hmsTrack.id], hmsTrack);
|
|
1073
1081
|
}
|
|
1074
1082
|
this.hmsSDKTracks[hmsTrack.id] = track;
|
|
1075
1083
|
}, action);
|
|
@@ -1095,8 +1103,12 @@ export class HMSSDKActions implements IHMSActions {
|
|
|
1095
1103
|
delete this.hmsSDKPeers[sdkPeer.peerId];
|
|
1096
1104
|
} else {
|
|
1097
1105
|
const hmsPeer = SDKToHMS.convertPeer(sdkPeer);
|
|
1098
|
-
draftStore.peers[hmsPeer.id]
|
|
1099
|
-
|
|
1106
|
+
if (draftStore.peers[hmsPeer.id]) {
|
|
1107
|
+
Object.assign(draftStore.peers[hmsPeer.id], hmsPeer);
|
|
1108
|
+
} else {
|
|
1109
|
+
draftStore.peers[hmsPeer.id] = hmsPeer as HMSPeer;
|
|
1110
|
+
draftStore.room.peers.push(hmsPeer.id);
|
|
1111
|
+
}
|
|
1100
1112
|
this.hmsSDKPeers[sdkPeer.peerId] = sdkPeer;
|
|
1101
1113
|
}
|
|
1102
1114
|
}, actionName);
|