@stream-io/video-client 2.0.0-beta.0 → 2.0.0-beta.1
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 +18 -0
- package/dist/index.browser.es.js +1126 -791
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +1126 -791
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1126 -791
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +37 -11
- package/dist/src/StreamVideoClient.d.ts +15 -21
- package/dist/src/coordinator/connection/types.d.ts +16 -0
- package/dist/src/events/call.d.ts +0 -11
- package/dist/src/gen/coordinator/index.d.ts +73 -0
- package/dist/src/reporting/ClientEventReporter.d.ts +11 -1
- package/dist/src/ringing/RingStatePoller.d.ts +46 -0
- package/dist/src/ringing/RingTimeout.d.ts +27 -0
- package/dist/src/ringing/index.d.ts +4 -0
- package/dist/src/ringing/reconcileRingState.d.ts +18 -0
- package/dist/src/ringing/resolveOwnRingOutcome.d.ts +32 -0
- package/dist/src/rtc/Publisher.d.ts +18 -0
- package/dist/src/rtc/TransceiverCache.d.ts +10 -0
- package/dist/src/rtc/e2ee/E2EEManager.d.ts +10 -1
- package/dist/src/stats/utils.d.ts +6 -0
- package/dist/src/store/CallState.d.ts +118 -267
- package/dist/src/store/ClientState.d.ts +62 -0
- package/dist/src/store/index.d.ts +1 -1
- package/dist/src/store/subjects.d.ts +15 -0
- package/dist/src/store/types.d.ts +22 -0
- package/dist/src/types.d.ts +33 -4
- package/index.ts +1 -0
- package/package.json +2 -2
- package/src/Call.ts +285 -125
- package/src/StreamSfuClient.ts +6 -2
- package/src/StreamVideoClient.ts +40 -47
- package/src/__tests__/Call.autodrop.test.ts +118 -66
- package/src/__tests__/Call.getRingState.test.ts +87 -0
- package/src/__tests__/Call.lifecycle.test.ts +499 -6
- package/src/__tests__/Call.publishing.test.ts +2 -2
- package/src/__tests__/Call.ringSettled.test.ts +71 -0
- package/src/__tests__/Call.ringingLifecycle.test.ts +242 -0
- package/src/__tests__/StreamSfuClient.test.ts +48 -0
- package/src/__tests__/StreamVideoClient.disconnect.test.ts +62 -0
- package/src/coordinator/connection/types.ts +19 -0
- package/src/devices/__tests__/CameraManager.test.ts +2 -2
- package/src/devices/__tests__/DeviceManager.test.ts +2 -2
- package/src/devices/__tests__/DeviceManagerFilters.test.ts +2 -2
- package/src/devices/__tests__/MicrophoneManager.test.ts +2 -2
- package/src/devices/__tests__/MicrophoneManagerRN.test.ts +2 -2
- package/src/devices/__tests__/ScreenShareManager.test.ts +3 -3
- package/src/devices/__tests__/SpeakerManager.test.ts +4 -4
- package/src/events/__tests__/call.test.ts +5 -220
- package/src/events/call.ts +1 -73
- package/src/events/callEventHandlers.ts +12 -23
- package/src/gen/coordinator/index.ts +67 -0
- package/src/helpers/__tests__/AudioBindingsWatchdog.test.ts +2 -2
- package/src/helpers/__tests__/DynascaleManager.test.ts +2 -2
- package/src/helpers/__tests__/ViewportTracker.test.ts +2 -2
- package/src/reporting/ClientEventReporter.ts +30 -4
- package/src/reporting/__tests__/ClientEventReporter.test.ts +184 -7
- package/src/ringing/RingStatePoller.ts +177 -0
- package/src/ringing/RingTimeout.ts +90 -0
- package/src/ringing/__tests__/RingStatePoller.test.ts +462 -0
- package/src/ringing/__tests__/RingTimeout.test.ts +199 -0
- package/src/ringing/__tests__/reconcileRingState.test.ts +330 -0
- package/src/ringing/__tests__/resolveOwnRingOutcome.test.ts +103 -0
- package/src/ringing/index.ts +4 -0
- package/src/ringing/reconcileRingState.ts +108 -0
- package/src/ringing/resolveOwnRingOutcome.ts +58 -0
- package/src/rtc/Publisher.ts +66 -12
- package/src/rtc/TransceiverCache.ts +17 -0
- package/src/rtc/__tests__/Call.reconnect.test.ts +5 -5
- package/src/rtc/__tests__/Publisher.test.ts +209 -0
- package/src/rtc/__tests__/mocks/webrtc.mocks.ts +1 -0
- package/src/rtc/e2ee/E2EEManager.ts +10 -1
- package/src/rtc/e2ee/EncryptionManager.ts +1 -1
- package/src/rtc/e2ee/SPEC.md +1 -1
- package/src/stats/__tests__/utils.test.ts +33 -0
- package/src/stats/utils.ts +15 -0
- package/src/store/CallState.ts +305 -550
- package/src/store/ClientState.ts +101 -0
- package/src/store/__tests__/CallState.test.ts +60 -1
- package/src/store/__tests__/ClientState.test.ts +35 -0
- package/src/store/__tests__/rxUtils.test.ts +67 -1
- package/src/store/index.ts +1 -1
- package/src/store/rxUtils.ts +8 -4
- package/src/store/subjects.ts +30 -0
- package/src/store/types.ts +45 -0
- package/src/types.ts +40 -4
- package/dist/src/store/stateStore.d.ts +0 -84
- package/src/store/stateStore.ts +0 -156
package/dist/src/types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ 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';
|
|
6
6
|
import type { Comparator } from './sorting';
|
|
7
|
-
import type {
|
|
7
|
+
import type { ClientState } from './store';
|
|
8
8
|
import { AxiosError } from 'axios';
|
|
9
9
|
import type { Call } from './Call';
|
|
10
10
|
export type StreamReaction = Pick<VideoReactionResponse, 'type' | 'emoji_code' | 'custom'>;
|
|
@@ -293,9 +293,9 @@ export type CallConstructor = {
|
|
|
293
293
|
*/
|
|
294
294
|
sortParticipantsBy?: Comparator<StreamVideoParticipant>;
|
|
295
295
|
/**
|
|
296
|
-
* The state
|
|
296
|
+
* The state of the client.
|
|
297
297
|
*/
|
|
298
|
-
|
|
298
|
+
clientState: ClientState;
|
|
299
299
|
};
|
|
300
300
|
type StreamVideoClientBaseOptions = {
|
|
301
301
|
apiKey: string;
|
|
@@ -375,14 +375,43 @@ type StreamRNVideoSDKEndCallReason =
|
|
|
375
375
|
/** Unknown or unspecified disconnect reason. */
|
|
376
376
|
| 'unknown';
|
|
377
377
|
type StreamRNVideoSDKCallingX = {
|
|
378
|
-
|
|
378
|
+
/**
|
|
379
|
+
* @param isCancelled - polled around the bridge's waits: registration is
|
|
380
|
+
* skipped, or undone, when it returns true. Supplied by the join attempt
|
|
381
|
+
* because the call's own state cannot distinguish a fresh join starting
|
|
382
|
+
* from `LEFT` from an abandoned one that reached `LEFT` while waiting.
|
|
383
|
+
*/
|
|
384
|
+
joinCall: (call: Call, activeCalls: Call[], isCancelled?: () => boolean) => Promise<void>;
|
|
379
385
|
endCall: (call: Call, reason?: StreamRNVideoSDKEndCallReason) => Promise<void>;
|
|
380
386
|
registerOutgoingCall: (call: Call) => Promise<void>;
|
|
381
387
|
wireAudioEngineSubscription: () => void;
|
|
382
388
|
unwireAudioEngineSubscription: () => void;
|
|
383
389
|
};
|
|
390
|
+
/**
|
|
391
|
+
* React Native's preparation and cleanup for a ringing call's join.
|
|
392
|
+
*
|
|
393
|
+
* A ringing call is joined by the SDK rather than by app code, so there is no
|
|
394
|
+
* point at which the app holds the call and can still set it up. These are that
|
|
395
|
+
* point, and the matching release.
|
|
396
|
+
*/
|
|
397
|
+
type StreamRNVideoSDKRingingCallLifecycle = {
|
|
398
|
+
/**
|
|
399
|
+
* Runs the app's pre-join setup and resolves once it is done, bounded by a
|
|
400
|
+
* deadline. Rejecting fails the join closed rather than joining with nothing
|
|
401
|
+
* installed.
|
|
402
|
+
*/
|
|
403
|
+
beforeJoin: (call: Call) => Promise<void>;
|
|
404
|
+
/**
|
|
405
|
+
* The join failed terminally. Ends the ringing flow and releases what the
|
|
406
|
+
* setup installed. Never rejects, so the original join error survives.
|
|
407
|
+
*/
|
|
408
|
+
onJoinFailed: (call: Call) => Promise<void>;
|
|
409
|
+
/** The call has ended; release whatever the pre-join hook installed. */
|
|
410
|
+
onLeave: (call: Call) => void;
|
|
411
|
+
};
|
|
384
412
|
export type StreamRNVideoSDKGlobals = {
|
|
385
413
|
callingX: StreamRNVideoSDKCallingX;
|
|
414
|
+
ringingCallLifecycle: StreamRNVideoSDKRingingCallLifecycle;
|
|
386
415
|
callManager: {
|
|
387
416
|
/**
|
|
388
417
|
* Sets up the in call manager.
|
package/index.ts
CHANGED
|
@@ -26,6 +26,7 @@ export * from './src/helpers/sound-detector';
|
|
|
26
26
|
export * from './src/helpers/loopback';
|
|
27
27
|
export * from './src/helpers/MediaStreamRecorder';
|
|
28
28
|
export * from './src/helpers/participantUtils';
|
|
29
|
+
export * from './src/helpers/TypedEventEmitter';
|
|
29
30
|
export * from './src/rtc/e2ee/E2EEManager';
|
|
30
31
|
export * from './src/rtc/e2ee/EncryptionManager';
|
|
31
32
|
export * as Browsers from './src/helpers/browsers';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/video-client",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"module": "dist/index.es.js",
|
|
6
6
|
"browser": "dist/index.browser.es.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@openapitools/openapi-generator-cli": "^2.40.1",
|
|
47
47
|
"@rollup/plugin-replace": "^6.0.3",
|
|
48
48
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
49
|
-
"@stream-io/audio-filters-web": "^0.
|
|
49
|
+
"@stream-io/audio-filters-web": "^1.0.0-beta.0",
|
|
50
50
|
"@stream-io/node-sdk": "^0.7.63",
|
|
51
51
|
"@stream-io/typescript-config": "^0.0.0",
|
|
52
52
|
"@total-typescript/shoehorn": "^0.1.2",
|