@stream-io/video-client 1.29.0 → 1.30.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 +8 -0
- package/dist/index.browser.es.js +71 -4
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +71 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +71 -4
- package/dist/index.es.js.map +1 -1
- package/dist/src/gen/video/sfu/event/events.d.ts +5 -1
- package/dist/src/gen/video/sfu/models/models.d.ts +35 -0
- package/dist/src/sorting/participants.d.ts +8 -0
- package/package.json +1 -1
- package/src/Call.ts +2 -0
- package/src/__tests__/StreamVideoClient.api.test.ts +1 -1
- package/src/gen/video/sfu/event/events.ts +15 -0
- package/src/gen/video/sfu/models/models.ts +45 -0
- package/src/sorting/participants.ts +15 -0
- package/src/sorting/presets.ts +3 -4
package/dist/index.cjs.js
CHANGED
|
@@ -927,6 +927,38 @@ var TrackType;
|
|
|
927
927
|
*/
|
|
928
928
|
TrackType[TrackType["SCREEN_SHARE_AUDIO"] = 4] = "SCREEN_SHARE_AUDIO";
|
|
929
929
|
})(TrackType || (TrackType = {}));
|
|
930
|
+
/**
|
|
931
|
+
* must be aligned with kit
|
|
932
|
+
*
|
|
933
|
+
* @generated from protobuf enum stream.video.sfu.models.ParticipantSource
|
|
934
|
+
*/
|
|
935
|
+
var ParticipantSource;
|
|
936
|
+
(function (ParticipantSource) {
|
|
937
|
+
/**
|
|
938
|
+
* @generated from protobuf enum value: PARTICIPANT_SOURCE_WEBRTC_UNSPECIFIED = 0;
|
|
939
|
+
*/
|
|
940
|
+
ParticipantSource[ParticipantSource["WEBRTC_UNSPECIFIED"] = 0] = "WEBRTC_UNSPECIFIED";
|
|
941
|
+
/**
|
|
942
|
+
* @generated from protobuf enum value: PARTICIPANT_SOURCE_RTMP = 1;
|
|
943
|
+
*/
|
|
944
|
+
ParticipantSource[ParticipantSource["RTMP"] = 1] = "RTMP";
|
|
945
|
+
/**
|
|
946
|
+
* @generated from protobuf enum value: PARTICIPANT_SOURCE_WHIP = 2;
|
|
947
|
+
*/
|
|
948
|
+
ParticipantSource[ParticipantSource["WHIP"] = 2] = "WHIP";
|
|
949
|
+
/**
|
|
950
|
+
* @generated from protobuf enum value: PARTICIPANT_SOURCE_SIP = 3;
|
|
951
|
+
*/
|
|
952
|
+
ParticipantSource[ParticipantSource["SIP"] = 3] = "SIP";
|
|
953
|
+
/**
|
|
954
|
+
* @generated from protobuf enum value: PARTICIPANT_SOURCE_RTSP = 4;
|
|
955
|
+
*/
|
|
956
|
+
ParticipantSource[ParticipantSource["RTSP"] = 4] = "RTSP";
|
|
957
|
+
/**
|
|
958
|
+
* @generated from protobuf enum value: PARTICIPANT_SOURCE_SRT = 5;
|
|
959
|
+
*/
|
|
960
|
+
ParticipantSource[ParticipantSource["SRT"] = 5] = "SRT";
|
|
961
|
+
})(ParticipantSource || (ParticipantSource = {}));
|
|
930
962
|
/**
|
|
931
963
|
* @generated from protobuf enum stream.video.sfu.models.ErrorCode
|
|
932
964
|
*/
|
|
@@ -1388,6 +1420,16 @@ class Participant$Type extends runtime.MessageType {
|
|
|
1388
1420
|
repeat: 2 /*RepeatType.UNPACKED*/,
|
|
1389
1421
|
T: 9 /*ScalarType.STRING*/,
|
|
1390
1422
|
},
|
|
1423
|
+
{
|
|
1424
|
+
no: 14,
|
|
1425
|
+
name: 'source',
|
|
1426
|
+
kind: 'enum',
|
|
1427
|
+
T: () => [
|
|
1428
|
+
'stream.video.sfu.models.ParticipantSource',
|
|
1429
|
+
ParticipantSource,
|
|
1430
|
+
'PARTICIPANT_SOURCE_',
|
|
1431
|
+
],
|
|
1432
|
+
},
|
|
1391
1433
|
]);
|
|
1392
1434
|
}
|
|
1393
1435
|
}
|
|
@@ -1961,6 +2003,7 @@ var models = /*#__PURE__*/Object.freeze({
|
|
|
1961
2003
|
OS: OS,
|
|
1962
2004
|
Participant: Participant,
|
|
1963
2005
|
ParticipantCount: ParticipantCount,
|
|
2006
|
+
get ParticipantSource () { return ParticipantSource; },
|
|
1964
2007
|
get PeerType () { return PeerType; },
|
|
1965
2008
|
PerformanceStats: PerformanceStats,
|
|
1966
2009
|
Pin: Pin,
|
|
@@ -2963,6 +3006,16 @@ class JoinRequest$Type extends runtime.MessageType {
|
|
|
2963
3006
|
'CLIENT_CAPABILITY_',
|
|
2964
3007
|
],
|
|
2965
3008
|
},
|
|
3009
|
+
{
|
|
3010
|
+
no: 12,
|
|
3011
|
+
name: 'source',
|
|
3012
|
+
kind: 'enum',
|
|
3013
|
+
T: () => [
|
|
3014
|
+
'stream.video.sfu.models.ParticipantSource',
|
|
3015
|
+
ParticipantSource,
|
|
3016
|
+
'PARTICIPANT_SOURCE_',
|
|
3017
|
+
],
|
|
3018
|
+
},
|
|
2966
3019
|
]);
|
|
2967
3020
|
}
|
|
2968
3021
|
}
|
|
@@ -4527,6 +4580,19 @@ const pinned = (a, b) => {
|
|
|
4527
4580
|
return 1;
|
|
4528
4581
|
return 0;
|
|
4529
4582
|
};
|
|
4583
|
+
/**
|
|
4584
|
+
* A comparator creator which will set up a comparator which prioritizes
|
|
4585
|
+
* participants who are from a specific source (e.g., WebRTC, RTMP, WHIP...).
|
|
4586
|
+
*
|
|
4587
|
+
* @param source the source to prioritize.
|
|
4588
|
+
*/
|
|
4589
|
+
const withParticipantSource = (source) => (a, b) => {
|
|
4590
|
+
if (a.source === source && b.source !== source)
|
|
4591
|
+
return -1;
|
|
4592
|
+
if (a.source !== source && b.source === source)
|
|
4593
|
+
return 1;
|
|
4594
|
+
return 0;
|
|
4595
|
+
};
|
|
4530
4596
|
/**
|
|
4531
4597
|
* A comparator creator which will set up a comparator which prioritizes
|
|
4532
4598
|
* participants who have a specific reaction.
|
|
@@ -4600,7 +4666,7 @@ const paginatedLayoutSortPreset = combineComparators(pinned, ifInvisibleOrUnknow
|
|
|
4600
4666
|
/**
|
|
4601
4667
|
* The sorting preset for livestreams and audio rooms.
|
|
4602
4668
|
*/
|
|
4603
|
-
const livestreamOrAudioRoomSortPreset = combineComparators(ifInvisibleBy(combineComparators(dominantSpeaker, speaking, reactionType('raised-hand'), publishingVideo, publishingAudio)), role('admin', 'host', 'speaker'));
|
|
4669
|
+
const livestreamOrAudioRoomSortPreset = combineComparators(ifInvisibleBy(combineComparators(dominantSpeaker, speaking, reactionType('raised-hand'), withParticipantSource(ParticipantSource.RTMP), publishingVideo, publishingAudio)), role('admin', 'host', 'speaker'));
|
|
4604
4670
|
|
|
4605
4671
|
/**
|
|
4606
4672
|
* Returns the default egress object - when no egress data is available.
|
|
@@ -5693,7 +5759,7 @@ const getSdkVersion = (sdk) => {
|
|
|
5693
5759
|
return sdk ? `${sdk.major}.${sdk.minor}.${sdk.patch}` : '0.0.0-development';
|
|
5694
5760
|
};
|
|
5695
5761
|
|
|
5696
|
-
const version = "1.
|
|
5762
|
+
const version = "1.30.0";
|
|
5697
5763
|
const [major, minor, patch] = version.split('.');
|
|
5698
5764
|
let sdkInfo = {
|
|
5699
5765
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -12047,6 +12113,7 @@ class Call {
|
|
|
12047
12113
|
preferredPublishOptions,
|
|
12048
12114
|
preferredSubscribeOptions,
|
|
12049
12115
|
capabilities: Array.from(this.clientCapabilities),
|
|
12116
|
+
source: ParticipantSource.WEBRTC_UNSPECIFIED,
|
|
12050
12117
|
});
|
|
12051
12118
|
this.currentPublishOptions = publishOptions;
|
|
12052
12119
|
this.fastReconnectDeadlineSeconds = fastReconnectDeadlineSeconds;
|
|
@@ -14594,7 +14661,7 @@ class StreamClient {
|
|
|
14594
14661
|
this.getUserAgent = () => {
|
|
14595
14662
|
if (!this.cachedUserAgent) {
|
|
14596
14663
|
const { clientAppIdentifier = {} } = this.options;
|
|
14597
|
-
const { sdkName = 'js', sdkVersion = "1.
|
|
14664
|
+
const { sdkName = 'js', sdkVersion = "1.30.0", ...extras } = clientAppIdentifier;
|
|
14598
14665
|
this.cachedUserAgent = [
|
|
14599
14666
|
`stream-video-${sdkName}-v${sdkVersion}`,
|
|
14600
14667
|
...Object.entries(extras).map(([key, value]) => `${key}=${value}`),
|
|
@@ -15269,4 +15336,5 @@ exports.setThermalState = setThermalState;
|
|
|
15269
15336
|
exports.setWebRTCInfo = setWebRTCInfo;
|
|
15270
15337
|
exports.speakerLayoutSortPreset = speakerLayoutSortPreset;
|
|
15271
15338
|
exports.speaking = speaking;
|
|
15339
|
+
exports.withParticipantSource = withParticipantSource;
|
|
15272
15340
|
//# sourceMappingURL=index.cjs.js.map
|