@stream-io/video-client 1.57.0 → 1.59.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/CHANGELOG.md +28 -0
- package/dist/e2ee-worker.browser.es.js +1342 -0
- package/dist/e2ee-worker.browser.es.js.map +1 -0
- package/dist/index.browser.es.js +1141 -117
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +1196 -115
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.es.js +1174 -117
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +66 -9
- package/dist/src/StreamVideoClient.d.ts +9 -1
- package/dist/src/coordinator/connection/connection.d.ts +1 -1
- package/dist/src/devices/CameraManager.d.ts +8 -1
- package/dist/src/devices/DeviceManager.d.ts +2 -1
- package/dist/src/devices/MicrophoneManager.d.ts +8 -1
- package/dist/src/devices/SpeakerManager.d.ts +2 -1
- package/dist/src/events/participant.d.ts +10 -3
- package/dist/src/gen/coordinator/index.d.ts +1386 -240
- package/dist/src/gen/video/sfu/models/models.d.ts +8 -0
- package/dist/src/helpers/MediaStreamRecorder.d.ts +26 -0
- package/dist/src/helpers/TypedEventEmitter.d.ts +23 -0
- package/dist/src/helpers/concurrency.d.ts +8 -0
- package/dist/src/helpers/ensureExhausted.d.ts +1 -1
- package/dist/src/helpers/loopback.d.ts +55 -0
- package/dist/src/permissions/PermissionsContext.d.ts +2 -2
- package/dist/src/reporting/ClientEventReporter.d.ts +0 -2
- package/dist/src/rtc/BasePeerConnection.d.ts +3 -1
- package/dist/src/rtc/Subscriber.d.ts +5 -0
- package/dist/src/rtc/e2ee/E2EEManager.d.ts +12 -0
- package/dist/src/rtc/e2ee/EncryptionManager.d.ts +148 -0
- package/dist/src/rtc/e2ee/e2ee-worker.d.ts +25 -0
- package/dist/src/rtc/e2ee/events.d.ts +163 -0
- package/dist/src/rtc/e2ee/transformSupport.d.ts +21 -0
- package/dist/src/rtc/helpers/rtcConfiguration.d.ts +2 -2
- package/dist/src/rtc/index.d.ts +1 -0
- package/dist/src/rtc/mediaEngine.d.ts +23 -0
- package/dist/src/rtc/types.d.ts +2 -0
- package/dist/src/store/CallState.d.ts +21 -0
- package/dist/src/types.d.ts +15 -6
- package/index.ts +5 -0
- package/package.json +1 -1
- package/src/Call.ts +311 -155
- package/src/StreamVideoClient.ts +35 -8
- package/src/__tests__/Call.lifecycle.test.ts +33 -2
- package/src/__tests__/Call.publishing.test.ts +42 -1
- package/src/__tests__/Call.test.ts +15 -0
- package/src/__tests__/StreamVideoClient.api.test.ts +33 -0
- package/src/__tests__/StreamVideoClient.rewatch.test.ts +213 -0
- package/src/__tests__/StreamVideoClient.ringing.test.ts +11 -4
- package/src/__tests__/StreamVideoClient.test.ts +14 -12
- package/src/coordinator/connection/connection.ts +6 -3
- package/src/devices/AudioDeviceManager.ts +6 -0
- package/src/devices/CameraManager.ts +67 -8
- package/src/devices/DeviceManager.ts +24 -4
- package/src/devices/MicrophoneManager.ts +66 -8
- package/src/devices/ScreenShareManager.ts +3 -0
- package/src/devices/SpeakerManager.ts +42 -12
- package/src/devices/__tests__/CameraManager.test.ts +27 -1
- package/src/devices/__tests__/DeviceManager.test.ts +49 -1
- package/src/devices/__tests__/MicrophoneManager.test.ts +23 -1
- package/src/devices/__tests__/MicrophoneManagerRN.test.ts +1 -20
- package/src/devices/__tests__/SpeakerManager.test.ts +138 -42
- package/src/devices/__tests__/mocks.ts +36 -3
- package/src/events/__tests__/participant.test.ts +134 -1
- package/src/events/call.ts +6 -3
- package/src/events/callEventHandlers.ts +9 -3
- package/src/events/participant.ts +42 -7
- package/src/gen/coordinator/index.ts +1402 -236
- package/src/gen/video/sfu/models/models.ts +15 -0
- package/src/helpers/MediaStreamRecorder.ts +104 -0
- package/src/helpers/TypedEventEmitter.ts +71 -0
- package/src/helpers/__tests__/MediaStreamRecorder.test.ts +324 -0
- package/src/helpers/__tests__/TypedEventEmitter.test.ts +133 -0
- package/src/helpers/__tests__/concurrency.test.ts +74 -0
- package/src/helpers/__tests__/loopback.test.ts +367 -0
- package/src/helpers/concurrency.ts +24 -0
- package/src/helpers/ensureExhausted.ts +4 -2
- package/src/helpers/loopback.ts +200 -0
- package/src/permissions/PermissionsContext.ts +10 -5
- package/src/reporting/ClientEventReporter.ts +15 -28
- package/src/reporting/__tests__/ClientEventReporter.test.ts +3 -7
- package/src/rtc/BasePeerConnection.ts +12 -1
- package/src/rtc/Publisher.ts +8 -0
- package/src/rtc/Subscriber.ts +13 -0
- package/src/rtc/__tests__/Publisher.test.ts +101 -0
- package/src/rtc/__tests__/Subscriber.test.ts +190 -0
- package/src/rtc/__tests__/mocks/webrtc.mocks.ts +31 -0
- package/src/rtc/e2ee/E2EEManager.ts +12 -0
- package/src/rtc/e2ee/EncryptionManager.ts +336 -0
- package/src/rtc/e2ee/SPEC.md +586 -0
- package/src/rtc/e2ee/__tests__/E2EEManager.contract.test.ts +39 -0
- package/src/rtc/e2ee/__tests__/EncryptionManager.test.ts +490 -0
- package/src/rtc/e2ee/__tests__/codec.test.ts +247 -0
- package/src/rtc/e2ee/__tests__/conformance.test.ts +184 -0
- package/src/rtc/e2ee/__tests__/failureTracker.test.ts +45 -0
- package/src/rtc/e2ee/__tests__/frameCounter.test.ts +90 -0
- package/src/rtc/e2ee/__tests__/keyStore.test.ts +221 -0
- package/src/rtc/e2ee/__tests__/notifications.test.ts +166 -0
- package/src/rtc/e2ee/__tests__/perf.test.ts +139 -0
- package/src/rtc/e2ee/__tests__/queue.test.ts +61 -0
- package/src/rtc/e2ee/__tests__/replayWindow.test.ts +133 -0
- package/src/rtc/e2ee/__tests__/trailer.test.ts +143 -0
- package/src/rtc/e2ee/__tests__/transform-pipeline.test.ts +839 -0
- package/src/rtc/e2ee/__tests__/transformSupport.test.ts +65 -0
- package/src/rtc/e2ee/e2ee-worker/codec.ts +220 -0
- package/src/rtc/e2ee/e2ee-worker/constants.ts +47 -0
- package/src/rtc/e2ee/e2ee-worker/decode.ts +159 -0
- package/src/rtc/e2ee/e2ee-worker/e2ee-worker-impl.ts +137 -0
- package/src/rtc/e2ee/e2ee-worker/encode.ts +147 -0
- package/src/rtc/e2ee/e2ee-worker/failureTracker.ts +26 -0
- package/src/rtc/e2ee/e2ee-worker/frameCounter.ts +37 -0
- package/src/rtc/e2ee/e2ee-worker/keyStore.ts +211 -0
- package/src/rtc/e2ee/e2ee-worker/notifications.ts +190 -0
- package/src/rtc/e2ee/e2ee-worker/perf.ts +129 -0
- package/src/rtc/e2ee/e2ee-worker/queue.ts +12 -0
- package/src/rtc/e2ee/e2ee-worker/replayWindow.ts +131 -0
- package/src/rtc/e2ee/e2ee-worker/trailer.ts +155 -0
- package/src/rtc/e2ee/e2ee-worker/tsconfig.json +8 -0
- package/src/rtc/e2ee/e2ee-worker/types.ts +29 -0
- package/src/rtc/e2ee/e2ee-worker.ts +27 -0
- package/src/rtc/e2ee/events.ts +179 -0
- package/src/rtc/e2ee/transformSupport.ts +35 -0
- package/src/rtc/helpers/rtcConfiguration.ts +4 -2
- package/src/rtc/index.ts +1 -0
- package/src/rtc/mediaEngine.ts +44 -0
- package/src/rtc/types.ts +2 -0
- package/src/store/CallState.ts +33 -1
- package/src/store/__tests__/CallState.test.ts +82 -1
- package/src/types.ts +23 -5
|
@@ -12,6 +12,7 @@ type OrphanedTrack = {
|
|
|
12
12
|
trackLookupPrefix: string;
|
|
13
13
|
trackType: TrackType;
|
|
14
14
|
track: MediaStream;
|
|
15
|
+
receiver?: RTCRtpReceiver;
|
|
15
16
|
};
|
|
16
17
|
/**
|
|
17
18
|
* Holds the state of the current call.
|
|
@@ -35,6 +36,7 @@ export declare class CallState {
|
|
|
35
36
|
private settingsSubject;
|
|
36
37
|
private transcribingSubject;
|
|
37
38
|
private captioningSubject;
|
|
39
|
+
private e2eeEnabledSubject;
|
|
38
40
|
private endedBySubject;
|
|
39
41
|
private thumbnailsSubject;
|
|
40
42
|
private membersSubject;
|
|
@@ -188,6 +190,11 @@ export declare class CallState {
|
|
|
188
190
|
* Will provide the closed captioning state of this call.
|
|
189
191
|
*/
|
|
190
192
|
captioning$: Observable<boolean>;
|
|
193
|
+
/**
|
|
194
|
+
* Whether end-to-end encryption is active for this call, as reported by the
|
|
195
|
+
* SFU in the join response.
|
|
196
|
+
*/
|
|
197
|
+
e2eeEnabled$: Observable<boolean>;
|
|
191
198
|
/**
|
|
192
199
|
* Will provide the user who ended this call.
|
|
193
200
|
*/
|
|
@@ -476,6 +483,10 @@ export declare class CallState {
|
|
|
476
483
|
* Will provide the transcribing state of this call.
|
|
477
484
|
*/
|
|
478
485
|
get transcribing(): boolean;
|
|
486
|
+
/**
|
|
487
|
+
* Whether end-to-end encryption is active for this call.
|
|
488
|
+
*/
|
|
489
|
+
get e2eeEnabled(): boolean;
|
|
479
490
|
/**
|
|
480
491
|
* Will provide the user who ended this call.
|
|
481
492
|
*/
|
|
@@ -571,6 +582,16 @@ export declare class CallState {
|
|
|
571
582
|
* @param id the ID of the orphaned track to remove.
|
|
572
583
|
*/
|
|
573
584
|
removeOrphanedTrack: (id: string) => void;
|
|
585
|
+
/**
|
|
586
|
+
* Drops every orphaned track. Call this when the peer connections that own
|
|
587
|
+
* the stored receivers go away (full leave, reconnect, or migration):
|
|
588
|
+
* `pc.close()` does not raise the track `ended` event, so the per-track
|
|
589
|
+
* cleanup never fires and the receivers + their closed PCs would otherwise
|
|
590
|
+
* leak for the call's lifetime.
|
|
591
|
+
*
|
|
592
|
+
* @internal
|
|
593
|
+
*/
|
|
594
|
+
removeAllOrphanedTracks: () => void;
|
|
574
595
|
/**
|
|
575
596
|
* Takes all orphaned tracks with the given track lookup prefix.
|
|
576
597
|
* All orphaned tracks with the given track lookup prefix are removed from the call state.
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Participant, TrackType, VideoDimension } from './gen/video/sfu/models/models';
|
|
2
|
-
import type { AudioSettingsRequestDefaultDeviceEnum, CallRecordingStartedEventRecordingTypeEnum, JoinCallRequest, MemberResponse, OwnCapability,
|
|
2
|
+
import type { AudioSettingsRequestDefaultDeviceEnum, CallRecordingStartedEventRecordingTypeEnum, JoinCallRequest, MemberResponse, OwnCapability, VideoReactionResponse, StartRecordingRequest, StartRecordingResponse } from './gen/coordinator';
|
|
3
3
|
import type { StreamClient } from './coordinator/connection/client';
|
|
4
4
|
import type { ClientEventReporter } from './reporting';
|
|
5
5
|
import type { RejectReason, StreamClientOptions, TokenProvider, User } from './coordinator/connection/types';
|
|
@@ -7,7 +7,7 @@ import type { Comparator } from './sorting';
|
|
|
7
7
|
import type { StreamVideoWriteableStateStore } from './store';
|
|
8
8
|
import { AxiosError } from 'axios';
|
|
9
9
|
import type { Call } from './Call';
|
|
10
|
-
export type StreamReaction = Pick<
|
|
10
|
+
export type StreamReaction = Pick<VideoReactionResponse, 'type' | 'emoji_code' | 'custom'>;
|
|
11
11
|
export declare enum VisibilityState {
|
|
12
12
|
UNKNOWN = "UNKNOWN",
|
|
13
13
|
VISIBLE = "VISIBLE",
|
|
@@ -344,8 +344,15 @@ type StreamRNVideoSDKCallManagerRingingParams = {
|
|
|
344
344
|
isRingingTypeCall: boolean;
|
|
345
345
|
};
|
|
346
346
|
type StreamRNVideoSDKCallManagerSetupParams = StreamRNVideoSDKCallManagerRingingParams & {
|
|
347
|
+
cid: string;
|
|
347
348
|
defaultDevice: AudioSettingsRequestDefaultDeviceEnum;
|
|
348
349
|
};
|
|
350
|
+
type StreamRNVideoSDKCallManagerStartParams = StreamRNVideoSDKCallManagerRingingParams & {
|
|
351
|
+
cid: string;
|
|
352
|
+
};
|
|
353
|
+
type StreamRNVideoSDKCallManagerStopParams = StreamRNVideoSDKCallManagerRingingParams & {
|
|
354
|
+
shouldStopCallManager: boolean;
|
|
355
|
+
};
|
|
349
356
|
type StreamRNVideoSDKEndCallReason =
|
|
350
357
|
/** Call ended by the local user (e.g., hanging up). */
|
|
351
358
|
'local'
|
|
@@ -371,6 +378,8 @@ type StreamRNVideoSDKCallingX = {
|
|
|
371
378
|
joinCall: (call: Call, activeCalls: Call[]) => Promise<void>;
|
|
372
379
|
endCall: (call: Call, reason?: StreamRNVideoSDKEndCallReason) => Promise<void>;
|
|
373
380
|
registerOutgoingCall: (call: Call) => Promise<void>;
|
|
381
|
+
wireAudioEngineSubscription: () => void;
|
|
382
|
+
unwireAudioEngineSubscription: () => void;
|
|
374
383
|
};
|
|
375
384
|
export type StreamRNVideoSDKGlobals = {
|
|
376
385
|
callingX: StreamRNVideoSDKCallingX;
|
|
@@ -378,15 +387,15 @@ export type StreamRNVideoSDKGlobals = {
|
|
|
378
387
|
/**
|
|
379
388
|
* Sets up the in call manager.
|
|
380
389
|
*/
|
|
381
|
-
setup({ defaultDevice, isRingingTypeCall, }: StreamRNVideoSDKCallManagerSetupParams): void;
|
|
390
|
+
setup({ defaultDevice, isRingingTypeCall, cid, }: StreamRNVideoSDKCallManagerSetupParams): void;
|
|
382
391
|
/**
|
|
383
392
|
* Starts the in call manager.
|
|
384
393
|
*/
|
|
385
|
-
start({ isRingingTypeCall, }:
|
|
394
|
+
start({ isRingingTypeCall, cid, }: StreamRNVideoSDKCallManagerStartParams): void;
|
|
386
395
|
/**
|
|
387
396
|
* Stops the in call manager.
|
|
388
397
|
*/
|
|
389
|
-
stop({ isRingingTypeCall }:
|
|
398
|
+
stop({ isRingingTypeCall, shouldStopCallManager, }: StreamRNVideoSDKCallManagerStopParams): void;
|
|
390
399
|
/**
|
|
391
400
|
* iOS-only. Keeps the audio engine's microphone-input (voice-processing)
|
|
392
401
|
* chain prepared while the mic is muted, so the `AVAudioEngine` stays full-duplex
|
|
@@ -423,5 +432,5 @@ declare global {
|
|
|
423
432
|
/**
|
|
424
433
|
* The options to pass to {@link Call.join} method.
|
|
425
434
|
*/
|
|
426
|
-
export type JoinCallData = Omit<JoinCallRequest, 'location'>;
|
|
435
|
+
export type JoinCallData = Omit<JoinCallRequest, 'location' | 'e2ee'>;
|
|
427
436
|
export { AxiosError };
|
package/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './src/stats/types';
|
|
|
11
11
|
|
|
12
12
|
export * from './src/Call';
|
|
13
13
|
export * from './src/CallType';
|
|
14
|
+
export * from './src/rtc/mediaEngine';
|
|
14
15
|
export * from './src/StreamVideoClient';
|
|
15
16
|
export * from './src/StreamSfuClient';
|
|
16
17
|
export * from './src/devices';
|
|
@@ -22,7 +23,11 @@ export * from './src/helpers/humanize';
|
|
|
22
23
|
export * from './src/helpers/DynascaleManager';
|
|
23
24
|
export * from './src/helpers/ViewportTracker';
|
|
24
25
|
export * from './src/helpers/sound-detector';
|
|
26
|
+
export * from './src/helpers/loopback';
|
|
27
|
+
export * from './src/helpers/MediaStreamRecorder';
|
|
25
28
|
export * from './src/helpers/participantUtils';
|
|
29
|
+
export * from './src/rtc/e2ee/E2EEManager';
|
|
30
|
+
export * from './src/rtc/e2ee/EncryptionManager';
|
|
26
31
|
export * as Browsers from './src/helpers/browsers';
|
|
27
32
|
|
|
28
33
|
export * from './src/logger';
|