Шифрование тест
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);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* При получении медиа-трека с другой стороны
|
* При получении медиа-трека с другой стороны
|
||||||
*/
|
*/
|
||||||
@@ -353,7 +358,6 @@ export function CallProvider(props : CallProviderProps) {
|
|||||||
|
|
||||||
await attachSenderE2EE(tx.sender, Buffer.from(sharedSecret, "hex"));
|
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);
|
send(offerSignal);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}, [activeCall, sessionKeys]);
|
}, [activeCall, sessionKeys, sharedSecret]);
|
||||||
|
|
||||||
const openCallsModal = (text : string) => {
|
const openCallsModal = (text : string) => {
|
||||||
modals.open({
|
modals.open({
|
||||||
|
|||||||
Reference in New Issue
Block a user