@stream-io/video-client 0.3.33 → 0.3.35
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 +14 -0
- package/dist/index.browser.es.js +1400 -1356
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +1394 -1350
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1400 -1356
- package/dist/index.es.js.map +1 -1
- package/dist/src/coordinator/connection/insights.d.ts +1 -0
- package/dist/src/devices/devices.d.ts +0 -9
- package/dist/src/gen/coordinator/index.d.ts +33 -0
- package/dist/src/store/CallState.d.ts +1 -0
- package/dist/src/store/rxUtils.d.ts +3 -1
- package/package.json +12 -14
- package/src/__tests__/server-side/call-members.test.ts +1 -1
- package/src/__tests__/server-side/call-types.test.ts +2 -2
- package/src/__tests__/server-side/call.test.ts +1 -1
- package/src/__tests__/server-side/create-token.test.ts +1 -1
- package/src/__tests__/server-side/server-side-user.test.ts +1 -1
- package/src/coordinator/connection/client.ts +1 -1
- package/src/devices/ScreenShareState.ts +1 -2
- package/src/devices/devices.ts +51 -42
- package/src/gen/coordinator/index.ts +32 -0
- package/src/rtc/Publisher.ts +0 -1
- package/src/sorting/presets.ts +35 -19
- package/src/store/CallState.ts +35 -22
- package/src/store/__tests__/CallState.test.ts +9 -0
- package/src/store/rxUtils.ts +15 -7
- package/dist/src/__tests__/StreamVideoClient.test.d.ts +0 -1
- package/dist/src/__tests__/server-side/call-members.test.d.ts +0 -1
- package/dist/src/__tests__/server-side/call-types.test.d.ts +0 -1
- package/dist/src/__tests__/server-side/call.test.d.ts +0 -1
- package/dist/src/__tests__/server-side/create-token.test.d.ts +0 -1
- package/dist/src/__tests__/server-side/server-side-user.test.d.ts +0 -1
- package/dist/src/devices/__tests__/CameraManager.test.d.ts +0 -1
- package/dist/src/devices/__tests__/InputMediaDeviceManager.test.d.ts +0 -1
- package/dist/src/devices/__tests__/MicrophoneManager.test.d.ts +0 -1
- package/dist/src/devices/__tests__/ScreenShareManager.test.d.ts +0 -1
- package/dist/src/devices/__tests__/SpeakerManager.test.d.ts +0 -1
- package/dist/src/devices/__tests__/mocks.d.ts +0 -7
- package/dist/src/events/__tests__/call-permissions.test.d.ts +0 -1
- package/dist/src/events/__tests__/call.test.d.ts +0 -1
- package/dist/src/events/__tests__/mutes.test.d.ts +0 -1
- package/dist/src/events/__tests__/participant.test.d.ts +0 -1
- package/dist/src/helpers/__tests__/DynascaleManager.test.d.ts +0 -4
- package/dist/src/helpers/__tests__/hq-audio-sdp.d.ts +0 -1
- package/dist/src/helpers/__tests__/sdp-munging.test.d.ts +0 -1
- package/dist/src/rtc/__tests__/Publisher.test.d.ts +0 -1
- package/dist/src/rtc/__tests__/Subscriber.test.d.ts +0 -1
- package/dist/src/rtc/__tests__/mocks/webrtc.mocks.d.ts +0 -1
- package/dist/src/rtc/__tests__/videoLayers.test.d.ts +0 -1
- package/dist/src/sorting/__tests__/participant-data.d.ts +0 -2
- package/dist/src/sorting/__tests__/presets.test.d.ts +0 -1
- package/dist/src/sorting/__tests__/sorting.test.d.ts +0 -1
- package/dist/src/store/__tests__/CallState.test.d.ts +0 -1
- package/dist/version.d.ts +0 -1
package/src/store/rxUtils.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
import { Observable, Subject
|
|
1
|
+
import { combineLatest, Observable, Subject } from 'rxjs';
|
|
2
|
+
|
|
3
|
+
type FunctionPatch<T> = (currentValue: T) => T;
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* A value or a function which takes the current value and returns a new value.
|
|
5
7
|
*/
|
|
6
|
-
export type Patch<T> = T |
|
|
8
|
+
export type Patch<T> = T | FunctionPatch<T>;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Checks if the provided update is a function patch.
|
|
12
|
+
*
|
|
13
|
+
* @param update the value to check.
|
|
14
|
+
*/
|
|
15
|
+
const isFunctionPatch = <T>(update: Patch<T>): update is FunctionPatch<T> =>
|
|
16
|
+
typeof update === 'function';
|
|
7
17
|
|
|
8
18
|
/**
|
|
9
19
|
* Gets the current value of an observable, or undefined if the observable has
|
|
@@ -39,11 +49,9 @@ export const getCurrentValue = <T>(observable$: Observable<T>) => {
|
|
|
39
49
|
* @return the updated value.
|
|
40
50
|
*/
|
|
41
51
|
export const setCurrentValue = <T>(subject: Subject<T>, update: Patch<T>) => {
|
|
42
|
-
const next =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
? update(getCurrentValue(subject))
|
|
46
|
-
: update;
|
|
52
|
+
const next = isFunctionPatch(update)
|
|
53
|
+
? update(getCurrentValue(subject))
|
|
54
|
+
: update;
|
|
47
55
|
|
|
48
56
|
subject.next(next);
|
|
49
57
|
return next;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'dotenv/config';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'dotenv/config';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'dotenv/config';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'dotenv/config';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'dotenv/config';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'dotenv/config';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Call } from '../../Call';
|
|
2
|
-
export declare const mockVideoDevices: MediaDeviceInfo[];
|
|
3
|
-
export declare const mockAudioDevices: MediaDeviceInfo[];
|
|
4
|
-
export declare const mockCall: () => Partial<Call>;
|
|
5
|
-
export declare const mockAudioStream: () => MediaStream;
|
|
6
|
-
export declare const mockVideoStream: () => MediaStream;
|
|
7
|
-
export declare const mockScreenShareStream: (includeAudio?: boolean) => MediaStream;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const initialSdp: string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './mocks/webrtc.mocks';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './mocks/webrtc.mocks';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './mocks/webrtc.mocks';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/version.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const version = "0.3.33";
|