@stream-io/video-client 1.4.7 → 1.5.0-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 +238 -0
- package/dist/index.browser.es.js +1977 -1477
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +1975 -1474
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1977 -1477
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +93 -9
- package/dist/src/StreamSfuClient.d.ts +72 -56
- package/dist/src/StreamVideoClient.d.ts +2 -2
- package/dist/src/coordinator/connection/client.d.ts +3 -4
- package/dist/src/coordinator/connection/types.d.ts +5 -1
- package/dist/src/devices/InputMediaDeviceManager.d.ts +4 -0
- package/dist/src/devices/MicrophoneManager.d.ts +1 -1
- package/dist/src/events/callEventHandlers.d.ts +1 -3
- package/dist/src/events/internal.d.ts +4 -0
- package/dist/src/gen/video/sfu/event/events.d.ts +106 -4
- package/dist/src/gen/video/sfu/models/models.d.ts +64 -65
- package/dist/src/helpers/ensureExhausted.d.ts +1 -0
- package/dist/src/helpers/withResolvers.d.ts +14 -0
- package/dist/src/logger.d.ts +1 -0
- package/dist/src/rpc/createClient.d.ts +2 -0
- package/dist/src/rpc/index.d.ts +1 -0
- package/dist/src/rpc/retryable.d.ts +23 -0
- package/dist/src/rtc/Dispatcher.d.ts +1 -1
- package/dist/src/rtc/IceTrickleBuffer.d.ts +0 -1
- package/dist/src/rtc/Publisher.d.ts +24 -25
- package/dist/src/rtc/Subscriber.d.ts +12 -11
- package/dist/src/rtc/helpers/rtcConfiguration.d.ts +2 -0
- package/dist/src/rtc/helpers/tracks.d.ts +3 -3
- package/dist/src/rtc/signal.d.ts +1 -1
- package/dist/src/store/CallState.d.ts +46 -2
- package/package.json +5 -5
- package/src/Call.ts +618 -563
- package/src/StreamSfuClient.ts +277 -246
- package/src/StreamVideoClient.ts +15 -16
- package/src/__tests__/Call.test.ts +145 -2
- package/src/__tests__/StreamVideoClient.api.test.ts +168 -0
- package/src/coordinator/connection/client.ts +25 -8
- package/src/coordinator/connection/connection.ts +2 -1
- package/src/coordinator/connection/types.ts +6 -0
- package/src/devices/BrowserPermission.ts +1 -1
- package/src/devices/CameraManager.ts +1 -1
- package/src/devices/InputMediaDeviceManager.ts +12 -3
- package/src/devices/MicrophoneManager.ts +3 -3
- package/src/devices/devices.ts +1 -1
- package/src/events/__tests__/mutes.test.ts +10 -13
- package/src/events/__tests__/participant.test.ts +75 -0
- package/src/events/callEventHandlers.ts +4 -7
- package/src/events/internal.ts +20 -3
- package/src/events/mutes.ts +5 -3
- package/src/events/participant.ts +48 -15
- package/src/gen/video/sfu/event/events.ts +451 -8
- package/src/gen/video/sfu/models/models.ts +211 -204
- package/src/helpers/ensureExhausted.ts +5 -0
- package/src/helpers/withResolvers.ts +43 -0
- package/src/logger.ts +3 -1
- package/src/rpc/__tests__/retryable.test.ts +72 -0
- package/src/rpc/createClient.ts +21 -0
- package/src/rpc/index.ts +1 -0
- package/src/rpc/retryable.ts +57 -0
- package/src/rtc/Dispatcher.ts +6 -2
- package/src/rtc/IceTrickleBuffer.ts +2 -2
- package/src/rtc/Publisher.ts +127 -163
- package/src/rtc/Subscriber.ts +94 -155
- package/src/rtc/__tests__/Publisher.test.ts +18 -95
- package/src/rtc/__tests__/Subscriber.test.ts +63 -99
- package/src/rtc/__tests__/videoLayers.test.ts +2 -2
- package/src/rtc/helpers/rtcConfiguration.ts +11 -0
- package/src/rtc/helpers/tracks.ts +27 -7
- package/src/rtc/signal.ts +3 -3
- package/src/rtc/videoLayers.ts +1 -10
- package/src/stats/SfuStatsReporter.ts +1 -0
- package/src/store/CallState.ts +111 -3
- package/src/store/__tests__/CallState.test.ts +58 -37
- package/dist/src/rtc/flows/join.d.ts +0 -20
- package/src/rtc/flows/join.ts +0 -65
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { JoinCallData } from '../../types';
|
|
2
|
-
import { StreamClient } from '../../coordinator/connection/client';
|
|
3
|
-
/**
|
|
4
|
-
* Collects all necessary information to join a call, talks to the coordinator
|
|
5
|
-
* and returns the necessary information to join the call.
|
|
6
|
-
*
|
|
7
|
-
* @param httpClient the http client to use.
|
|
8
|
-
* @param type the type of the call.
|
|
9
|
-
* @param id the id of the call.
|
|
10
|
-
* @param data the data for the call.
|
|
11
|
-
*/
|
|
12
|
-
export declare const join: (httpClient: StreamClient, type: string, id: string, data?: JoinCallData) => Promise<{
|
|
13
|
-
connectionConfig: RTCConfiguration | undefined;
|
|
14
|
-
sfuServer: import("../../gen/coordinator").SFUResponse;
|
|
15
|
-
token: string;
|
|
16
|
-
metadata: import("../../gen/coordinator").CallResponse;
|
|
17
|
-
members: import("../../gen/coordinator").MemberResponse[];
|
|
18
|
-
ownCapabilities: import("../../gen/coordinator").OwnCapability[];
|
|
19
|
-
statsOptions: import("../../gen/coordinator").StatsOptions;
|
|
20
|
-
}>;
|
package/src/rtc/flows/join.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ICEServer,
|
|
3
|
-
JoinCallRequest,
|
|
4
|
-
JoinCallResponse,
|
|
5
|
-
} from '../../gen/coordinator';
|
|
6
|
-
import { JoinCallData } from '../../types';
|
|
7
|
-
import { StreamClient } from '../../coordinator/connection/client';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Collects all necessary information to join a call, talks to the coordinator
|
|
11
|
-
* and returns the necessary information to join the call.
|
|
12
|
-
*
|
|
13
|
-
* @param httpClient the http client to use.
|
|
14
|
-
* @param type the type of the call.
|
|
15
|
-
* @param id the id of the call.
|
|
16
|
-
* @param data the data for the call.
|
|
17
|
-
*/
|
|
18
|
-
export const join = async (
|
|
19
|
-
httpClient: StreamClient,
|
|
20
|
-
type: string,
|
|
21
|
-
id: string,
|
|
22
|
-
data?: JoinCallData,
|
|
23
|
-
) => {
|
|
24
|
-
const { call, credentials, members, own_capabilities, stats_options } =
|
|
25
|
-
await doJoin(httpClient, type, id, data);
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
connectionConfig: toRtcConfiguration(credentials.ice_servers),
|
|
29
|
-
sfuServer: credentials.server,
|
|
30
|
-
token: credentials.token,
|
|
31
|
-
metadata: call,
|
|
32
|
-
members,
|
|
33
|
-
ownCapabilities: own_capabilities,
|
|
34
|
-
statsOptions: stats_options,
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const doJoin = async (
|
|
39
|
-
httpClient: StreamClient,
|
|
40
|
-
type: string,
|
|
41
|
-
id: string,
|
|
42
|
-
data?: JoinCallData,
|
|
43
|
-
) => {
|
|
44
|
-
const location = await httpClient.getLocationHint();
|
|
45
|
-
const request: JoinCallRequest = {
|
|
46
|
-
...data,
|
|
47
|
-
location,
|
|
48
|
-
};
|
|
49
|
-
return httpClient.post<JoinCallResponse, JoinCallRequest>(
|
|
50
|
-
`/call/${type}/${id}/join`,
|
|
51
|
-
request,
|
|
52
|
-
);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const toRtcConfiguration = (config?: ICEServer[]) => {
|
|
56
|
-
if (!config || config.length === 0) return undefined;
|
|
57
|
-
const rtcConfig: RTCConfiguration = {
|
|
58
|
-
iceServers: config.map((ice) => ({
|
|
59
|
-
urls: ice.urls,
|
|
60
|
-
username: ice.username,
|
|
61
|
-
credential: ice.password,
|
|
62
|
-
})),
|
|
63
|
-
};
|
|
64
|
-
return rtcConfig;
|
|
65
|
-
};
|