Шифрование тест
This commit is contained in:
@@ -324,7 +324,12 @@ export function CallProvider(props : CallProviderProps) {
|
||||
}
|
||||
}
|
||||
|
||||
peerConnectionRef.current.ontrack = (event) => {
|
||||
peerConnectionRef.current.ontrack = async (event) => {
|
||||
try {
|
||||
await attachReceiverE2EE(event.receiver, Buffer.from(sharedSecret, "hex"));
|
||||
} catch (e) {
|
||||
console.error("attachReceiverE2EE failed:", e);
|
||||
}
|
||||
/**
|
||||
* При получении медиа-трека с другой стороны
|
||||
*/
|
||||
@@ -347,13 +352,12 @@ export function CallProvider(props : CallProviderProps) {
|
||||
|
||||
|
||||
const tx = peerConnectionRef.current.addTransceiver(audioTrack, {
|
||||
direction: "sendrecv",
|
||||
streams: [localStream]
|
||||
direction: "sendrecv",
|
||||
streams: [localStream]
|
||||
});
|
||||
|
||||
await attachSenderE2EE(tx.sender, Buffer.from(sharedSecret, "hex"));
|
||||
|
||||
await attachReceiverE2EE(tx.receiver, Buffer.from(sharedSecret, "hex"));
|
||||
/**
|
||||
* Отправляем свой оффер другой стороне
|
||||
*/
|
||||
@@ -365,7 +369,7 @@ export function CallProvider(props : CallProviderProps) {
|
||||
send(offerSignal);
|
||||
return;
|
||||
}
|
||||
}, [activeCall, sessionKeys]);
|
||||
}, [activeCall, sessionKeys, sharedSecret]);
|
||||
|
||||
const openCallsModal = (text : string) => {
|
||||
modals.open({
|
||||
|
||||
Reference in New Issue
Block a user