@signalapp/ringrtc 2.44.4 → 2.46.0

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.
@@ -669,7 +669,7 @@ For more information on this, and how to apply and follow the GNU AGPL, see
669
669
 
670
670
  ```
671
671
 
672
- ## libsignal-core 0.1.0, mrp 2.44.4, protobuf 2.44.4, ringrtc 2.44.4, regex-aot 0.1.0, partial-default-derive 0.1.0
672
+ ## libsignal-core 0.1.0, mrp 2.46.0, protobuf 2.46.0, ringrtc 2.46.0, regex-aot 0.1.0, partial-default-derive 0.1.0
673
673
 
674
674
  ```
675
675
  GNU AFFERO GENERAL PUBLIC LICENSE
@@ -115,6 +115,7 @@ export declare class RingRTCType {
115
115
  proceed(callId: CallId, settings: CallSettings): void;
116
116
  onCallState(remoteUserId: UserId, state: CallState): void;
117
117
  onCallEnded(remoteUserId: UserId, callId: CallId, reason: CallEndedReason, ageSec: number): void;
118
+ onRemoteAudioEnabled(remoteUserId: UserId, enabled: boolean): void;
118
119
  onRemoteVideoEnabled(remoteUserId: UserId, enabled: boolean): void;
119
120
  onRemoteSharingScreen(remoteUserId: UserId, enabled: boolean): void;
120
121
  onNetworkRouteChanged(remoteUserId: UserId, localNetworkAdapterType: NetworkAdapterType): void;
@@ -151,7 +152,8 @@ export declare class RingRTCType {
151
152
  * const secretParams = CallLinkSecretParams.deriveFromRootKey(linkKey.bytes);
152
153
  * const credentialPresentation = credential.present(roomId, secretParams).serialize();
153
154
  * const serializedPublicParams = secretParams.getPublicParams().serialize();
154
- * const result = await RingRTC.createCallLink(sfuUrl, credentialPresentation, linkKey, adminPasskey, serializedPublicParams);
155
+ * const restrictions = CallLinkState.Restrictions.None;
156
+ * const result = await RingRTC.createCallLink(sfuUrl, credentialPresentation, linkKey, adminPasskey, serializedPublicParams, restrictions);
155
157
  * if (result.success) {
156
158
  * const state = result.value;
157
159
  * // In actuality you may not want to do this until the user clicks Done.
@@ -173,7 +175,7 @@ export declare class RingRTCType {
173
175
  * @param adminPasskey - the arbitrary passkey to use for the new room
174
176
  * @param callLinkPublicParams - the serialized CallLinkPublicParams for the new room
175
177
  */
176
- createCallLink(sfuUrl: string, createCredentialPresentation: Buffer, linkRootKey: CallLinkRootKey, adminPasskey: Buffer, callLinkPublicParams: Buffer): Promise<HttpResult<CallLinkState>>;
178
+ createCallLink(sfuUrl: string, createCredentialPresentation: Buffer, linkRootKey: CallLinkRootKey, adminPasskey: Buffer, callLinkPublicParams: Buffer, restrictions: Exclude<CallLinkRestrictions, CallLinkRestrictions.Unknown>): Promise<HttpResult<CallLinkState>>;
177
179
  /**
178
180
  * Asynchronous request to update a call link's name.
179
181
  *
@@ -319,6 +321,7 @@ export declare class Call {
319
321
  private _outgoingAudioEnabled;
320
322
  private _outgoingVideoEnabled;
321
323
  private _outgoingVideoIsScreenShare;
324
+ private _remoteAudioEnabled;
322
325
  private _remoteVideoEnabled;
323
326
  outgoingAudioLevel: NormalizedAudioLevel;
324
327
  remoteAudioLevel: NormalizedAudioLevel;
@@ -328,6 +331,7 @@ export declare class Call {
328
331
  private _videoRenderer;
329
332
  endedReason?: CallEndedReason;
330
333
  handleStateChanged?: () => void;
334
+ handleRemoteAudioEnabled?: () => void;
331
335
  handleRemoteVideoEnabled?: () => void;
332
336
  handleRemoteSharingScreen?: () => void;
333
337
  handleNetworkRouteChanged?: () => void;
@@ -361,6 +365,8 @@ export declare class Call {
361
365
  get outgoingVideoEnabled(): boolean;
362
366
  set outgoingVideoEnabled(enabled: boolean);
363
367
  set outgoingVideoIsScreenShare(isScreenShare: boolean);
368
+ get remoteAudioEnabled(): boolean;
369
+ set remoteAudioEnabled(enabled: boolean);
364
370
  get remoteVideoEnabled(): boolean;
365
371
  set remoteVideoEnabled(enabled: boolean);
366
372
  sendVideoFrame(width: number, height: number, format: VideoPixelFormatEnum, buffer: Buffer): void;
@@ -652,7 +658,7 @@ export interface CallManager {
652
658
  receiveGroupCallVideoFrame(clientId: GroupCallClientId, remoteDemuxId: number, buffer: Buffer, maxWidth: number, maxHeight: number): [number, number] | undefined;
653
659
  setRtcStatsInterval(clientId: GroupCallClientId, intervalMillis: number): void;
654
660
  readCallLink(requestId: number, sfuUrl: string, authCredentialPresentation: Buffer, linkRootKey: Buffer): void;
655
- createCallLink(requestId: number, sfuUrl: string, createCredentialPresentation: Buffer, linkRootKey: Buffer, adminPasskey: Buffer, callLinkPublicParams: Buffer): void;
661
+ createCallLink(requestId: number, sfuUrl: string, createCredentialPresentation: Buffer, linkRootKey: Buffer, adminPasskey: Buffer, callLinkPublicParams: Buffer, restrictions: number | undefined): void;
656
662
  updateCallLink(requestId: number, sfuUrl: string, authCredentialPresentation: Buffer, linkRootKey: Buffer, adminPasskey: Buffer, newName: string | undefined, newRestrictions: number | undefined, newRevoked: boolean | undefined): void;
657
663
  deleteCallLink(requestId: number, sfuUrl: string, authCredentialPresentation: Buffer, linkRootKey: Buffer, adminPasskey: Buffer): void;
658
664
  peekGroupCall(requestId: number, sfu_url: string, membership_proof: Buffer, group_members: Array<GroupMemberInfo>): void;
@@ -667,6 +673,7 @@ export interface CallManagerCallbacks {
667
673
  onStartIncomingCall(remoteUserId: UserId, callId: CallId, isVideoCall: boolean): void;
668
674
  onCallState(remoteUserId: UserId, state: CallState): void;
669
675
  onCallEnded(remoteUserId: UserId, callId: CallId, endedReason: CallEndedReason, ageSec: number): void;
676
+ onRemoteAudioEnabled(remoteUserId: UserId, enabled: boolean): void;
670
677
  onRemoteVideoEnabled(remoteUserId: UserId, enabled: boolean): void;
671
678
  onRemoteSharingScreen(remoteUserId: UserId, enabled: boolean): void;
672
679
  onSendOffer(remoteUserId: UserId, remoteDeviceId: DeviceId, callId: CallId, broadcast: boolean, mediaType: number, opaque: Buffer): void;
@@ -284,8 +284,6 @@ class RingRTCType {
284
284
  const isIncoming = false;
285
285
  const call = new Call(this.callManager, remoteUserId, callId, isIncoming, isVideoCall, CallState.Prering);
286
286
  this._call = call;
287
- // We won't actually send anything until the remote side accepts.
288
- call.outgoingAudioEnabled = true;
289
287
  call.outgoingVideoEnabled = isVideoCall;
290
288
  return call;
291
289
  }
@@ -435,6 +433,16 @@ class RingRTCType {
435
433
  call.endedReason = reason;
436
434
  call.state = CallState.Ended;
437
435
  }
436
+ onRemoteAudioEnabled(remoteUserId, enabled) {
437
+ const call = this._call;
438
+ if (!call || call.remoteUserId !== remoteUserId) {
439
+ return;
440
+ }
441
+ call.remoteAudioEnabled = enabled;
442
+ if (call.handleRemoteAudioEnabled) {
443
+ call.handleRemoteAudioEnabled();
444
+ }
445
+ }
438
446
  onRemoteVideoEnabled(remoteUserId, enabled) {
439
447
  const call = this._call;
440
448
  if (!call || call.remoteUserId !== remoteUserId) {
@@ -579,7 +587,8 @@ class RingRTCType {
579
587
  * const secretParams = CallLinkSecretParams.deriveFromRootKey(linkKey.bytes);
580
588
  * const credentialPresentation = credential.present(roomId, secretParams).serialize();
581
589
  * const serializedPublicParams = secretParams.getPublicParams().serialize();
582
- * const result = await RingRTC.createCallLink(sfuUrl, credentialPresentation, linkKey, adminPasskey, serializedPublicParams);
590
+ * const restrictions = CallLinkState.Restrictions.None;
591
+ * const result = await RingRTC.createCallLink(sfuUrl, credentialPresentation, linkKey, adminPasskey, serializedPublicParams, restrictions);
583
592
  * if (result.success) {
584
593
  * const state = result.value;
585
594
  * // In actuality you may not want to do this until the user clicks Done.
@@ -601,11 +610,11 @@ class RingRTCType {
601
610
  * @param adminPasskey - the arbitrary passkey to use for the new room
602
611
  * @param callLinkPublicParams - the serialized CallLinkPublicParams for the new room
603
612
  */
604
- createCallLink(sfuUrl, createCredentialPresentation, linkRootKey, adminPasskey, callLinkPublicParams) {
613
+ createCallLink(sfuUrl, createCredentialPresentation, linkRootKey, adminPasskey, callLinkPublicParams, restrictions) {
605
614
  const [requestId, promise] = this._callLinkRequests.add();
606
615
  // Response comes back via handleCallLinkResponse
607
616
  sillyDeadlockProtection(() => {
608
- this.callManager.createCallLink(requestId, sfuUrl, createCredentialPresentation, linkRootKey.bytes, adminPasskey, callLinkPublicParams);
617
+ this.callManager.createCallLink(requestId, sfuUrl, createCredentialPresentation, linkRootKey.bytes, adminPasskey, callLinkPublicParams, restrictions);
609
618
  });
610
619
  return promise;
611
620
  }
@@ -1166,6 +1175,7 @@ class Call {
1166
1175
  this._outgoingAudioEnabled = false;
1167
1176
  this._outgoingVideoEnabled = false;
1168
1177
  this._outgoingVideoIsScreenShare = false;
1178
+ this._remoteAudioEnabled = false;
1169
1179
  this._remoteVideoEnabled = false;
1170
1180
  this.outgoingAudioLevel = 0;
1171
1181
  this.remoteAudioLevel = 0;
@@ -1197,6 +1207,10 @@ class Call {
1197
1207
  return;
1198
1208
  }
1199
1209
  this._state = state;
1210
+ if (state === CallState.Accepted) {
1211
+ // Make sure the status gets sent.
1212
+ this.outgoingAudioEnabled = this._outgoingAudioEnabled;
1213
+ }
1200
1214
  this.enableOrDisableCapturer();
1201
1215
  this.enableOrDisableRenderer();
1202
1216
  if (this.handleStateChanged) {
@@ -1261,6 +1275,12 @@ class Call {
1261
1275
  this._callManager.setOutgoingVideoIsScreenShare(isScreenShare);
1262
1276
  });
1263
1277
  }
1278
+ get remoteAudioEnabled() {
1279
+ return this._remoteAudioEnabled;
1280
+ }
1281
+ set remoteAudioEnabled(enabled) {
1282
+ this._remoteAudioEnabled = enabled;
1283
+ }
1264
1284
  get remoteVideoEnabled() {
1265
1285
  return this._remoteVideoEnabled;
1266
1286
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalapp/ringrtc",
3
- "version": "2.44.4",
3
+ "version": "2.46.0",
4
4
  "description": "Signal Messenger voice and video calling library.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "config": {
27
27
  "prebuildUrl": "https://build-artifacts.signal.org/libraries/ringrtc-desktop-build-v${npm_package_version}.tar.gz",
28
- "prebuildChecksum": "a168177d73c3ae48ad42254f02c266989f525194c28a12b801b02029f9149570"
28
+ "prebuildChecksum": "4c1eb32d4b9a63dc396147adc22b9f96af72686ec9b1c43fdfe3123d4de51185"
29
29
  },
30
30
  "author": "",
31
31
  "license": "AGPL-3.0-only",