mirror of
https://github.com/koush/scrypted.git
synced 2026-02-10 01:02:18 +00:00
webrtc: fixup nvr usage
This commit is contained in:
@@ -363,12 +363,20 @@ export class WebRTCConnectionManagement implements RTCConnectionManagement {
|
||||
return this.negotiationDeferred.promise;
|
||||
}
|
||||
|
||||
async negotiateRTCSignalingSession(): Promise<void> {
|
||||
async negotiateRTCSignalingSession(clientOffer?: boolean): Promise<void> {
|
||||
try {
|
||||
await connectRTCSignalingClients(this.console,
|
||||
this.clientSession, createSetup(this.options?.disableIntercom ? 'recvonly' : 'sendrecv', 'recvonly'),
|
||||
this.weriftSignalingSession, createSetup(this.options?.disableIntercom ? 'sendonly' : 'sendrecv', 'sendonly'),
|
||||
);
|
||||
if (clientOffer) {
|
||||
await connectRTCSignalingClients(this.console,
|
||||
this.clientSession, createSetup(this.options?.disableIntercom ? 'recvonly' : 'sendrecv', 'recvonly'),
|
||||
this.weriftSignalingSession, createSetup(this.options?.disableIntercom ? 'sendonly' : 'sendrecv', 'sendonly'),
|
||||
);
|
||||
}
|
||||
else {
|
||||
await connectRTCSignalingClients(this.console,
|
||||
this.weriftSignalingSession, createSetup(this.options?.disableIntercom ? 'sendonly' : 'sendrecv', 'sendonly'),
|
||||
this.clientSession, createSetup(this.options?.disableIntercom ? 'recvonly' : 'sendrecv', 'recvonly'),
|
||||
);
|
||||
}
|
||||
this.negotiationDeferred.resolve(undefined);
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user