Implement video encryption

This commit is contained in:
2025-10-11 15:24:25 +03:00
Unverified
parent caf595e968
commit 3575fb3752
5 changed files with 270 additions and 82 deletions
+12 -6
View File
@@ -138,26 +138,32 @@ export class CallSignalingHandler {
private handleVideoToggle(data: any) {
console.log("handleVideoToggle called with data:", data);
const state = this.getState();
const { data: toggleData } = data;
const { fromUserId, data: toggleData } = data;
if (toggleData && typeof toggleData.enabled === "boolean") {
if (toggleData && typeof toggleData.enabled === "boolean" && fromUserId) {
console.log("Setting remote video enabled to:", toggleData.enabled);
// Update Zustand state (for UI)
state.setRemoteVideoEnabled(toggleData.enabled);
// Update WebRTC internal state (for track routing)
WebRTC.setRemoteVideoEnabled(fromUserId, toggleData.enabled);
} else {
console.warn("Invalid toggle data:", toggleData);
console.warn("Invalid toggle data:", data);
}
}
private handleScreenShareToggle(data: any) {
console.log("handleScreenShareToggle called with data:", data);
const state = this.getState();
const { data: toggleData } = data;
const { fromUserId, data: toggleData } = data;
if (toggleData && typeof toggleData.enabled === "boolean") {
if (toggleData && typeof toggleData.enabled === "boolean" && fromUserId) {
console.log("Setting remote screen sharing to:", toggleData.enabled);
// Update Zustand state (for UI)
state.setRemoteScreenSharing(toggleData.enabled);
// Update WebRTC internal state (for track routing)
WebRTC.setRemoteScreenSharing(fromUserId, toggleData.enabled);
} else {
console.warn("Invalid toggle data:", toggleData);
console.warn("Invalid toggle data:", data);
}
}
}