@whereby.com/core 1.2.9 → 1.3.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/index.cjs +180 -6
- package/dist/index.d.cts +26 -0
- package/dist/index.d.mts +26 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.mjs +181 -7
- package/dist/legacy-esm.js +181 -7
- package/dist/redux/index.cjs +161 -7
- package/dist/redux/index.d.cts +154 -1
- package/dist/redux/index.d.mts +154 -1
- package/dist/redux/index.d.ts +154 -1
- package/dist/redux/index.js +160 -8
- package/dist/redux/index.mjs +160 -8
- package/package.json +10 -2
package/dist/index.cjs
CHANGED
|
@@ -1147,9 +1147,9 @@ const createReactor = (selectors, callback) => {
|
|
|
1147
1147
|
});
|
|
1148
1148
|
};
|
|
1149
1149
|
|
|
1150
|
-
const coreVersion = "1.
|
|
1150
|
+
const coreVersion = "1.3.0";
|
|
1151
1151
|
|
|
1152
|
-
const initialState = {
|
|
1152
|
+
const initialState$1 = {
|
|
1153
1153
|
isNodeSdk: false,
|
|
1154
1154
|
isActive: false,
|
|
1155
1155
|
isDialIn: false,
|
|
@@ -1163,7 +1163,7 @@ const initialState = {
|
|
|
1163
1163
|
};
|
|
1164
1164
|
const appSlice = toolkit.createSlice({
|
|
1165
1165
|
name: "app",
|
|
1166
|
-
initialState,
|
|
1166
|
+
initialState: initialState$1,
|
|
1167
1167
|
reducers: {
|
|
1168
1168
|
doAppStart: (state, action) => {
|
|
1169
1169
|
const url = new URL(action.payload.roomUrl);
|
|
@@ -1690,6 +1690,12 @@ const localMediaSlice = toolkit.createSlice({
|
|
|
1690
1690
|
builder.addCase(doSwitchLocalStream.rejected, (state) => {
|
|
1691
1691
|
return Object.assign(Object.assign({}, state), { isSwitchingStream: false });
|
|
1692
1692
|
});
|
|
1693
|
+
builder.addCase(doLocalStreamEffect.fulfilled, (state, { payload }) => {
|
|
1694
|
+
if (!payload) {
|
|
1695
|
+
return state;
|
|
1696
|
+
}
|
|
1697
|
+
return Object.assign(Object.assign({}, state), { beforeEffectTracks: Object.assign(Object.assign({}, state.beforeEffectTracks), payload.beforeEffectTracks) });
|
|
1698
|
+
});
|
|
1693
1699
|
},
|
|
1694
1700
|
});
|
|
1695
1701
|
const { deviceBusy, setCurrentCameraDeviceId, setCurrentMicrophoneDeviceId, setCurrentSpeakerDeviceId, toggleCameraEnabled, toggleMicrophoneEnabled, toggleLowDataModeEnabled, setLocalMediaOptions, setLocalMediaStream, localMediaStopped, localStreamMetadataUpdated, } = localMediaSlice.actions;
|
|
@@ -1819,6 +1825,15 @@ const doSwitchLocalStream = createAppAsyncThunk("localMedia/doSwitchLocalStream"
|
|
|
1819
1825
|
if (!replaceStream) {
|
|
1820
1826
|
return;
|
|
1821
1827
|
}
|
|
1828
|
+
const beforeEffectTracks = selectLocalMediaBeforeEffectTracks(state);
|
|
1829
|
+
if (audioId !== undefined && (beforeEffectTracks === null || beforeEffectTracks === void 0 ? void 0 : beforeEffectTracks.audio)) {
|
|
1830
|
+
beforeEffectTracks.audio.stop();
|
|
1831
|
+
beforeEffectTracks.audio = undefined;
|
|
1832
|
+
}
|
|
1833
|
+
if (videoId !== undefined && (beforeEffectTracks === null || beforeEffectTracks === void 0 ? void 0 : beforeEffectTracks.video)) {
|
|
1834
|
+
beforeEffectTracks.video.stop();
|
|
1835
|
+
beforeEffectTracks.video = undefined;
|
|
1836
|
+
}
|
|
1822
1837
|
try {
|
|
1823
1838
|
const { replacedTracks } = yield media.getStream(Object.assign(Object.assign({}, constraintsOptions), { audioId: audioId === undefined ? false : audioId, videoId: videoId === undefined ? false : videoId, type: "exact" }), { replaceStream });
|
|
1824
1839
|
const deviceId = audioId || videoId;
|
|
@@ -1827,7 +1842,7 @@ const doSwitchLocalStream = createAppAsyncThunk("localMedia/doSwitchLocalStream"
|
|
|
1827
1842
|
deviceId,
|
|
1828
1843
|
}));
|
|
1829
1844
|
}
|
|
1830
|
-
return { replacedTracks };
|
|
1845
|
+
return { replacedTracks, beforeEffectTracks };
|
|
1831
1846
|
}
|
|
1832
1847
|
catch (error) {
|
|
1833
1848
|
console.error(error);
|
|
@@ -1878,6 +1893,46 @@ const doStopLocalMedia = createAppThunk(() => (dispatch, getState) => {
|
|
|
1878
1893
|
}
|
|
1879
1894
|
dispatch(localMediaStopped());
|
|
1880
1895
|
});
|
|
1896
|
+
const doLocalStreamEffect = createAppAsyncThunk("localMedia/doLocalStreamEffect", (_a, _b) => __awaiter(void 0, [_a, _b], void 0, function* ({ effectStream, only, stopBeforeTrack, }, { getState }) {
|
|
1897
|
+
var _c;
|
|
1898
|
+
const state = getState();
|
|
1899
|
+
let beforeEffectTracks = selectLocalMediaBeforeEffectTracks(state);
|
|
1900
|
+
const beforeTrack = beforeEffectTracks === null || beforeEffectTracks === void 0 ? void 0 : beforeEffectTracks[only];
|
|
1901
|
+
if (!effectStream && !beforeTrack)
|
|
1902
|
+
return;
|
|
1903
|
+
try {
|
|
1904
|
+
const stream = selectLocalMediaStream(state);
|
|
1905
|
+
let replacedTracks = null;
|
|
1906
|
+
if (!stream) {
|
|
1907
|
+
throw new Error("No local media stream");
|
|
1908
|
+
}
|
|
1909
|
+
if (effectStream) {
|
|
1910
|
+
if (!beforeTrack) {
|
|
1911
|
+
beforeEffectTracks = {
|
|
1912
|
+
[only]: (_c = (only === "audio" ? stream === null || stream === void 0 ? void 0 : stream.getAudioTracks() : stream === null || stream === void 0 ? void 0 : stream.getVideoTracks())) === null || _c === void 0 ? void 0 : _c[0],
|
|
1913
|
+
};
|
|
1914
|
+
}
|
|
1915
|
+
replacedTracks = media.replaceTracksInStream(stream, effectStream, only);
|
|
1916
|
+
}
|
|
1917
|
+
else if (!stopBeforeTrack) {
|
|
1918
|
+
replacedTracks = media.replaceTracksInStream(stream, beforeTrack ? new MediaStream([beforeTrack]) : new MediaStream(), only);
|
|
1919
|
+
beforeEffectTracks = {
|
|
1920
|
+
[only]: undefined,
|
|
1921
|
+
};
|
|
1922
|
+
}
|
|
1923
|
+
else if (beforeTrack) {
|
|
1924
|
+
beforeEffectTracks = {
|
|
1925
|
+
[only]: undefined,
|
|
1926
|
+
};
|
|
1927
|
+
beforeTrack.stop();
|
|
1928
|
+
}
|
|
1929
|
+
return { effectStream, beforeEffectTracks, replacedTracks };
|
|
1930
|
+
}
|
|
1931
|
+
catch (error) {
|
|
1932
|
+
console.error("Error applying local stream effect", error);
|
|
1933
|
+
return;
|
|
1934
|
+
}
|
|
1935
|
+
}));
|
|
1881
1936
|
const selectBusyDeviceIds = (state) => state.localMedia.busyDeviceIds;
|
|
1882
1937
|
const selectCameraDeviceError = (state) => state.localMedia.cameraDeviceError;
|
|
1883
1938
|
const selectCurrentCameraDeviceId = (state) => state.localMedia.currentCameraDeviceId;
|
|
@@ -1898,6 +1953,7 @@ const selectLocalMediaStream = (state) => state.localMedia.stream;
|
|
|
1898
1953
|
const selectMicrophoneDeviceError = (state) => state.localMedia.microphoneDeviceError;
|
|
1899
1954
|
const selectLocalMediaStartError = (state) => state.localMedia.startError;
|
|
1900
1955
|
const selectLocalMediaIsSwitchingStream = (state) => state.localMedia.isSwitchingStream;
|
|
1956
|
+
const selectLocalMediaBeforeEffectTracks = (state) => state.localMedia.beforeEffectTracks;
|
|
1901
1957
|
const selectLocalMediaConstraintsOptions = toolkit.createSelector(selectLocalMediaDevices, selectCurrentCameraDeviceId, selectCurrentMicrophoneDeviceId, selectIsLowDataModeEnabled, (devices, videoId, audioId, lowDataMode) => ({
|
|
1902
1958
|
devices,
|
|
1903
1959
|
videoId,
|
|
@@ -1994,7 +2050,7 @@ startAppListening({
|
|
|
1994
2050
|
},
|
|
1995
2051
|
});
|
|
1996
2052
|
startAppListening({
|
|
1997
|
-
matcher: toolkit.isAnyOf(doStartLocalMedia.fulfilled, doUpdateDeviceList.fulfilled, doSwitchLocalStream.fulfilled, doSwitchLocalStream.rejected),
|
|
2053
|
+
matcher: toolkit.isAnyOf(doStartLocalMedia.fulfilled, doUpdateDeviceList.fulfilled, doSwitchLocalStream.fulfilled, doSwitchLocalStream.rejected, doLocalStreamEffect.fulfilled),
|
|
1998
2054
|
effect: (_action, { dispatch, getState }) => {
|
|
1999
2055
|
const state = getState();
|
|
2000
2056
|
const stream = selectLocalMediaStream(state);
|
|
@@ -3045,7 +3101,7 @@ startAppListening({
|
|
|
3045
3101
|
},
|
|
3046
3102
|
});
|
|
3047
3103
|
startAppListening({
|
|
3048
|
-
|
|
3104
|
+
matcher: toolkit.isAnyOf(doSwitchLocalStream.fulfilled, doLocalStreamEffect.fulfilled),
|
|
3049
3105
|
effect: ({ payload }, { getState }) => {
|
|
3050
3106
|
var _a;
|
|
3051
3107
|
const stream = selectLocalMediaStream(getState());
|
|
@@ -4061,11 +4117,107 @@ const doRejectWaitingParticipant = createRoomConnectedThunk((payload) => (dispat
|
|
|
4061
4117
|
});
|
|
4062
4118
|
const selectWaitingParticipants = (state) => state.waitingParticipants.waitingParticipants;
|
|
4063
4119
|
|
|
4120
|
+
const initialState = {
|
|
4121
|
+
isSwitching: false,
|
|
4122
|
+
raw: {},
|
|
4123
|
+
};
|
|
4124
|
+
const cameraEffectsSlice = toolkit.createSlice({
|
|
4125
|
+
name: "cameraEffects",
|
|
4126
|
+
initialState,
|
|
4127
|
+
reducers: {
|
|
4128
|
+
cameraEffectsSwitching(state, action) {
|
|
4129
|
+
state.isSwitching = action.payload.isSwitching;
|
|
4130
|
+
},
|
|
4131
|
+
cameraEffectsCleared(state) {
|
|
4132
|
+
state.currentEffectId = null;
|
|
4133
|
+
state.setup = undefined;
|
|
4134
|
+
state.params = undefined;
|
|
4135
|
+
state.raw = {};
|
|
4136
|
+
state.error = undefined;
|
|
4137
|
+
state.isSwitching = false;
|
|
4138
|
+
},
|
|
4139
|
+
cameraEffectsUpdated(state, action) {
|
|
4140
|
+
const { effectId, setup, params, raw } = action.payload;
|
|
4141
|
+
state.currentEffectId = effectId;
|
|
4142
|
+
state.setup = setup;
|
|
4143
|
+
state.params = params;
|
|
4144
|
+
if (raw)
|
|
4145
|
+
state.raw = raw;
|
|
4146
|
+
state.error = undefined;
|
|
4147
|
+
state.isSwitching = false;
|
|
4148
|
+
},
|
|
4149
|
+
cameraEffectsError(state, action) {
|
|
4150
|
+
state.error = action.payload.error;
|
|
4151
|
+
state.isSwitching = false;
|
|
4152
|
+
},
|
|
4153
|
+
},
|
|
4154
|
+
});
|
|
4155
|
+
const { cameraEffectsSwitching, cameraEffectsCleared, cameraEffectsUpdated, cameraEffectsError } = cameraEffectsSlice.actions;
|
|
4156
|
+
const selectCameraEffectsRaw = (state) => state.cameraEffects.raw;
|
|
4157
|
+
const doCameraEffectsSwitchPreset = createAppAsyncThunk("cameraEffects/switchPreset", (_a, _b) => __awaiter(void 0, [_a, _b], void 0, function* ({ effectId, setup, params, allowSafari, }, { getState, dispatch, rejectWithValue }) {
|
|
4158
|
+
var _c, _d, _e;
|
|
4159
|
+
const state = getState();
|
|
4160
|
+
if (selectLocalMediaIsSwitchingStream(state)) {
|
|
4161
|
+
return;
|
|
4162
|
+
}
|
|
4163
|
+
dispatch(cameraEffectsSwitching({ isSwitching: true }));
|
|
4164
|
+
try {
|
|
4165
|
+
const raw = selectCameraEffectsRaw(state);
|
|
4166
|
+
const localStream = selectLocalMediaStream(state);
|
|
4167
|
+
if (!((_c = localStream === null || localStream === void 0 ? void 0 : localStream.getVideoTracks()) === null || _c === void 0 ? void 0 : _c[0])) {
|
|
4168
|
+
dispatch(cameraEffectsCleared());
|
|
4169
|
+
return;
|
|
4170
|
+
}
|
|
4171
|
+
if (!effectId) {
|
|
4172
|
+
if (raw.effectStream) {
|
|
4173
|
+
yield dispatch(doLocalStreamEffect({ effectStream: undefined, only: "video" }));
|
|
4174
|
+
}
|
|
4175
|
+
(_d = raw.stop) === null || _d === void 0 ? void 0 : _d.call(raw);
|
|
4176
|
+
dispatch(cameraEffectsCleared());
|
|
4177
|
+
return;
|
|
4178
|
+
}
|
|
4179
|
+
if (raw.tryUpdate) {
|
|
4180
|
+
const ok = yield raw.tryUpdate(effectId, Object.assign({}, (setup || {})), Object.assign({}, (params || {})));
|
|
4181
|
+
if (ok) {
|
|
4182
|
+
dispatch(cameraEffectsUpdated({ effectId, setup, params }));
|
|
4183
|
+
return;
|
|
4184
|
+
}
|
|
4185
|
+
}
|
|
4186
|
+
if (raw.effectStream) {
|
|
4187
|
+
yield dispatch(doLocalStreamEffect({ effectStream: undefined, only: "video" }));
|
|
4188
|
+
(_e = raw.stop) === null || _e === void 0 ? void 0 : _e.call(raw);
|
|
4189
|
+
}
|
|
4190
|
+
let mod;
|
|
4191
|
+
try {
|
|
4192
|
+
mod = yield import('@whereby.com/camera-effects');
|
|
4193
|
+
}
|
|
4194
|
+
catch (_f) {
|
|
4195
|
+
throw new Error("@whereby.com/camera-effects is not installed. Add it as a dependency to enable camera effects.");
|
|
4196
|
+
}
|
|
4197
|
+
const { createEffectStream, getUsablePresets } = mod;
|
|
4198
|
+
const usable = getUsablePresets({ filter: () => true, options: { allowSafari } });
|
|
4199
|
+
if (!usable.includes(effectId)) {
|
|
4200
|
+
throw new Error(`Unknown or unsupported effect preset: ${effectId}`);
|
|
4201
|
+
}
|
|
4202
|
+
const { stream: effectStream, stop, tryUpdate, } = yield createEffectStream(localStream, effectId, setup, params);
|
|
4203
|
+
yield dispatch(doLocalStreamEffect({ effectStream, only: "video" }));
|
|
4204
|
+
dispatch(cameraEffectsUpdated({ effectId, setup, params, raw: { stop, tryUpdate, effectStream } }));
|
|
4205
|
+
}
|
|
4206
|
+
catch (error) {
|
|
4207
|
+
dispatch(cameraEffectsError({ error }));
|
|
4208
|
+
return rejectWithValue(error);
|
|
4209
|
+
}
|
|
4210
|
+
}));
|
|
4211
|
+
createAppAsyncThunk("cameraEffects/clear", (_1, _a) => __awaiter(void 0, [_1, _a], void 0, function* (_, { dispatch }) {
|
|
4212
|
+
yield dispatch(doCameraEffectsSwitchPreset({ effectId: null }));
|
|
4213
|
+
}));
|
|
4214
|
+
|
|
4064
4215
|
const IS_DEV = undefined === "true";
|
|
4065
4216
|
const appReducer = toolkit.combineReducers({
|
|
4066
4217
|
app: appSlice.reducer,
|
|
4067
4218
|
authorization: authorizationSlice.reducer,
|
|
4068
4219
|
breakout: breakoutSlice.reducer,
|
|
4220
|
+
cameraEffects: cameraEffectsSlice.reducer,
|
|
4069
4221
|
chat: chatSlice.reducer,
|
|
4070
4222
|
cloudRecording: cloudRecordingSlice.reducer,
|
|
4071
4223
|
connectionMonitor: connectionMonitorSlice.reducer,
|
|
@@ -4735,6 +4887,28 @@ class RoomConnectionClient extends BaseClient {
|
|
|
4735
4887
|
reportStreamResolution(streamId, width, height) {
|
|
4736
4888
|
this.store.dispatch(doRtcReportStreamResolution({ streamId, width, height }));
|
|
4737
4889
|
}
|
|
4890
|
+
switchCameraEffect(effectId) {
|
|
4891
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4892
|
+
try {
|
|
4893
|
+
yield this.store.dispatch(doCameraEffectsSwitchPreset({ effectId }));
|
|
4894
|
+
}
|
|
4895
|
+
catch (error) {
|
|
4896
|
+
return Promise.reject(error);
|
|
4897
|
+
}
|
|
4898
|
+
return Promise.resolve();
|
|
4899
|
+
});
|
|
4900
|
+
}
|
|
4901
|
+
clearCameraEffect() {
|
|
4902
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4903
|
+
try {
|
|
4904
|
+
yield this.store.dispatch(doCameraEffectsSwitchPreset({ effectId: null }));
|
|
4905
|
+
}
|
|
4906
|
+
catch (error) {
|
|
4907
|
+
return Promise.reject(error);
|
|
4908
|
+
}
|
|
4909
|
+
return Promise.resolve();
|
|
4910
|
+
});
|
|
4911
|
+
}
|
|
4738
4912
|
destroy() {
|
|
4739
4913
|
super.destroy();
|
|
4740
4914
|
this.store.dispatch(doAppStop());
|
package/dist/index.d.cts
CHANGED
|
@@ -5,6 +5,7 @@ export { RoomJoinedSuccess } from '@whereby.com/media';
|
|
|
5
5
|
import * as redux_thunk from 'redux-thunk';
|
|
6
6
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
7
7
|
import * as redux from 'redux';
|
|
8
|
+
import { Setup, Params } from '@whereby.com/camera-effects';
|
|
8
9
|
|
|
9
10
|
type Json = string | number | boolean | null | Array<Json> | {
|
|
10
11
|
[key: string]: Json;
|
|
@@ -586,6 +587,21 @@ interface CloudRecordingState$1 {
|
|
|
586
587
|
startedAt?: number;
|
|
587
588
|
}
|
|
588
589
|
|
|
590
|
+
type TryUpdateFn = (presetId: string, setup: Setup, params: Params) => Promise<boolean>;
|
|
591
|
+
type StopFn = () => void;
|
|
592
|
+
interface CameraEffectsState {
|
|
593
|
+
currentEffectId?: string | null;
|
|
594
|
+
setup?: Setup;
|
|
595
|
+
params?: Params;
|
|
596
|
+
isSwitching: boolean;
|
|
597
|
+
error?: unknown;
|
|
598
|
+
raw: {
|
|
599
|
+
stop?: StopFn;
|
|
600
|
+
tryUpdate?: TryUpdateFn;
|
|
601
|
+
effectStream?: MediaStream;
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
|
|
589
605
|
interface AuthorizationState {
|
|
590
606
|
roomKey: string | null;
|
|
591
607
|
assistantKey?: string | null;
|
|
@@ -663,6 +679,10 @@ interface LocalMediaState$1 {
|
|
|
663
679
|
stream?: MediaStream;
|
|
664
680
|
isSwitchingStream: boolean;
|
|
665
681
|
onDeviceChange?: () => void;
|
|
682
|
+
beforeEffectTracks?: {
|
|
683
|
+
audio?: MediaStreamTrack;
|
|
684
|
+
video?: MediaStreamTrack;
|
|
685
|
+
};
|
|
666
686
|
}
|
|
667
687
|
|
|
668
688
|
interface AppConfig {
|
|
@@ -738,6 +758,7 @@ declare const appReducer: redux.Reducer<{
|
|
|
738
758
|
app: AppState;
|
|
739
759
|
authorization: AuthorizationState;
|
|
740
760
|
breakout: BreakoutState$1;
|
|
761
|
+
cameraEffects: CameraEffectsState;
|
|
741
762
|
chat: ChatState;
|
|
742
763
|
cloudRecording: CloudRecordingState$1;
|
|
743
764
|
connectionMonitor: ConnectionMonitorState;
|
|
@@ -760,6 +781,7 @@ declare const appReducer: redux.Reducer<{
|
|
|
760
781
|
app: AppState | undefined;
|
|
761
782
|
authorization: AuthorizationState | undefined;
|
|
762
783
|
breakout: BreakoutState$1 | undefined;
|
|
784
|
+
cameraEffects: CameraEffectsState | undefined;
|
|
763
785
|
chat: ChatState | undefined;
|
|
764
786
|
cloudRecording: CloudRecordingState$1 | undefined;
|
|
765
787
|
connectionMonitor: ConnectionMonitorState | undefined;
|
|
@@ -786,6 +808,7 @@ declare const createStore: ({ preloadedState, injectServices, }: {
|
|
|
786
808
|
app: AppState;
|
|
787
809
|
authorization: AuthorizationState;
|
|
788
810
|
breakout: BreakoutState$1;
|
|
811
|
+
cameraEffects: CameraEffectsState;
|
|
789
812
|
chat: ChatState;
|
|
790
813
|
cloudRecording: CloudRecordingState$1;
|
|
791
814
|
connectionMonitor: ConnectionMonitorState;
|
|
@@ -809,6 +832,7 @@ declare const createStore: ({ preloadedState, injectServices, }: {
|
|
|
809
832
|
app: AppState;
|
|
810
833
|
authorization: AuthorizationState;
|
|
811
834
|
breakout: BreakoutState$1;
|
|
835
|
+
cameraEffects: CameraEffectsState;
|
|
812
836
|
chat: ChatState;
|
|
813
837
|
cloudRecording: CloudRecordingState$1;
|
|
814
838
|
connectionMonitor: ConnectionMonitorState;
|
|
@@ -1160,6 +1184,8 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
|
|
|
1160
1184
|
joinBreakoutGroup(group: string): void;
|
|
1161
1185
|
joinBreakoutMainRoom(): void;
|
|
1162
1186
|
reportStreamResolution(streamId: string, width: number, height: number): void;
|
|
1187
|
+
switchCameraEffect(effectId: string): Promise<void>;
|
|
1188
|
+
clearCameraEffect(): Promise<void>;
|
|
1163
1189
|
destroy(): void;
|
|
1164
1190
|
}
|
|
1165
1191
|
|
package/dist/index.d.mts
CHANGED
|
@@ -5,6 +5,7 @@ export { RoomJoinedSuccess } from '@whereby.com/media';
|
|
|
5
5
|
import * as redux_thunk from 'redux-thunk';
|
|
6
6
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
7
7
|
import * as redux from 'redux';
|
|
8
|
+
import { Setup, Params } from '@whereby.com/camera-effects';
|
|
8
9
|
|
|
9
10
|
type Json = string | number | boolean | null | Array<Json> | {
|
|
10
11
|
[key: string]: Json;
|
|
@@ -586,6 +587,21 @@ interface CloudRecordingState$1 {
|
|
|
586
587
|
startedAt?: number;
|
|
587
588
|
}
|
|
588
589
|
|
|
590
|
+
type TryUpdateFn = (presetId: string, setup: Setup, params: Params) => Promise<boolean>;
|
|
591
|
+
type StopFn = () => void;
|
|
592
|
+
interface CameraEffectsState {
|
|
593
|
+
currentEffectId?: string | null;
|
|
594
|
+
setup?: Setup;
|
|
595
|
+
params?: Params;
|
|
596
|
+
isSwitching: boolean;
|
|
597
|
+
error?: unknown;
|
|
598
|
+
raw: {
|
|
599
|
+
stop?: StopFn;
|
|
600
|
+
tryUpdate?: TryUpdateFn;
|
|
601
|
+
effectStream?: MediaStream;
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
|
|
589
605
|
interface AuthorizationState {
|
|
590
606
|
roomKey: string | null;
|
|
591
607
|
assistantKey?: string | null;
|
|
@@ -663,6 +679,10 @@ interface LocalMediaState$1 {
|
|
|
663
679
|
stream?: MediaStream;
|
|
664
680
|
isSwitchingStream: boolean;
|
|
665
681
|
onDeviceChange?: () => void;
|
|
682
|
+
beforeEffectTracks?: {
|
|
683
|
+
audio?: MediaStreamTrack;
|
|
684
|
+
video?: MediaStreamTrack;
|
|
685
|
+
};
|
|
666
686
|
}
|
|
667
687
|
|
|
668
688
|
interface AppConfig {
|
|
@@ -738,6 +758,7 @@ declare const appReducer: redux.Reducer<{
|
|
|
738
758
|
app: AppState;
|
|
739
759
|
authorization: AuthorizationState;
|
|
740
760
|
breakout: BreakoutState$1;
|
|
761
|
+
cameraEffects: CameraEffectsState;
|
|
741
762
|
chat: ChatState;
|
|
742
763
|
cloudRecording: CloudRecordingState$1;
|
|
743
764
|
connectionMonitor: ConnectionMonitorState;
|
|
@@ -760,6 +781,7 @@ declare const appReducer: redux.Reducer<{
|
|
|
760
781
|
app: AppState | undefined;
|
|
761
782
|
authorization: AuthorizationState | undefined;
|
|
762
783
|
breakout: BreakoutState$1 | undefined;
|
|
784
|
+
cameraEffects: CameraEffectsState | undefined;
|
|
763
785
|
chat: ChatState | undefined;
|
|
764
786
|
cloudRecording: CloudRecordingState$1 | undefined;
|
|
765
787
|
connectionMonitor: ConnectionMonitorState | undefined;
|
|
@@ -786,6 +808,7 @@ declare const createStore: ({ preloadedState, injectServices, }: {
|
|
|
786
808
|
app: AppState;
|
|
787
809
|
authorization: AuthorizationState;
|
|
788
810
|
breakout: BreakoutState$1;
|
|
811
|
+
cameraEffects: CameraEffectsState;
|
|
789
812
|
chat: ChatState;
|
|
790
813
|
cloudRecording: CloudRecordingState$1;
|
|
791
814
|
connectionMonitor: ConnectionMonitorState;
|
|
@@ -809,6 +832,7 @@ declare const createStore: ({ preloadedState, injectServices, }: {
|
|
|
809
832
|
app: AppState;
|
|
810
833
|
authorization: AuthorizationState;
|
|
811
834
|
breakout: BreakoutState$1;
|
|
835
|
+
cameraEffects: CameraEffectsState;
|
|
812
836
|
chat: ChatState;
|
|
813
837
|
cloudRecording: CloudRecordingState$1;
|
|
814
838
|
connectionMonitor: ConnectionMonitorState;
|
|
@@ -1160,6 +1184,8 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
|
|
|
1160
1184
|
joinBreakoutGroup(group: string): void;
|
|
1161
1185
|
joinBreakoutMainRoom(): void;
|
|
1162
1186
|
reportStreamResolution(streamId: string, width: number, height: number): void;
|
|
1187
|
+
switchCameraEffect(effectId: string): Promise<void>;
|
|
1188
|
+
clearCameraEffect(): Promise<void>;
|
|
1163
1189
|
destroy(): void;
|
|
1164
1190
|
}
|
|
1165
1191
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { RoomJoinedSuccess } from '@whereby.com/media';
|
|
|
5
5
|
import * as redux_thunk from 'redux-thunk';
|
|
6
6
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
7
7
|
import * as redux from 'redux';
|
|
8
|
+
import { Setup, Params } from '@whereby.com/camera-effects';
|
|
8
9
|
|
|
9
10
|
type Json = string | number | boolean | null | Array<Json> | {
|
|
10
11
|
[key: string]: Json;
|
|
@@ -586,6 +587,21 @@ interface CloudRecordingState$1 {
|
|
|
586
587
|
startedAt?: number;
|
|
587
588
|
}
|
|
588
589
|
|
|
590
|
+
type TryUpdateFn = (presetId: string, setup: Setup, params: Params) => Promise<boolean>;
|
|
591
|
+
type StopFn = () => void;
|
|
592
|
+
interface CameraEffectsState {
|
|
593
|
+
currentEffectId?: string | null;
|
|
594
|
+
setup?: Setup;
|
|
595
|
+
params?: Params;
|
|
596
|
+
isSwitching: boolean;
|
|
597
|
+
error?: unknown;
|
|
598
|
+
raw: {
|
|
599
|
+
stop?: StopFn;
|
|
600
|
+
tryUpdate?: TryUpdateFn;
|
|
601
|
+
effectStream?: MediaStream;
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
|
|
589
605
|
interface AuthorizationState {
|
|
590
606
|
roomKey: string | null;
|
|
591
607
|
assistantKey?: string | null;
|
|
@@ -663,6 +679,10 @@ interface LocalMediaState$1 {
|
|
|
663
679
|
stream?: MediaStream;
|
|
664
680
|
isSwitchingStream: boolean;
|
|
665
681
|
onDeviceChange?: () => void;
|
|
682
|
+
beforeEffectTracks?: {
|
|
683
|
+
audio?: MediaStreamTrack;
|
|
684
|
+
video?: MediaStreamTrack;
|
|
685
|
+
};
|
|
666
686
|
}
|
|
667
687
|
|
|
668
688
|
interface AppConfig {
|
|
@@ -738,6 +758,7 @@ declare const appReducer: redux.Reducer<{
|
|
|
738
758
|
app: AppState;
|
|
739
759
|
authorization: AuthorizationState;
|
|
740
760
|
breakout: BreakoutState$1;
|
|
761
|
+
cameraEffects: CameraEffectsState;
|
|
741
762
|
chat: ChatState;
|
|
742
763
|
cloudRecording: CloudRecordingState$1;
|
|
743
764
|
connectionMonitor: ConnectionMonitorState;
|
|
@@ -760,6 +781,7 @@ declare const appReducer: redux.Reducer<{
|
|
|
760
781
|
app: AppState | undefined;
|
|
761
782
|
authorization: AuthorizationState | undefined;
|
|
762
783
|
breakout: BreakoutState$1 | undefined;
|
|
784
|
+
cameraEffects: CameraEffectsState | undefined;
|
|
763
785
|
chat: ChatState | undefined;
|
|
764
786
|
cloudRecording: CloudRecordingState$1 | undefined;
|
|
765
787
|
connectionMonitor: ConnectionMonitorState | undefined;
|
|
@@ -786,6 +808,7 @@ declare const createStore: ({ preloadedState, injectServices, }: {
|
|
|
786
808
|
app: AppState;
|
|
787
809
|
authorization: AuthorizationState;
|
|
788
810
|
breakout: BreakoutState$1;
|
|
811
|
+
cameraEffects: CameraEffectsState;
|
|
789
812
|
chat: ChatState;
|
|
790
813
|
cloudRecording: CloudRecordingState$1;
|
|
791
814
|
connectionMonitor: ConnectionMonitorState;
|
|
@@ -809,6 +832,7 @@ declare const createStore: ({ preloadedState, injectServices, }: {
|
|
|
809
832
|
app: AppState;
|
|
810
833
|
authorization: AuthorizationState;
|
|
811
834
|
breakout: BreakoutState$1;
|
|
835
|
+
cameraEffects: CameraEffectsState;
|
|
812
836
|
chat: ChatState;
|
|
813
837
|
cloudRecording: CloudRecordingState$1;
|
|
814
838
|
connectionMonitor: ConnectionMonitorState;
|
|
@@ -1160,6 +1184,8 @@ declare class RoomConnectionClient extends BaseClient<RoomConnectionState, RoomC
|
|
|
1160
1184
|
joinBreakoutGroup(group: string): void;
|
|
1161
1185
|
joinBreakoutMainRoom(): void;
|
|
1162
1186
|
reportStreamResolution(streamId: string, width: number, height: number): void;
|
|
1187
|
+
switchCameraEffect(effectId: string): Promise<void>;
|
|
1188
|
+
clearCameraEffect(): Promise<void>;
|
|
1163
1189
|
destroy(): void;
|
|
1164
1190
|
}
|
|
1165
1191
|
|