@signalapp/ringrtc 2.32.1 → 2.34.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.
- package/dist/acknowledgments.md +30 -89
- package/dist/index.d.ts +1 -1
- package/dist/ringrtc/Service.d.ts +16 -1
- package/dist/ringrtc/Service.js +55 -34
- package/dist/ringrtc/VideoSupport.js +70 -89
- package/package.json +2 -2
package/dist/acknowledgments.md
CHANGED
|
@@ -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
|
-
## regex-aot 0.1.0, ringrtc 2.
|
|
672
|
+
## regex-aot 0.1.0, ringrtc 2.34.0
|
|
673
673
|
|
|
674
674
|
```
|
|
675
675
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
@@ -1631,7 +1631,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
1631
1631
|
|
|
1632
1632
|
```
|
|
1633
1633
|
|
|
1634
|
-
## bitflags 2.4.0, log 0.4.20, regex 1.9.
|
|
1634
|
+
## bitflags 2.4.0, log 0.4.20, regex 1.9.6, regex-automata 0.3.9, regex-syntax 0.6.29, regex-syntax 0.7.5, semver 0.9.0
|
|
1635
1635
|
|
|
1636
1636
|
```
|
|
1637
1637
|
Copyright (c) 2014 The Rust Project Developers
|
|
@@ -1662,7 +1662,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
1662
1662
|
|
|
1663
1663
|
```
|
|
1664
1664
|
|
|
1665
|
-
## libc 0.2.
|
|
1665
|
+
## libc 0.2.148
|
|
1666
1666
|
|
|
1667
1667
|
```
|
|
1668
1668
|
Copyright (c) 2014-2020 The Rust Project Developers
|
|
@@ -1722,32 +1722,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
|
|
1722
1722
|
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
1723
1723
|
DEALINGS IN THE SOFTWARE.
|
|
1724
1724
|
|
|
1725
|
-
```
|
|
1726
|
-
|
|
1727
|
-
## num_cpus 1.16.0
|
|
1728
|
-
|
|
1729
|
-
```
|
|
1730
|
-
Copyright (c) 2015
|
|
1731
|
-
|
|
1732
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1733
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
1734
|
-
in the Software without restriction, including without limitation the rights
|
|
1735
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1736
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
1737
|
-
furnished to do so, subject to the following conditions:
|
|
1738
|
-
|
|
1739
|
-
The above copyright notice and this permission notice shall be included in
|
|
1740
|
-
all copies or substantial portions of the Software.
|
|
1741
|
-
|
|
1742
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1743
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1744
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1745
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1746
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1747
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1748
|
-
THE SOFTWARE.
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
1725
|
```
|
|
1752
1726
|
|
|
1753
1727
|
## neon 0.10.1, neon-build 0.10.1, neon-macros 0.10.1, neon-runtime 0.10.1
|
|
@@ -1837,7 +1811,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
1837
1811
|
|
|
1838
1812
|
```
|
|
1839
1813
|
|
|
1840
|
-
## which 4.4.
|
|
1814
|
+
## which 4.4.2
|
|
1841
1815
|
|
|
1842
1816
|
```
|
|
1843
1817
|
Copyright (c) 2015 fangyuanziti
|
|
@@ -1982,7 +1956,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
1982
1956
|
|
|
1983
1957
|
```
|
|
1984
1958
|
|
|
1985
|
-
## hashbrown 0.14.
|
|
1959
|
+
## hashbrown 0.14.1
|
|
1986
1960
|
|
|
1987
1961
|
```
|
|
1988
1962
|
Copyright (c) 2016 Amanieu d'Antras
|
|
@@ -2075,7 +2049,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
2075
2049
|
|
|
2076
2050
|
```
|
|
2077
2051
|
|
|
2078
|
-
## indexmap 2.0.
|
|
2052
|
+
## indexmap 2.0.2
|
|
2079
2053
|
|
|
2080
2054
|
```
|
|
2081
2055
|
Copyright (c) 2016--2017
|
|
@@ -2261,7 +2235,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
2261
2235
|
|
|
2262
2236
|
```
|
|
2263
2237
|
|
|
2264
|
-
## bytes 1.
|
|
2238
|
+
## bytes 1.5.0
|
|
2265
2239
|
|
|
2266
2240
|
```
|
|
2267
2241
|
Copyright (c) 2018 Carl Lerche
|
|
@@ -2323,7 +2297,7 @@ DEALINGS IN THE SOFTWARE.
|
|
|
2323
2297
|
|
|
2324
2298
|
```
|
|
2325
2299
|
|
|
2326
|
-
## smallvec 1.11.
|
|
2300
|
+
## smallvec 1.11.1
|
|
2327
2301
|
|
|
2328
2302
|
```
|
|
2329
2303
|
Copyright (c) 2018 The Servo Project Developers
|
|
@@ -2659,34 +2633,28 @@ DEALINGS IN THE SOFTWARE.
|
|
|
2659
2633
|
|
|
2660
2634
|
```
|
|
2661
2635
|
|
|
2662
|
-
##
|
|
2636
|
+
## toml_edit 0.19.15
|
|
2663
2637
|
|
|
2664
2638
|
```
|
|
2665
|
-
Copyright (c)
|
|
2639
|
+
Copyright (c) Individual contributors
|
|
2666
2640
|
|
|
2667
|
-
Permission is hereby granted, free of charge, to any
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
the Software, and to permit persons to whom the Software
|
|
2674
|
-
is furnished to do so, subject to the following
|
|
2675
|
-
conditions:
|
|
2641
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
2642
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
2643
|
+
in the Software without restriction, including without limitation the rights
|
|
2644
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
2645
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
2646
|
+
furnished to do so, subject to the following conditions:
|
|
2676
2647
|
|
|
2677
|
-
The above copyright notice and this permission notice
|
|
2678
|
-
|
|
2679
|
-
of the Software.
|
|
2648
|
+
The above copyright notice and this permission notice shall be included in all
|
|
2649
|
+
copies or substantial portions of the Software.
|
|
2680
2650
|
|
|
2681
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
2689
|
-
DEALINGS IN THE SOFTWARE.
|
|
2651
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
2652
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
2653
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
2654
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
2655
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
2656
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
2657
|
+
SOFTWARE.
|
|
2690
2658
|
|
|
2691
2659
|
```
|
|
2692
2660
|
|
|
@@ -2722,33 +2690,6 @@ DEALINGS IN THE SOFTWARE.
|
|
|
2722
2690
|
|
|
2723
2691
|
```
|
|
2724
2692
|
|
|
2725
|
-
## toml_edit 0.19.14
|
|
2726
|
-
|
|
2727
|
-
```
|
|
2728
|
-
MIT License
|
|
2729
|
-
|
|
2730
|
-
Copyright (c) 2017 Andronik Ordian
|
|
2731
|
-
|
|
2732
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
2733
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
2734
|
-
in the Software without restriction, including without limitation the rights
|
|
2735
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
2736
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
2737
|
-
furnished to do so, subject to the following conditions:
|
|
2738
|
-
|
|
2739
|
-
The above copyright notice and this permission notice shall be included in all
|
|
2740
|
-
copies or substantial portions of the Software.
|
|
2741
|
-
|
|
2742
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
2743
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
2744
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
2745
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
2746
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
2747
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
2748
|
-
SOFTWARE.
|
|
2749
|
-
|
|
2750
|
-
```
|
|
2751
|
-
|
|
2752
2693
|
## static_assertions 1.1.0
|
|
2753
2694
|
|
|
2754
2695
|
```
|
|
@@ -2882,7 +2823,7 @@ SOFTWARE.
|
|
|
2882
2823
|
|
|
2883
2824
|
```
|
|
2884
2825
|
|
|
2885
|
-
## anyhow 1.0.75, fastrand 2.0.0, itoa 1.0.9, linux-raw-sys 0.4.
|
|
2826
|
+
## anyhow 1.0.75, fastrand 2.0.1, home 0.5.5, itoa 1.0.9, linux-raw-sys 0.4.8, num_enum 0.7.0, num_enum_derive 0.7.0, once_cell 1.18.0, pin-project-lite 0.2.13, prettyplease 0.1.25, proc-macro-crate 1.3.1, proc-macro2 1.0.67, quote 1.0.33, rustix 0.38.15, serde 1.0.188, serde_derive 1.0.188, serde_json 1.0.107, syn 1.0.109, syn 2.0.37, syn-mid 0.5.4, thiserror 1.0.49, thiserror-impl 1.0.49, unicode-ident 1.0.12
|
|
2886
2827
|
|
|
2887
2828
|
```
|
|
2888
2829
|
Permission is hereby granted, free of charge, to any
|
|
@@ -2987,7 +2928,7 @@ SOFTWARE.
|
|
|
2987
2928
|
|
|
2988
2929
|
```
|
|
2989
2930
|
|
|
2990
|
-
## typenum 1.
|
|
2931
|
+
## typenum 1.17.0
|
|
2991
2932
|
|
|
2992
2933
|
```
|
|
2993
2934
|
The MIT License (MIT)
|
|
@@ -3014,7 +2955,7 @@ SOFTWARE.
|
|
|
3014
2955
|
|
|
3015
2956
|
```
|
|
3016
2957
|
|
|
3017
|
-
## base64 0.13.1, base64 0.21.
|
|
2958
|
+
## base64 0.13.1, base64 0.21.4
|
|
3018
2959
|
|
|
3019
2960
|
```
|
|
3020
2961
|
The MIT License (MIT)
|
|
@@ -3041,7 +2982,7 @@ THE SOFTWARE.
|
|
|
3041
2982
|
|
|
3042
2983
|
```
|
|
3043
2984
|
|
|
3044
|
-
## aho-corasick 1.
|
|
2985
|
+
## aho-corasick 1.1.1, byteorder 1.4.3, memchr 2.6.3, regex-automata 0.1.10
|
|
3045
2986
|
|
|
3046
2987
|
```
|
|
3047
2988
|
The MIT License (MIT)
|
|
@@ -3203,7 +3144,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
3203
3144
|
SOFTWARE.
|
|
3204
3145
|
```
|
|
3205
3146
|
|
|
3206
|
-
## unicode-ident 1.0.
|
|
3147
|
+
## unicode-ident 1.0.12
|
|
3207
3148
|
|
|
3208
3149
|
```
|
|
3209
3150
|
UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RingRTCType } from './ringrtc/Service';
|
|
2
|
-
export { AnswerMessage, AudioDevice, DataMode, BusyMessage, Call, CallEndedReason, CallId, CallLogLevel, CallMessageUrgency, CallSettings, CallState, CallingMessage, ConnectionState, DeviceId, GroupCall, GroupCallEndReason, GroupCallKind, GroupCallObserver, GroupMemberInfo, HangupMessage, HangupType, HttpMethod, HttpResult, IceCandidateMessage, JoinState, LocalDeviceState, OfferMessage, OfferType, OpaqueMessage, PeekDeviceInfo, PeekInfo, PeekStatusCodes, RemoteDeviceState, RingCancelReason, RingRTCType, RingUpdate, UserId, VideoCapturer, VideoRenderer, VideoRequest, callIdFromEra, callIdFromRingId, } from './ringrtc/Service';
|
|
2
|
+
export { AnswerMessage, AudioDevice, DataMode, BusyMessage, Call, CallEndedReason, CallId, CallLogLevel, CallMessageUrgency, CallSettings, CallState, CallingMessage, ConnectionState, DeviceId, GroupCall, GroupCallEndReason, GroupCallKind, GroupCallObserver, GroupMemberInfo, HangupMessage, HangupType, HttpMethod, HttpResult, IceCandidateMessage, JoinState, LocalDeviceState, OfferMessage, OfferType, OpaqueMessage, PeekDeviceInfo, PeekInfo, PeekStatusCodes, Reaction, RemoteDeviceState, RingCancelReason, RingRTCType, RingUpdate, UserId, VideoCapturer, VideoRenderer, VideoRequest, callIdFromEra, callIdFromRingId, } from './ringrtc/Service';
|
|
3
3
|
export { CanvasVideoRenderer, GumVideoCapturer, VideoFrameSource, MAX_VIDEO_CAPTURE_AREA, MAX_VIDEO_CAPTURE_BUFFER_SIZE, MAX_VIDEO_CAPTURE_HEIGHT, MAX_VIDEO_CAPTURE_WIDTH, } from './ringrtc/VideoSupport';
|
|
4
4
|
export { CallLinkRootKey, CallLinkRestrictions, CallLinkState, } from './ringrtc/CallLinks';
|
|
5
5
|
export declare const RingRTC: RingRTCType;
|
|
@@ -13,6 +13,10 @@ export interface PeekDeviceInfo {
|
|
|
13
13
|
demuxId: number;
|
|
14
14
|
userId?: GroupCallUserId;
|
|
15
15
|
}
|
|
16
|
+
export interface Reaction {
|
|
17
|
+
demuxId: number;
|
|
18
|
+
value: string;
|
|
19
|
+
}
|
|
16
20
|
export interface PeekInfo {
|
|
17
21
|
devices: Array<PeekDeviceInfo>;
|
|
18
22
|
creator?: GroupCallUserId;
|
|
@@ -209,6 +213,8 @@ export declare class RingRTCType {
|
|
|
209
213
|
handleNetworkRouteChanged(clientId: GroupCallClientId, localNetworkAdapterType: NetworkAdapterType): void;
|
|
210
214
|
handleAudioLevels(clientId: GroupCallClientId, capturedLevel: RawAudioLevel, receivedLevels: Array<ReceivedAudioLevel>): void;
|
|
211
215
|
handleLowBandwidthForVideo(clientId: GroupCallClientId, recovered: boolean): void;
|
|
216
|
+
handleReactions(clientId: GroupCallClientId, reactions: Array<Reaction>): void;
|
|
217
|
+
handleRaisedHands(clientId: GroupCallClientId, raisedHands: Array<number>): void;
|
|
212
218
|
handleRemoteDevicesChanged(clientId: GroupCallClientId, remoteDeviceStates: Array<RemoteDeviceState>): void;
|
|
213
219
|
handlePeekChanged(clientId: GroupCallClientId, info: PeekInfo): void;
|
|
214
220
|
handlePeekResponse(requestId: number, statusCode: number, info: PeekInfo | undefined): void;
|
|
@@ -255,6 +261,7 @@ export interface CallSettings {
|
|
|
255
261
|
interface IceServer {
|
|
256
262
|
username?: string;
|
|
257
263
|
password?: string;
|
|
264
|
+
hostname?: string;
|
|
258
265
|
urls: Array<string>;
|
|
259
266
|
}
|
|
260
267
|
export interface AudioDevice {
|
|
@@ -434,6 +441,8 @@ export interface GroupCallObserver {
|
|
|
434
441
|
onRemoteDeviceStatesChanged(groupCall: GroupCall): void;
|
|
435
442
|
onAudioLevels(groupCall: GroupCall): void;
|
|
436
443
|
onLowBandwidthForVideo(groupCall: GroupCall, recovered: boolean): void;
|
|
444
|
+
onReactions(groupCall: GroupCall, reactions: Array<Reaction>): void;
|
|
445
|
+
onRaisedHands(groupCall: GroupCall, raisedHands: Array<number>): void;
|
|
437
446
|
onPeekChanged(groupCall: GroupCall): void;
|
|
438
447
|
onEnded(groupCall: GroupCall, reason: GroupCallEndReason): void;
|
|
439
448
|
}
|
|
@@ -456,6 +465,8 @@ export declare class GroupCall {
|
|
|
456
465
|
getRemoteDeviceStates(): Array<RemoteDeviceState> | undefined;
|
|
457
466
|
getPeekInfo(): PeekInfo | undefined;
|
|
458
467
|
setOutgoingAudioMuted(muted: boolean): void;
|
|
468
|
+
react(value: string): void;
|
|
469
|
+
raiseHand(raise: boolean): void;
|
|
459
470
|
setOutgoingVideoMuted(muted: boolean): void;
|
|
460
471
|
setPresenting(presenting: boolean): void;
|
|
461
472
|
setOutgoingVideoIsScreenShare(isScreenShare: boolean): void;
|
|
@@ -476,6 +487,8 @@ export declare class GroupCall {
|
|
|
476
487
|
handleNetworkRouteChanged(localNetworkAdapterType: NetworkAdapterType): void;
|
|
477
488
|
handleAudioLevels(capturedLevel: RawAudioLevel, receivedLevels: Array<ReceivedAudioLevel>): void;
|
|
478
489
|
handleLowBandwidthForVideo(recovered: boolean): void;
|
|
490
|
+
handleReactions(reactions: Array<Reaction>): void;
|
|
491
|
+
handleRaisedHands(raisedHands: Array<number>): void;
|
|
479
492
|
handleRemoteDevicesChanged(remoteDeviceStates: Array<RemoteDeviceState>): void;
|
|
480
493
|
handlePeekChanged(info: PeekInfo): void;
|
|
481
494
|
handleEnded(reason: GroupCallEndReason): void;
|
|
@@ -563,7 +576,7 @@ export interface CallManager {
|
|
|
563
576
|
setConfig(config: Config): void;
|
|
564
577
|
setSelfUuid(uuid: Buffer): void;
|
|
565
578
|
createOutgoingCall(remoteUserId: UserId, isVideoCall: boolean, localDeviceId: DeviceId): CallId;
|
|
566
|
-
proceed(callId: CallId, iceServerUsername: string, iceServerPassword: string, iceServerUrls: Array<string>, hideIp: boolean, dataMode: DataMode, audioLevelsIntervalMillis: number): void;
|
|
579
|
+
proceed(callId: CallId, iceServerUsername: string, iceServerPassword: string, iceServerHostname: string, iceServerUrls: Array<string>, hideIp: boolean, dataMode: DataMode, audioLevelsIntervalMillis: number): void;
|
|
567
580
|
accept(callId: CallId): void;
|
|
568
581
|
ignore(callId: CallId): void;
|
|
569
582
|
hangup(): void;
|
|
@@ -596,6 +609,8 @@ export interface CallManager {
|
|
|
596
609
|
setPresenting(clientId: GroupCallClientId, presenting: boolean): void;
|
|
597
610
|
setOutgoingGroupCallVideoIsScreenShare(clientId: GroupCallClientId, isScreenShare: boolean): void;
|
|
598
611
|
groupRing(clientId: GroupCallClientId, recipient: Buffer | undefined): void;
|
|
612
|
+
groupReact(clientId: GroupCallClientId, value: string): void;
|
|
613
|
+
groupRaiseHand(clientId: GroupCallClientId, raise: boolean): void;
|
|
599
614
|
resendMediaKeys(clientId: GroupCallClientId): void;
|
|
600
615
|
setDataMode(clientId: GroupCallClientId, dataMode: DataMode): void;
|
|
601
616
|
requestVideo(clientId: GroupCallClientId, resolutions: Array<VideoRequest>, activeSpeakerHeight: number): void;
|
package/dist/ringrtc/Service.js
CHANGED
|
@@ -26,15 +26,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
26
|
__setModuleDefault(result, mod);
|
|
27
27
|
return result;
|
|
28
28
|
};
|
|
29
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
30
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
31
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
32
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
33
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
34
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
35
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
29
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
30
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
31
|
};
|
|
@@ -145,6 +136,8 @@ NativeCallManager.prototype.join = Native_1.default.cm_join;
|
|
|
145
136
|
NativeCallManager.prototype.leave = Native_1.default.cm_leave;
|
|
146
137
|
NativeCallManager.prototype.disconnect = Native_1.default.cm_disconnect;
|
|
147
138
|
NativeCallManager.prototype.groupRing = Native_1.default.cm_groupRing;
|
|
139
|
+
NativeCallManager.prototype.groupReact = Native_1.default.cm_groupReact;
|
|
140
|
+
NativeCallManager.prototype.groupRaiseHand = Native_1.default.cm_groupRaiseHand;
|
|
148
141
|
NativeCallManager.prototype.setOutgoingAudioMuted =
|
|
149
142
|
Native_1.default.cm_setOutgoingAudioMuted;
|
|
150
143
|
NativeCallManager.prototype.setOutgoingVideoMuted =
|
|
@@ -381,7 +374,7 @@ class RingRTCType {
|
|
|
381
374
|
}
|
|
382
375
|
proceed(callId, settings) {
|
|
383
376
|
sillyDeadlockProtection(() => {
|
|
384
|
-
this.callManager.proceed(callId, settings.iceServer.username || '', settings.iceServer.password || '', settings.iceServer.urls, settings.hideIp, settings.dataMode, settings.audioLevelsIntervalMillis || 0);
|
|
377
|
+
this.callManager.proceed(callId, settings.iceServer.username || '', settings.iceServer.password || '', settings.iceServer.hostname || '', settings.iceServer.urls, settings.hideIp, settings.dataMode, settings.audioLevelsIntervalMillis || 0);
|
|
385
378
|
});
|
|
386
379
|
}
|
|
387
380
|
// Called by Rust
|
|
@@ -492,13 +485,12 @@ class RingRTCType {
|
|
|
492
485
|
}
|
|
493
486
|
}
|
|
494
487
|
renderVideoFrame(width, height, buffer) {
|
|
495
|
-
var _a, _b;
|
|
496
488
|
const call = this._call;
|
|
497
489
|
if (!call) {
|
|
498
490
|
return;
|
|
499
491
|
}
|
|
500
|
-
if (
|
|
501
|
-
|
|
492
|
+
if (this._call?.renderVideoFrame) {
|
|
493
|
+
this._call?.renderVideoFrame(width, height, buffer);
|
|
502
494
|
}
|
|
503
495
|
}
|
|
504
496
|
// Called by Rust
|
|
@@ -542,9 +534,9 @@ class RingRTCType {
|
|
|
542
534
|
message.destinationDeviceId = remoteDeviceId;
|
|
543
535
|
}
|
|
544
536
|
/* eslint-enable no-param-reassign */
|
|
545
|
-
(() =>
|
|
537
|
+
(async () => {
|
|
546
538
|
if (this.handleOutgoingSignaling) {
|
|
547
|
-
const signalingResult =
|
|
539
|
+
const signalingResult = await this.handleOutgoingSignaling(remoteUserId, message);
|
|
548
540
|
if (signalingResult) {
|
|
549
541
|
this.callManager.signalingMessageSent(callId);
|
|
550
542
|
}
|
|
@@ -555,7 +547,7 @@ class RingRTCType {
|
|
|
555
547
|
else {
|
|
556
548
|
this.callManager.signalingMessageSendFailed(callId);
|
|
557
549
|
}
|
|
558
|
-
})
|
|
550
|
+
})().catch(e => this.logError(e.toString()));
|
|
559
551
|
}
|
|
560
552
|
// Call Links
|
|
561
553
|
/**
|
|
@@ -695,7 +687,7 @@ class RingRTCType {
|
|
|
695
687
|
try {
|
|
696
688
|
this.callManager.receivedHttpResponse(requestId, status, body);
|
|
697
689
|
}
|
|
698
|
-
catch
|
|
690
|
+
catch {
|
|
699
691
|
// We may not have an active connection any more.
|
|
700
692
|
// In which case it doesn't matter
|
|
701
693
|
}
|
|
@@ -706,7 +698,7 @@ class RingRTCType {
|
|
|
706
698
|
try {
|
|
707
699
|
this.callManager.httpRequestFailed(requestId, debugInfo);
|
|
708
700
|
}
|
|
709
|
-
catch
|
|
701
|
+
catch {
|
|
710
702
|
// We may not have an active connection any more.
|
|
711
703
|
// In which case it doesn't matter
|
|
712
704
|
}
|
|
@@ -833,6 +825,24 @@ class RingRTCType {
|
|
|
833
825
|
});
|
|
834
826
|
}
|
|
835
827
|
// Called by Rust
|
|
828
|
+
handleReactions(clientId, reactions) {
|
|
829
|
+
sillyDeadlockProtection(() => {
|
|
830
|
+
const groupCall = this._groupCallByClientId.get(clientId);
|
|
831
|
+
if (groupCall) {
|
|
832
|
+
groupCall.handleReactions(reactions);
|
|
833
|
+
}
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
// Called by Rust
|
|
837
|
+
handleRaisedHands(clientId, raisedHands) {
|
|
838
|
+
sillyDeadlockProtection(() => {
|
|
839
|
+
const groupCall = this._groupCallByClientId.get(clientId);
|
|
840
|
+
if (groupCall) {
|
|
841
|
+
groupCall.handleRaisedHands(raisedHands);
|
|
842
|
+
}
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
// Called by Rust
|
|
836
846
|
handleRemoteDevicesChanged(clientId, remoteDeviceStates) {
|
|
837
847
|
sillyDeadlockProtection(() => {
|
|
838
848
|
const groupCall = this._groupCallByClientId.get(clientId);
|
|
@@ -944,13 +954,12 @@ class RingRTCType {
|
|
|
944
954
|
}
|
|
945
955
|
// Called by MessageReceiver
|
|
946
956
|
handleCallingMessage(remoteUserId, remoteUuid, remoteDeviceId, localDeviceId, messageAgeSec, messageReceivedAtCounter, message, senderIdentityKey, receiverIdentityKey) {
|
|
947
|
-
var _a, _b, _c, _d, _e;
|
|
948
957
|
if (message.destinationDeviceId &&
|
|
949
958
|
message.destinationDeviceId !== localDeviceId) {
|
|
950
959
|
// Drop the message as it isn't for this device, handleIgnoredCall() is not needed.
|
|
951
960
|
return;
|
|
952
961
|
}
|
|
953
|
-
if (
|
|
962
|
+
if (message.offer?.callId) {
|
|
954
963
|
const callId = message.offer.callId;
|
|
955
964
|
const opaque = toBuffer(message.offer.opaque);
|
|
956
965
|
// opaque is required. sdp is obsolete, but it might still come with opaque.
|
|
@@ -965,7 +974,7 @@ class RingRTCType {
|
|
|
965
974
|
this._callInfoByCallId.set(this.getCallInfoKey(callId), callInfo);
|
|
966
975
|
this.callManager.receivedOffer(remoteUserId, remoteDeviceId, localDeviceId, messageAgeSec, callId, offerType, opaque, senderIdentityKey, receiverIdentityKey);
|
|
967
976
|
}
|
|
968
|
-
if (
|
|
977
|
+
if (message.answer?.callId) {
|
|
969
978
|
const callId = message.answer.callId;
|
|
970
979
|
const opaque = toBuffer(message.answer.opaque);
|
|
971
980
|
// opaque is required. sdp is obsolete, but it might still come with opaque.
|
|
@@ -1002,19 +1011,19 @@ class RingRTCType {
|
|
|
1002
1011
|
}
|
|
1003
1012
|
this.callManager.receivedIceCandidates(remoteUserId, remoteDeviceId, callId, candidates);
|
|
1004
1013
|
}
|
|
1005
|
-
if (
|
|
1014
|
+
if (message.hangup?.callId) {
|
|
1006
1015
|
const callId = message.hangup.callId;
|
|
1007
1016
|
const hangupType = message.hangup.type || HangupType.Normal;
|
|
1008
1017
|
const hangupDeviceId = message.hangup.deviceId || null;
|
|
1009
1018
|
this.callManager.receivedHangup(remoteUserId, remoteDeviceId, callId, hangupType, hangupDeviceId);
|
|
1010
1019
|
}
|
|
1011
|
-
if (
|
|
1020
|
+
if (message.legacyHangup?.callId) {
|
|
1012
1021
|
const callId = message.legacyHangup.callId;
|
|
1013
1022
|
const hangupType = message.legacyHangup.type || HangupType.Normal;
|
|
1014
1023
|
const hangupDeviceId = message.legacyHangup.deviceId || null;
|
|
1015
1024
|
this.callManager.receivedHangup(remoteUserId, remoteDeviceId, callId, hangupType, hangupDeviceId);
|
|
1016
1025
|
}
|
|
1017
|
-
if (
|
|
1026
|
+
if (message.busy?.callId) {
|
|
1018
1027
|
const callId = message.busy.callId;
|
|
1019
1028
|
this.callManager.receivedBusy(remoteUserId, remoteDeviceId, callId);
|
|
1020
1029
|
}
|
|
@@ -1306,7 +1315,7 @@ class Call {
|
|
|
1306
1315
|
try {
|
|
1307
1316
|
this._callManager.setOutgoingVideoEnabled(enabled);
|
|
1308
1317
|
}
|
|
1309
|
-
catch
|
|
1318
|
+
catch {
|
|
1310
1319
|
// We may not have an active connection any more.
|
|
1311
1320
|
// In which case it doesn't matter
|
|
1312
1321
|
}
|
|
@@ -1317,7 +1326,7 @@ class Call {
|
|
|
1317
1326
|
try {
|
|
1318
1327
|
this._callManager.updateDataMode(dataMode);
|
|
1319
1328
|
}
|
|
1320
|
-
catch
|
|
1329
|
+
catch {
|
|
1321
1330
|
// We may not have an active connection any more.
|
|
1322
1331
|
// In which case it doesn't matter
|
|
1323
1332
|
}
|
|
@@ -1516,6 +1525,14 @@ class GroupCall {
|
|
|
1516
1525
|
this._observer.onLocalDeviceStateChanged(this);
|
|
1517
1526
|
}
|
|
1518
1527
|
// Called by UI
|
|
1528
|
+
react(value) {
|
|
1529
|
+
this._callManager.groupReact(this._clientId, value);
|
|
1530
|
+
}
|
|
1531
|
+
// Called by UI
|
|
1532
|
+
raiseHand(raise) {
|
|
1533
|
+
this._callManager.groupRaiseHand(this._clientId, raise);
|
|
1534
|
+
}
|
|
1535
|
+
// Called by UI
|
|
1519
1536
|
setOutgoingVideoMuted(muted) {
|
|
1520
1537
|
this._localDeviceState.videoMuted = muted;
|
|
1521
1538
|
this._callManager.setOutgoingVideoMuted(this._clientId, muted);
|
|
@@ -1617,13 +1634,18 @@ class GroupCall {
|
|
|
1617
1634
|
handleLowBandwidthForVideo(recovered) {
|
|
1618
1635
|
this._observer.onLowBandwidthForVideo(this, recovered);
|
|
1619
1636
|
}
|
|
1637
|
+
handleReactions(reactions) {
|
|
1638
|
+
this._observer.onReactions(this, reactions);
|
|
1639
|
+
}
|
|
1640
|
+
handleRaisedHands(raisedHands) {
|
|
1641
|
+
this._observer.onRaisedHands(this, raisedHands);
|
|
1642
|
+
}
|
|
1620
1643
|
// Called by Rust via RingRTC object
|
|
1621
1644
|
handleRemoteDevicesChanged(remoteDeviceStates) {
|
|
1622
|
-
var _a;
|
|
1623
1645
|
// We don't get aspect ratios from RingRTC, so make sure to copy them over.
|
|
1624
1646
|
for (const noo of remoteDeviceStates) {
|
|
1625
|
-
const old =
|
|
1626
|
-
noo.videoAspectRatio = old
|
|
1647
|
+
const old = this._remoteDeviceStates?.find(old => old.demuxId == noo.demuxId);
|
|
1648
|
+
noo.videoAspectRatio = old?.videoAspectRatio;
|
|
1627
1649
|
}
|
|
1628
1650
|
this._remoteDeviceStates = remoteDeviceStates;
|
|
1629
1651
|
this._observer.onRemoteDeviceStatesChanged(this);
|
|
@@ -1649,8 +1671,7 @@ class GroupCall {
|
|
|
1649
1671
|
}
|
|
1650
1672
|
// Called by the GroupCallVideoFrameSource when it receives a video frame.
|
|
1651
1673
|
setRemoteAspectRatio(remoteDemuxId, aspectRatio) {
|
|
1652
|
-
|
|
1653
|
-
const remoteDevice = (_a = this._remoteDeviceStates) === null || _a === void 0 ? void 0 : _a.find(device => device.demuxId == remoteDemuxId);
|
|
1674
|
+
const remoteDevice = this._remoteDeviceStates?.find(device => device.demuxId == remoteDemuxId);
|
|
1654
1675
|
if (!!remoteDevice && remoteDevice.videoAspectRatio != aspectRatio) {
|
|
1655
1676
|
remoteDevice.videoAspectRatio = aspectRatio;
|
|
1656
1677
|
this._observer.onRemoteDeviceStatesChanged(this);
|
|
@@ -1792,11 +1813,11 @@ var CallLogLevel;
|
|
|
1792
1813
|
CallLogLevel[CallLogLevel["Trace"] = 5] = "Trace";
|
|
1793
1814
|
})(CallLogLevel || (exports.CallLogLevel = CallLogLevel = {}));
|
|
1794
1815
|
function sillyDeadlockProtection(f) {
|
|
1795
|
-
void (() =>
|
|
1816
|
+
void (async () => {
|
|
1796
1817
|
// This is a silly way of preventing a deadlock.
|
|
1797
1818
|
// eslint-disable-next-line @typescript-eslint/await-thenable
|
|
1798
|
-
|
|
1819
|
+
await 0;
|
|
1799
1820
|
f();
|
|
1800
|
-
})
|
|
1821
|
+
})();
|
|
1801
1822
|
}
|
|
1802
1823
|
//# sourceMappingURL=Service.js.map
|
|
@@ -3,15 +3,6 @@
|
|
|
3
3
|
// Copyright 2019-2021 Signal Messenger, LLC
|
|
4
4
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
5
5
|
//
|
|
6
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
7
|
exports.CanvasVideoRenderer = exports.MAX_VIDEO_CAPTURE_BUFFER_SIZE = exports.MAX_VIDEO_CAPTURE_AREA = exports.MAX_VIDEO_CAPTURE_HEIGHT = exports.MAX_VIDEO_CAPTURE_WIDTH = exports.GumVideoCapturer = exports.GumVideoCaptureOptions = exports.VideoPixelFormatEnum = void 0;
|
|
17
8
|
const index_1 = require("../index");
|
|
@@ -66,8 +57,7 @@ class GumVideoCapturer {
|
|
|
66
57
|
return this.captureOptions != undefined;
|
|
67
58
|
}
|
|
68
59
|
setLocalPreview(localPreview) {
|
|
69
|
-
|
|
70
|
-
const oldLocalPreview = (_a = this.localPreview) === null || _a === void 0 ? void 0 : _a.current;
|
|
60
|
+
const oldLocalPreview = this.localPreview?.current;
|
|
71
61
|
if (oldLocalPreview) {
|
|
72
62
|
oldLocalPreview.srcObject = null;
|
|
73
63
|
}
|
|
@@ -88,7 +78,7 @@ class GumVideoCapturer {
|
|
|
88
78
|
}
|
|
89
79
|
enableCaptureAndSend(sender, options) {
|
|
90
80
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
91
|
-
this.startCapturing(options
|
|
81
|
+
this.startCapturing(options ?? this.defaultCaptureOptions);
|
|
92
82
|
this.startSending(sender);
|
|
93
83
|
}
|
|
94
84
|
disable() {
|
|
@@ -100,34 +90,29 @@ class GumVideoCapturer {
|
|
|
100
90
|
this.updateLocalPreviewIntervalId = undefined;
|
|
101
91
|
}
|
|
102
92
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
103
|
-
setPreferredDevice(deviceId) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
this.startSending(sender);
|
|
113
|
-
}
|
|
93
|
+
async setPreferredDevice(deviceId) {
|
|
94
|
+
this.preferredDeviceId = deviceId;
|
|
95
|
+
if (this.captureOptions) {
|
|
96
|
+
const { captureOptions, sender } = this;
|
|
97
|
+
this.disable();
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
99
|
+
this.startCapturing(captureOptions);
|
|
100
|
+
if (sender) {
|
|
101
|
+
this.startSending(sender);
|
|
114
102
|
}
|
|
115
|
-
}
|
|
103
|
+
}
|
|
116
104
|
}
|
|
117
|
-
enumerateDevices() {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return cameras;
|
|
122
|
-
});
|
|
105
|
+
async enumerateDevices() {
|
|
106
|
+
const devices = await window.navigator.mediaDevices.enumerateDevices();
|
|
107
|
+
const cameras = devices.filter(d => d.kind == 'videoinput');
|
|
108
|
+
return cameras;
|
|
123
109
|
}
|
|
124
110
|
getUserMedia(options) {
|
|
125
|
-
var _a;
|
|
126
111
|
// TODO: Figure out a better way to make typescript accept "mandatory".
|
|
127
112
|
const constraints = {
|
|
128
113
|
audio: false,
|
|
129
114
|
video: {
|
|
130
|
-
deviceId:
|
|
115
|
+
deviceId: options.preferredDeviceId ?? this.preferredDeviceId,
|
|
131
116
|
width: {
|
|
132
117
|
max: options.maxWidth,
|
|
133
118
|
ideal: options.maxWidth,
|
|
@@ -156,60 +141,58 @@ class GumVideoCapturer {
|
|
|
156
141
|
}
|
|
157
142
|
return window.navigator.mediaDevices.getUserMedia(constraints);
|
|
158
143
|
}
|
|
159
|
-
startCapturing(options) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
144
|
+
async startCapturing(options) {
|
|
145
|
+
if (this.capturing()) {
|
|
146
|
+
index_1.RingRTC.logWarn('startCapturing(): already capturing');
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
index_1.RingRTC.logInfo(`startCapturing(): ${options.maxWidth}x${options.maxHeight}@${options.maxFramerate}`);
|
|
150
|
+
this.captureOptions = options;
|
|
151
|
+
try {
|
|
152
|
+
// If we start/stop/start, we may have concurrent calls to getUserMedia,
|
|
153
|
+
// which is what we want if we're switching from camera to screenshare.
|
|
154
|
+
// But we need to make sure we deal with the fact that things might be
|
|
155
|
+
// different after the await here.
|
|
156
|
+
const mediaStream = await this.getUserMedia(options);
|
|
157
|
+
// It's possible video was disabled, switched to screenshare, or
|
|
158
|
+
// switched to a different camera while awaiting a response, in
|
|
159
|
+
// which case we need to disable the camera we just accessed.
|
|
160
|
+
if (this.captureOptions != options) {
|
|
161
|
+
index_1.RingRTC.logWarn('startCapturing(): different state after getUserMedia()');
|
|
162
|
+
for (const track of mediaStream.getVideoTracks()) {
|
|
163
|
+
// Make the light turn off faster
|
|
164
|
+
track.stop();
|
|
165
|
+
}
|
|
163
166
|
return;
|
|
164
167
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
const mediaStream = yield this.getUserMedia(options);
|
|
173
|
-
// It's possible video was disabled, switched to screenshare, or
|
|
174
|
-
// switched to a different camera while awaiting a response, in
|
|
175
|
-
// which case we need to disable the camera we just accessed.
|
|
176
|
-
if (this.captureOptions != options) {
|
|
177
|
-
index_1.RingRTC.logWarn('startCapturing(): different state after getUserMedia()');
|
|
178
|
-
for (const track of mediaStream.getVideoTracks()) {
|
|
179
|
-
// Make the light turn off faster
|
|
180
|
-
track.stop();
|
|
181
|
-
}
|
|
182
|
-
return;
|
|
168
|
+
if (this.mediaStream !== undefined &&
|
|
169
|
+
this.mediaStream.getVideoTracks().length > 0) {
|
|
170
|
+
// We have a stream and track for the requested camera already. Stop
|
|
171
|
+
// the duplicate track that we just started.
|
|
172
|
+
index_1.RingRTC.logWarn('startCapturing(): dropping duplicate call to startCapturing');
|
|
173
|
+
for (const track of mediaStream.getVideoTracks()) {
|
|
174
|
+
track.stop();
|
|
183
175
|
}
|
|
184
|
-
|
|
185
|
-
this.mediaStream.getVideoTracks().length > 0) {
|
|
186
|
-
// We have a stream and track for the requested camera already. Stop
|
|
187
|
-
// the duplicate track that we just started.
|
|
188
|
-
index_1.RingRTC.logWarn('startCapturing(): dropping duplicate call to startCapturing');
|
|
189
|
-
for (const track of mediaStream.getVideoTracks()) {
|
|
190
|
-
track.stop();
|
|
191
|
-
}
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
this.mediaStream = mediaStream;
|
|
195
|
-
if (!this.spawnedSenderRunning &&
|
|
196
|
-
this.mediaStream != undefined &&
|
|
197
|
-
this.sender != undefined) {
|
|
198
|
-
this.spawnSender(this.mediaStream, this.sender);
|
|
199
|
-
}
|
|
200
|
-
this.updateLocalPreviewSourceObject();
|
|
176
|
+
return;
|
|
201
177
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
178
|
+
this.mediaStream = mediaStream;
|
|
179
|
+
if (!this.spawnedSenderRunning &&
|
|
180
|
+
this.mediaStream != undefined &&
|
|
181
|
+
this.sender != undefined) {
|
|
182
|
+
this.spawnSender(this.mediaStream, this.sender);
|
|
183
|
+
}
|
|
184
|
+
this.updateLocalPreviewSourceObject();
|
|
185
|
+
}
|
|
186
|
+
catch (e) {
|
|
187
|
+
index_1.RingRTC.logError(`startCapturing(): ${e}`);
|
|
188
|
+
// It's possible video was disabled, switched to screenshare, or
|
|
189
|
+
// switched to a different camera while awaiting a response, in
|
|
190
|
+
// which case we should reset the captureOptions if we set them.
|
|
191
|
+
if (this.captureOptions == options) {
|
|
192
|
+
// We couldn't open the camera. Oh well.
|
|
193
|
+
this.captureOptions = undefined;
|
|
211
194
|
}
|
|
212
|
-
}
|
|
195
|
+
}
|
|
213
196
|
}
|
|
214
197
|
stopCapturing() {
|
|
215
198
|
if (!this.capturing()) {
|
|
@@ -257,11 +240,10 @@ class GumVideoCapturer {
|
|
|
257
240
|
const buffer = Buffer.alloc(exports.MAX_VIDEO_CAPTURE_BUFFER_SIZE);
|
|
258
241
|
this.spawnedSenderRunning = true;
|
|
259
242
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
260
|
-
(() =>
|
|
261
|
-
var _a;
|
|
243
|
+
(async () => {
|
|
262
244
|
try {
|
|
263
245
|
while (mediaStream == this.mediaStream) {
|
|
264
|
-
const { done, value: frame } =
|
|
246
|
+
const { done, value: frame } = await reader.read();
|
|
265
247
|
if (done) {
|
|
266
248
|
break;
|
|
267
249
|
}
|
|
@@ -269,7 +251,7 @@ class GumVideoCapturer {
|
|
|
269
251
|
continue;
|
|
270
252
|
}
|
|
271
253
|
try {
|
|
272
|
-
const format = videoPixelFormatToEnum(
|
|
254
|
+
const format = videoPixelFormatToEnum(frame.format ?? 'I420');
|
|
273
255
|
if (format == undefined) {
|
|
274
256
|
index_1.RingRTC.logWarn(`Unsupported video frame format: ${frame.format}`);
|
|
275
257
|
break;
|
|
@@ -278,7 +260,7 @@ class GumVideoCapturer {
|
|
|
278
260
|
if (!visibleRect) {
|
|
279
261
|
continue;
|
|
280
262
|
}
|
|
281
|
-
|
|
263
|
+
await frame.copyTo(buffer);
|
|
282
264
|
if (sender !== this.sender) {
|
|
283
265
|
break;
|
|
284
266
|
}
|
|
@@ -300,7 +282,7 @@ class GumVideoCapturer {
|
|
|
300
282
|
reader.releaseLock();
|
|
301
283
|
}
|
|
302
284
|
this.spawnedSenderRunning = false;
|
|
303
|
-
})
|
|
285
|
+
})();
|
|
304
286
|
}
|
|
305
287
|
stopSending() {
|
|
306
288
|
// The spawned sender should stop
|
|
@@ -387,7 +369,6 @@ class CanvasVideoRenderer {
|
|
|
387
369
|
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
388
370
|
}
|
|
389
371
|
renderVideoFrame() {
|
|
390
|
-
var _a, _b;
|
|
391
372
|
if (!this.source || !this.canvas) {
|
|
392
373
|
return;
|
|
393
374
|
}
|
|
@@ -435,7 +416,7 @@ class CanvasVideoRenderer {
|
|
|
435
416
|
context.fillStyle = 'black';
|
|
436
417
|
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
437
418
|
}
|
|
438
|
-
if (
|
|
419
|
+
if (this.imageData?.width !== width || this.imageData?.height !== height) {
|
|
439
420
|
this.imageData = new ImageData(width, height);
|
|
440
421
|
}
|
|
441
422
|
this.imageData.data.set(this.buffer.subarray(0, width * height * 4));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signalapp/ringrtc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.34.0",
|
|
4
4
|
"description": "Signal Messenger voice and video calling library.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"config": {
|
|
26
26
|
"prebuildUrl": "https://build-artifacts.signal.org/libraries/ringrtc-desktop-build-v${npm_package_version}.tar.gz",
|
|
27
|
-
"prebuildChecksum": "
|
|
27
|
+
"prebuildChecksum": "7c61350a51f61c6ea06f68c08479260de21be36cc098bcca1d6392af579bd73f"
|
|
28
28
|
},
|
|
29
29
|
"author": "",
|
|
30
30
|
"license": "AGPL-3.0-only",
|