@stream-io/video-client 1.0.6 → 1.0.8
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 +55 -19
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +61 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +55 -19
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +3 -3
- package/dist/src/gen/coordinator/index.d.ts +3204 -1800
- package/dist/src/gen/shims.d.ts +3 -0
- package/dist/src/rtc/videoLayers.d.ts +3 -3
- package/index.ts +1 -0
- package/package.json +1 -1
- package/src/Call.ts +19 -15
- package/src/coordinator/connection/connection.ts +2 -5
- package/src/gen/coordinator/index.ts +3199 -1808
- package/src/gen/shims.ts +4 -0
- package/src/rtc/Publisher.ts +5 -2
- package/src/rtc/videoLayers.ts +4 -4
- package/src/store/CallState.ts +8 -0
package/src/gen/shims.ts
ADDED
package/src/rtc/Publisher.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { getLogger } from '../logger';
|
|
|
24
24
|
import { Dispatcher } from './Dispatcher';
|
|
25
25
|
import { getOSInfo } from '../client-details';
|
|
26
26
|
import { VideoLayerSetting } from '../gen/video/sfu/event/events';
|
|
27
|
+
import { TargetResolutionResponse } from '../gen/shims';
|
|
27
28
|
|
|
28
29
|
const logger: Logger = getLogger(['Publisher']);
|
|
29
30
|
|
|
@@ -238,7 +239,8 @@ export class Publisher {
|
|
|
238
239
|
|
|
239
240
|
if (!transceiver) {
|
|
240
241
|
const { settings } = this.state;
|
|
241
|
-
const targetResolution = settings?.video
|
|
242
|
+
const targetResolution = settings?.video
|
|
243
|
+
.target_resolution as TargetResolutionResponse;
|
|
242
244
|
const screenShareBitrate =
|
|
243
245
|
settings?.screensharing.target_resolution?.bitrate;
|
|
244
246
|
|
|
@@ -725,7 +727,8 @@ export class Publisher {
|
|
|
725
727
|
sdp = sdp || this.pc.localDescription?.sdp;
|
|
726
728
|
|
|
727
729
|
const { settings } = this.state;
|
|
728
|
-
const targetResolution = settings?.video
|
|
730
|
+
const targetResolution = settings?.video
|
|
731
|
+
.target_resolution as TargetResolutionResponse;
|
|
729
732
|
return this.pc
|
|
730
733
|
.getTransceivers()
|
|
731
734
|
.filter((t) => t.direction === 'sendonly' && t.sender.track)
|
package/src/rtc/videoLayers.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getOSInfo } from '../client-details';
|
|
2
2
|
import { ScreenShareSettings } from '../types';
|
|
3
|
-
import {
|
|
3
|
+
import { TargetResolutionResponse } from '../gen/shims';
|
|
4
4
|
import { isReactNative } from '../helpers/platforms';
|
|
5
5
|
|
|
6
6
|
export type OptimalVideoLayer = RTCRtpEncodingParameters & {
|
|
@@ -9,7 +9,7 @@ export type OptimalVideoLayer = RTCRtpEncodingParameters & {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
const DEFAULT_BITRATE = 1250000;
|
|
12
|
-
const defaultTargetResolution:
|
|
12
|
+
const defaultTargetResolution: TargetResolutionResponse = {
|
|
13
13
|
bitrate: DEFAULT_BITRATE,
|
|
14
14
|
width: 1280,
|
|
15
15
|
height: 720,
|
|
@@ -30,7 +30,7 @@ const defaultBitratePerRid: Record<string, number> = {
|
|
|
30
30
|
*/
|
|
31
31
|
export const findOptimalVideoLayers = (
|
|
32
32
|
videoTrack: MediaStreamTrack,
|
|
33
|
-
targetResolution:
|
|
33
|
+
targetResolution: TargetResolutionResponse = defaultTargetResolution,
|
|
34
34
|
) => {
|
|
35
35
|
const optimalVideoLayers: OptimalVideoLayer[] = [];
|
|
36
36
|
const settings = videoTrack.getSettings();
|
|
@@ -79,7 +79,7 @@ export const findOptimalVideoLayers = (
|
|
|
79
79
|
* @param currentHeight the current height of the track.
|
|
80
80
|
*/
|
|
81
81
|
export const getComputedMaxBitrate = (
|
|
82
|
-
targetResolution:
|
|
82
|
+
targetResolution: TargetResolutionResponse,
|
|
83
83
|
currentWidth: number,
|
|
84
84
|
currentHeight: number,
|
|
85
85
|
): number => {
|
package/src/store/CallState.ts
CHANGED
|
@@ -434,6 +434,14 @@ export class CallState {
|
|
|
434
434
|
'connection.error': undefined,
|
|
435
435
|
'connection.ok': undefined,
|
|
436
436
|
'health.check': undefined,
|
|
437
|
+
'user.banned': undefined,
|
|
438
|
+
'user.deactivated': undefined,
|
|
439
|
+
'user.deleted': undefined,
|
|
440
|
+
'user.muted': undefined,
|
|
441
|
+
'user.presence.changed': undefined,
|
|
442
|
+
'user.reactivated': undefined,
|
|
443
|
+
'user.unbanned': undefined,
|
|
444
|
+
'user.updated': undefined,
|
|
437
445
|
custom: undefined,
|
|
438
446
|
|
|
439
447
|
// events that update call state:
|