@stream-io/video-client 0.3.34 → 0.3.36
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 +65 -15
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +65 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +65 -15
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +3 -2
- package/dist/src/gen/coordinator/index.d.ts +33 -0
- package/dist/src/gen/video/sfu/event/events.d.ts +8 -0
- package/dist/src/gen/video/sfu/models/models.d.ts +10 -2
- package/dist/src/rtc/Publisher.d.ts +2 -1
- package/dist/src/store/CallState.d.ts +1 -0
- package/package.json +1 -1
- package/src/Call.ts +8 -4
- package/src/events/internal.ts +1 -3
- package/src/gen/coordinator/index.ts +32 -0
- package/src/gen/video/sfu/event/events.ts +21 -0
- package/src/gen/video/sfu/models/models.ts +8 -0
- package/src/rtc/Publisher.ts +59 -9
- package/src/store/CallState.ts +10 -2
- package/src/store/__tests__/CallState.test.ts +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [0.3.36](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.3.35...@stream-io/video-client-0.3.36) (2023-10-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **dynascale:** pick scaleResolutionDownBy parameter from the changePublishQuality message ([#1113](https://github.com/GetStream/stream-video-js/issues/1113)) ([81b91d4](https://github.com/GetStream/stream-video-js/commit/81b91d48ca90a74f6af4b879c553ff2575dcb5bb))
|
|
11
|
+
|
|
12
|
+
### [0.3.35](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.3.34...@stream-io/video-client-0.3.35) (2023-10-19)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* mute screenshare_audio, update to the newest OpenAPI schema ([#1148](https://github.com/GetStream/stream-video-js/issues/1148)) ([81c45a7](https://github.com/GetStream/stream-video-js/commit/81c45a77e6a526de05ce5457357d212fb3e613d9))
|
|
18
|
+
|
|
5
19
|
### [0.3.34](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.3.33...@stream-io/video-client-0.3.34) (2023-10-18)
|
|
6
20
|
|
|
7
21
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -864,6 +864,10 @@ var ErrorCode;
|
|
|
864
864
|
* @generated from protobuf enum value: ERROR_CODE_SFU_SHUTTING_DOWN = 600;
|
|
865
865
|
*/
|
|
866
866
|
ErrorCode[ErrorCode["SFU_SHUTTING_DOWN"] = 600] = "SFU_SHUTTING_DOWN";
|
|
867
|
+
/**
|
|
868
|
+
* @generated from protobuf enum value: ERROR_CODE_SFU_FULL = 700;
|
|
869
|
+
*/
|
|
870
|
+
ErrorCode[ErrorCode["SFU_FULL"] = 700] = "SFU_FULL";
|
|
867
871
|
})(ErrorCode || (ErrorCode = {}));
|
|
868
872
|
/**
|
|
869
873
|
* @generated from protobuf enum stream.video.sfu.models.SdkType
|
|
@@ -898,6 +902,10 @@ var SdkType;
|
|
|
898
902
|
* @generated from protobuf enum value: SDK_TYPE_REACT_NATIVE = 6;
|
|
899
903
|
*/
|
|
900
904
|
SdkType[SdkType["REACT_NATIVE"] = 6] = "REACT_NATIVE";
|
|
905
|
+
/**
|
|
906
|
+
* @generated from protobuf enum value: SDK_TYPE_UNITY = 7;
|
|
907
|
+
*/
|
|
908
|
+
SdkType[SdkType["UNITY"] = 7] = "UNITY";
|
|
901
909
|
})(SdkType || (SdkType = {}));
|
|
902
910
|
/**
|
|
903
911
|
* @generated from protobuf enum stream.video.sfu.models.TrackUnpublishReason
|
|
@@ -5325,6 +5333,12 @@ class VideoLayerSetting$Type extends MessageType {
|
|
|
5325
5333
|
],
|
|
5326
5334
|
},
|
|
5327
5335
|
{ no: 6, name: 'codec', kind: 'message', T: () => Codec },
|
|
5336
|
+
{
|
|
5337
|
+
no: 7,
|
|
5338
|
+
name: 'max_framerate',
|
|
5339
|
+
kind: 'scalar',
|
|
5340
|
+
T: 13 /*ScalarType.UINT32*/,
|
|
5341
|
+
},
|
|
5328
5342
|
]);
|
|
5329
5343
|
}
|
|
5330
5344
|
create(value) {
|
|
@@ -5334,6 +5348,7 @@ class VideoLayerSetting$Type extends MessageType {
|
|
|
5334
5348
|
maxBitrate: 0,
|
|
5335
5349
|
scaleResolutionDownBy: 0,
|
|
5336
5350
|
priority: 0,
|
|
5351
|
+
maxFramerate: 0,
|
|
5337
5352
|
};
|
|
5338
5353
|
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
5339
5354
|
enumerable: false,
|
|
@@ -5366,6 +5381,9 @@ class VideoLayerSetting$Type extends MessageType {
|
|
|
5366
5381
|
case /* stream.video.sfu.models.Codec codec */ 6:
|
|
5367
5382
|
message.codec = Codec.internalBinaryRead(reader, reader.uint32(), options, message.codec);
|
|
5368
5383
|
break;
|
|
5384
|
+
case /* uint32 max_framerate */ 7:
|
|
5385
|
+
message.maxFramerate = reader.uint32();
|
|
5386
|
+
break;
|
|
5369
5387
|
default:
|
|
5370
5388
|
let u = options.readUnknownField;
|
|
5371
5389
|
if (u === 'throw')
|
|
@@ -5396,6 +5414,9 @@ class VideoLayerSetting$Type extends MessageType {
|
|
|
5396
5414
|
/* stream.video.sfu.models.Codec codec = 6; */
|
|
5397
5415
|
if (message.codec)
|
|
5398
5416
|
Codec.internalBinaryWrite(message.codec, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
|
|
5417
|
+
/* uint32 max_framerate = 7; */
|
|
5418
|
+
if (message.maxFramerate !== 0)
|
|
5419
|
+
writer.tag(7, WireType.Varint).uint32(message.maxFramerate);
|
|
5399
5420
|
let u = options.writeUnknownFields;
|
|
5400
5421
|
if (u !== false)
|
|
5401
5422
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -6632,8 +6653,8 @@ class Publisher {
|
|
|
6632
6653
|
}
|
|
6633
6654
|
});
|
|
6634
6655
|
};
|
|
6635
|
-
this.updateVideoPublishQuality = async (
|
|
6636
|
-
logger$3('info', 'Update publish quality, requested
|
|
6656
|
+
this.updateVideoPublishQuality = async (enabledLayers) => {
|
|
6657
|
+
logger$3('info', 'Update publish quality, requested layers by SFU:', enabledLayers);
|
|
6637
6658
|
const videoSender = this.transceiverRegistry[TrackType.VIDEO]?.sender;
|
|
6638
6659
|
if (!videoSender) {
|
|
6639
6660
|
logger$3('warn', 'Update publish quality, no video sender found.');
|
|
@@ -6645,6 +6666,9 @@ class Publisher {
|
|
|
6645
6666
|
return;
|
|
6646
6667
|
}
|
|
6647
6668
|
let changed = false;
|
|
6669
|
+
let enabledRids = enabledLayers
|
|
6670
|
+
.filter((ly) => ly.active)
|
|
6671
|
+
.map((ly) => ly.name);
|
|
6648
6672
|
params.encodings.forEach((enc) => {
|
|
6649
6673
|
// flip 'active' flag only when necessary
|
|
6650
6674
|
const shouldEnable = enabledRids.includes(enc.rid);
|
|
@@ -6652,17 +6676,36 @@ class Publisher {
|
|
|
6652
6676
|
enc.active = shouldEnable;
|
|
6653
6677
|
changed = true;
|
|
6654
6678
|
}
|
|
6679
|
+
if (shouldEnable) {
|
|
6680
|
+
let layer = enabledLayers.find((vls) => vls.name === enc.rid);
|
|
6681
|
+
if (layer !== undefined) {
|
|
6682
|
+
if (layer.scaleResolutionDownBy >= 1 &&
|
|
6683
|
+
layer.scaleResolutionDownBy !== enc.scaleResolutionDownBy) {
|
|
6684
|
+
logger$3('debug', '[dynascale]: setting scaleResolutionDownBy from server', 'layer', layer.name, 'scale-resolution-down-by', layer.scaleResolutionDownBy);
|
|
6685
|
+
enc.scaleResolutionDownBy = layer.scaleResolutionDownBy;
|
|
6686
|
+
changed = true;
|
|
6687
|
+
}
|
|
6688
|
+
if (layer.maxBitrate > 0 && layer.maxBitrate !== enc.maxBitrate) {
|
|
6689
|
+
logger$3('debug', '[dynascale] setting max-bitrate from the server', 'layer', layer.name, 'max-bitrate', layer.maxBitrate);
|
|
6690
|
+
enc.maxBitrate = layer.maxBitrate;
|
|
6691
|
+
changed = true;
|
|
6692
|
+
}
|
|
6693
|
+
if (layer.maxFramerate > 0 &&
|
|
6694
|
+
layer.maxFramerate !== enc.maxFramerate) {
|
|
6695
|
+
logger$3('debug', '[dynascale]: setting maxFramerate from server', 'layer', layer.name, 'max-framerate', layer.maxFramerate);
|
|
6696
|
+
enc.maxFramerate = layer.maxFramerate;
|
|
6697
|
+
changed = true;
|
|
6698
|
+
}
|
|
6699
|
+
}
|
|
6700
|
+
}
|
|
6655
6701
|
});
|
|
6656
|
-
const
|
|
6657
|
-
.filter((e) => e.active)
|
|
6658
|
-
.map((e) => e.rid)
|
|
6659
|
-
.join(', ');
|
|
6702
|
+
const activeLayers = params.encodings.filter((e) => e.active);
|
|
6660
6703
|
if (changed) {
|
|
6661
6704
|
await videoSender.setParameters(params);
|
|
6662
|
-
logger$3('info', `Update publish quality, enabled rids:
|
|
6705
|
+
logger$3('info', `Update publish quality, enabled rids: `, activeLayers);
|
|
6663
6706
|
}
|
|
6664
6707
|
else {
|
|
6665
|
-
logger$3('info', `Update publish quality, no change:
|
|
6708
|
+
logger$3('info', `Update publish quality, no change: `, activeLayers);
|
|
6666
6709
|
}
|
|
6667
6710
|
};
|
|
6668
6711
|
/**
|
|
@@ -8334,6 +8377,12 @@ class CallState {
|
|
|
8334
8377
|
broadcasting: false,
|
|
8335
8378
|
}));
|
|
8336
8379
|
};
|
|
8380
|
+
this.updateFromHLSBroadcastingFailed = () => {
|
|
8381
|
+
this.setCurrentValue(this.egressSubject, (egress) => ({
|
|
8382
|
+
...egress,
|
|
8383
|
+
broadcasting: false,
|
|
8384
|
+
}));
|
|
8385
|
+
};
|
|
8337
8386
|
this.updateFromHLSBroadcastStarted = (event) => {
|
|
8338
8387
|
this.setCurrentValue(this.egressSubject, (egress) => ({
|
|
8339
8388
|
...egress,
|
|
@@ -8460,12 +8509,12 @@ class CallState {
|
|
|
8460
8509
|
this.eventHandlers = {
|
|
8461
8510
|
// these events are not updating the call state:
|
|
8462
8511
|
'call.permission_request': undefined,
|
|
8512
|
+
'call.recording_failed': undefined,
|
|
8513
|
+
'call.recording_ready': undefined,
|
|
8463
8514
|
'call.user_muted': undefined,
|
|
8464
8515
|
'connection.error': undefined,
|
|
8465
8516
|
'connection.ok': undefined,
|
|
8466
8517
|
'health.check': undefined,
|
|
8467
|
-
'call.recording_failed': undefined,
|
|
8468
|
-
'call.recording_ready': undefined,
|
|
8469
8518
|
custom: undefined,
|
|
8470
8519
|
// events that update call state:
|
|
8471
8520
|
'call.accepted': (e) => this.updateFromCallResponse(e.call),
|
|
@@ -8475,6 +8524,7 @@ class CallState {
|
|
|
8475
8524
|
this.updateFromCallResponse(e.call);
|
|
8476
8525
|
this.setCurrentValue(this.endedBySubject, e.user);
|
|
8477
8526
|
},
|
|
8527
|
+
'call.hls_broadcasting_failed': this.updateFromHLSBroadcastingFailed,
|
|
8478
8528
|
'call.hls_broadcasting_started': this.updateFromHLSBroadcastStarted,
|
|
8479
8529
|
'call.hls_broadcasting_stopped': this.updateFromHLSBroadcastStopped,
|
|
8480
8530
|
'call.live_started': (e) => this.updateFromCallResponse(e.call),
|
|
@@ -8791,7 +8841,7 @@ const watchChangePublishQuality = (dispatcher, call) => {
|
|
|
8791
8841
|
const { videoSenders } = e.eventPayload.changePublishQuality;
|
|
8792
8842
|
videoSenders.forEach((videoSender) => {
|
|
8793
8843
|
const { layers } = videoSender;
|
|
8794
|
-
call.updatePublishQuality(layers.filter((l) => l.active)
|
|
8844
|
+
call.updatePublishQuality(layers.filter((l) => l.active));
|
|
8795
8845
|
});
|
|
8796
8846
|
});
|
|
8797
8847
|
};
|
|
@@ -11081,7 +11131,7 @@ class Call {
|
|
|
11081
11131
|
*
|
|
11082
11132
|
* @param params.ring if set to true, a `call.ring` event will be sent to the call members.
|
|
11083
11133
|
* @param params.notify if set to true, a `call.notification` event will be sent to the call members.
|
|
11084
|
-
* @param params.members_limit the members
|
|
11134
|
+
* @param params.members_limit the total number of members to return as part of the response.
|
|
11085
11135
|
*/
|
|
11086
11136
|
this.get = async (params) => {
|
|
11087
11137
|
const response = await this.streamClient.get(this.streamClientBasePath, params);
|
|
@@ -11753,8 +11803,8 @@ class Call {
|
|
|
11753
11803
|
* @param enabledRids
|
|
11754
11804
|
* @returns
|
|
11755
11805
|
*/
|
|
11756
|
-
this.updatePublishQuality = async (
|
|
11757
|
-
return this.publisher?.updateVideoPublishQuality(
|
|
11806
|
+
this.updatePublishQuality = async (enabledLayers) => {
|
|
11807
|
+
return this.publisher?.updateVideoPublishQuality(enabledLayers);
|
|
11758
11808
|
};
|
|
11759
11809
|
this.assertCallJoined = () => {
|
|
11760
11810
|
return new Promise((resolve) => {
|
|
@@ -13965,7 +14015,7 @@ class StreamClient {
|
|
|
13965
14015
|
});
|
|
13966
14016
|
};
|
|
13967
14017
|
this.getUserAgent = () => {
|
|
13968
|
-
const version = "0.3.
|
|
14018
|
+
const version = "0.3.36" ;
|
|
13969
14019
|
return (this.userAgent ||
|
|
13970
14020
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
13971
14021
|
};
|