@stream-io/video-client 1.1.0 → 1.2.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 +7 -0
- package/dist/index.browser.es.js +5 -3
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +5 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +5 -3
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +4 -2
- package/dist/src/coordinator/connection/types.d.ts +2 -0
- package/package.json +1 -1
- package/src/Call.ts +5 -1
- package/src/coordinator/connection/types.ts +3 -0
- package/src/events/callEventHandlers.ts +1 -1
package/dist/src/Call.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { VideoLayerSetting } from './gen/video/sfu/event/events';
|
|
|
7
7
|
import { DynascaleManager } from './helpers/DynascaleManager';
|
|
8
8
|
import { PermissionsContext } from './permissions';
|
|
9
9
|
import { StreamClient } from './coordinator/connection/client';
|
|
10
|
-
import { CallEventListener, Logger } from './coordinator/connection/types';
|
|
10
|
+
import { CallEventListener, Logger, RejectReason } from './coordinator/connection/types';
|
|
11
11
|
import { CameraManager, MicrophoneManager, ScreenShareManager, SpeakerManager } from './devices';
|
|
12
12
|
/**
|
|
13
13
|
* An object representation of a `Call`.
|
|
@@ -177,8 +177,10 @@ export declare class Call {
|
|
|
177
177
|
* This method should be used only for "ringing" call flows.
|
|
178
178
|
* {@link Call.leave} invokes this method automatically for you when you leave or reject this call.
|
|
179
179
|
* Unless you are implementing a custom "ringing" flow, you should not use this method.
|
|
180
|
+
*
|
|
181
|
+
* @param reason the reason for rejecting the call.
|
|
180
182
|
*/
|
|
181
|
-
reject: () => Promise<RejectCallResponse>;
|
|
183
|
+
reject: (reason?: RejectReason) => Promise<RejectCallResponse>;
|
|
182
184
|
/**
|
|
183
185
|
* Will start to watch for call related WebSocket events and initiate a call session with the server.
|
|
184
186
|
*
|
|
@@ -113,3 +113,5 @@ export type StreamClientOptions = Partial<AxiosRequestConfig> & {
|
|
|
113
113
|
};
|
|
114
114
|
export type TokenProvider = () => Promise<string>;
|
|
115
115
|
export type TokenOrProvider = null | string | TokenProvider | undefined;
|
|
116
|
+
export type BuiltInRejectReason = 'busy' | 'decline' | 'cancel';
|
|
117
|
+
export type RejectReason = BuiltInRejectReason | string;
|
package/package.json
CHANGED
package/src/Call.ts
CHANGED
|
@@ -119,6 +119,7 @@ import {
|
|
|
119
119
|
AllCallEvents,
|
|
120
120
|
CallEventListener,
|
|
121
121
|
Logger,
|
|
122
|
+
RejectReason,
|
|
122
123
|
StreamCallEvent,
|
|
123
124
|
} from './coordinator/connection/types';
|
|
124
125
|
import { getClientDetails } from './client-details';
|
|
@@ -680,10 +681,13 @@ export class Call {
|
|
|
680
681
|
* This method should be used only for "ringing" call flows.
|
|
681
682
|
* {@link Call.leave} invokes this method automatically for you when you leave or reject this call.
|
|
682
683
|
* Unless you are implementing a custom "ringing" flow, you should not use this method.
|
|
684
|
+
*
|
|
685
|
+
* @param reason the reason for rejecting the call.
|
|
683
686
|
*/
|
|
684
|
-
reject = async () => {
|
|
687
|
+
reject = async (reason?: RejectReason): Promise<RejectCallResponse> => {
|
|
685
688
|
return this.streamClient.post<RejectCallResponse>(
|
|
686
689
|
`${this.streamClientBasePath}/reject`,
|
|
690
|
+
{ reason: reason },
|
|
687
691
|
);
|
|
688
692
|
};
|
|
689
693
|
|
|
@@ -142,3 +142,6 @@ export type StreamClientOptions = Partial<AxiosRequestConfig> & {
|
|
|
142
142
|
|
|
143
143
|
export type TokenProvider = () => Promise<string>;
|
|
144
144
|
export type TokenOrProvider = null | string | TokenProvider | undefined;
|
|
145
|
+
|
|
146
|
+
export type BuiltInRejectReason = 'busy' | 'decline' | 'cancel';
|
|
147
|
+
export type RejectReason = BuiltInRejectReason | string;
|