livekit-client 0.14.0 → 0.15.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/.github/workflows/{lint.yaml → test.yaml} +7 -4
- package/README.md +27 -12
- package/dist/api/SignalClient.d.ts +4 -31
- package/dist/api/SignalClient.js +25 -7
- package/dist/api/SignalClient.js.map +1 -1
- package/dist/connect.d.ts +1 -1
- package/dist/connect.js +70 -56
- package/dist/connect.js.map +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +10 -0
- package/dist/logger.js +14 -0
- package/dist/logger.js.map +1 -1
- package/dist/options.d.ts +77 -12
- package/dist/options.js +0 -10
- package/dist/options.js.map +1 -1
- package/dist/proto/livekit_models.d.ts +28 -1
- package/dist/proto/livekit_models.js +194 -3
- package/dist/proto/livekit_models.js.map +1 -1
- package/dist/proto/livekit_rtc.d.ts +49 -7
- package/dist/proto/livekit_rtc.js +303 -28
- package/dist/proto/livekit_rtc.js.map +1 -1
- package/dist/room/RTCEngine.d.ts +2 -2
- package/dist/room/RTCEngine.js +6 -4
- package/dist/room/RTCEngine.js.map +1 -1
- package/dist/room/Room.d.ts +12 -14
- package/dist/room/Room.js +78 -45
- package/dist/room/Room.js.map +1 -1
- package/dist/room/events.d.ts +98 -1
- package/dist/room/events.js +97 -0
- package/dist/room/events.js.map +1 -1
- package/dist/room/participant/LocalParticipant.d.ts +27 -9
- package/dist/room/participant/LocalParticipant.js +194 -155
- package/dist/room/participant/LocalParticipant.js.map +1 -1
- package/dist/room/participant/Participant.js +6 -2
- package/dist/room/participant/Participant.js.map +1 -1
- package/dist/room/participant/RemoteParticipant.d.ts +1 -1
- package/dist/room/participant/RemoteParticipant.js +6 -5
- package/dist/room/participant/RemoteParticipant.js.map +1 -1
- package/dist/room/participant/publishUtils.d.ts +11 -0
- package/dist/room/participant/publishUtils.js +148 -0
- package/dist/room/participant/publishUtils.js.map +1 -0
- package/dist/room/participant/publishUtils.test.d.ts +1 -0
- package/dist/room/participant/publishUtils.test.js +79 -0
- package/dist/room/participant/publishUtils.test.js.map +1 -0
- package/dist/room/track/LocalAudioTrack.d.ts +4 -3
- package/dist/room/track/LocalAudioTrack.js +5 -3
- package/dist/room/track/LocalAudioTrack.js.map +1 -1
- package/dist/room/track/LocalTrack.d.ts +1 -3
- package/dist/room/track/LocalTrack.js +2 -49
- package/dist/room/track/LocalTrack.js.map +1 -1
- package/dist/room/track/LocalVideoTrack.d.ts +6 -4
- package/dist/room/track/LocalVideoTrack.js +41 -12
- package/dist/room/track/LocalVideoTrack.js.map +1 -1
- package/dist/room/track/LocalVideoTrack.test.d.ts +1 -0
- package/dist/room/track/LocalVideoTrack.test.js +68 -0
- package/dist/room/track/LocalVideoTrack.test.js.map +1 -0
- package/dist/room/track/RemoteTrackPublication.d.ts +10 -4
- package/dist/room/track/RemoteTrackPublication.js +60 -4
- package/dist/room/track/RemoteTrackPublication.js.map +1 -1
- package/dist/room/track/RemoteVideoTrack.d.ts +15 -1
- package/dist/room/track/RemoteVideoTrack.js +98 -1
- package/dist/room/track/RemoteVideoTrack.js.map +1 -1
- package/dist/room/track/Track.d.ts +15 -2
- package/dist/room/track/Track.js +6 -2
- package/dist/room/track/Track.js.map +1 -1
- package/dist/room/track/options.d.ts +15 -65
- package/dist/room/track/options.js +14 -13
- package/dist/room/track/options.js.map +1 -1
- package/dist/room/track/utils.d.ts +3 -0
- package/dist/room/track/utils.js +68 -0
- package/dist/room/track/utils.js.map +1 -0
- package/dist/room/track/utils.test.d.ts +1 -0
- package/dist/room/track/utils.test.js +85 -0
- package/dist/room/track/utils.test.js.map +1 -0
- package/dist/room/utils.d.ts +6 -0
- package/dist/room/utils.js +25 -1
- package/dist/room/utils.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/example/index.html +183 -178
- package/example/sample.ts +410 -326
- package/example/styles.css +144 -0
- package/example/webpack.config.js +1 -1
- package/jest.config.js +6 -0
- package/package.json +9 -6
- package/tsconfig.eslint.json +8 -1
- package/dist/room/defaults.d.ts +0 -5
- package/dist/room/defaults.js +0 -32
- package/dist/room/defaults.js.map +0 -1
- package/dist/room/track/create.d.ts +0 -25
- package/dist/room/track/create.js +0 -170
- package/dist/room/track/create.js.map +0 -1
package/dist/options.d.ts
CHANGED
@@ -1,4 +1,53 @@
|
|
1
|
-
import {
|
1
|
+
import { LogLevel, LogLevelDesc } from './logger';
|
2
|
+
import { AudioCaptureOptions, CreateLocalTracksOptions, TrackPublishDefaults, VideoCaptureOptions } from './room/track/options';
|
3
|
+
/**
|
4
|
+
* Options for when creating a new room
|
5
|
+
*/
|
6
|
+
export interface RoomOptions {
|
7
|
+
/**
|
8
|
+
* automatically manage quality of subscribed video tracks, subscribe to the
|
9
|
+
* an appropriate resolution based on the size of the video elements that
|
10
|
+
* tracks are attached to.
|
11
|
+
*
|
12
|
+
* also observes the visibility of attached tracks and pauses receiving data
|
13
|
+
* if they are not visible. when an attached element becomes visible again,
|
14
|
+
* the track resumes receiving data.
|
15
|
+
*/
|
16
|
+
autoManageVideo?: boolean;
|
17
|
+
/**
|
18
|
+
* default options to use when capturing user's audio
|
19
|
+
*/
|
20
|
+
audioCaptureDefaults?: AudioCaptureOptions;
|
21
|
+
/**
|
22
|
+
* default options to use when capturing user's video
|
23
|
+
*/
|
24
|
+
videoCaptureDefaults?: VideoCaptureOptions;
|
25
|
+
/**
|
26
|
+
* default options to use when publishing tracks
|
27
|
+
*/
|
28
|
+
publishDefaults?: TrackPublishDefaults;
|
29
|
+
/**
|
30
|
+
* should local tracks be stopped when they are unpublished. defaults to true
|
31
|
+
* set this to false if you would prefer to clean up unpublished local tracks manually.
|
32
|
+
*/
|
33
|
+
stopLocalTrackOnUnpublish?: boolean;
|
34
|
+
/**
|
35
|
+
* @internal
|
36
|
+
* experimental flag, disable client managed layer pause when publishing capability is limited
|
37
|
+
*/
|
38
|
+
expDisableLayerPause?: boolean;
|
39
|
+
}
|
40
|
+
/**
|
41
|
+
* Options for Room.connect()
|
42
|
+
*/
|
43
|
+
export interface RoomConnectOptions {
|
44
|
+
/** autosubscribe to room tracks after joining, defaults to true */
|
45
|
+
autoSubscribe?: boolean;
|
46
|
+
/**
|
47
|
+
* use to override any RTCConfiguration options.
|
48
|
+
*/
|
49
|
+
rtcConfig?: RTCConfiguration;
|
50
|
+
}
|
2
51
|
/**
|
3
52
|
* if video or audio tracks are created as part of [[connect]], it'll automatically
|
4
53
|
* publish those tracks to the room.
|
@@ -6,8 +55,18 @@ import { CreateLocalTracksOptions, TrackCaptureDefaults, TrackPublishDefaults }
|
|
6
55
|
export interface ConnectOptions extends CreateLocalTracksOptions {
|
7
56
|
/** autosubscribe to room tracks upon connect, defaults to true */
|
8
57
|
autoSubscribe?: boolean;
|
58
|
+
/**
|
59
|
+
* automatically manage quality of subscribed video tracks, subscribe to the
|
60
|
+
* an appropriate resolution based on the size of the video elements that tracks
|
61
|
+
* are attached to.
|
62
|
+
*
|
63
|
+
* also observes the visibility of attached tracks and pauses receiving data
|
64
|
+
* if they are not visible.
|
65
|
+
*
|
66
|
+
*/
|
67
|
+
autoManageVideo?: boolean;
|
9
68
|
/** configures LiveKit internal log level */
|
10
|
-
logLevel?: LogLevel;
|
69
|
+
logLevel?: LogLevel | LogLevelDesc;
|
11
70
|
/**
|
12
71
|
* set ICE servers. When deployed correctly, LiveKit automatically uses the built-in TURN servers
|
13
72
|
*/
|
@@ -29,19 +88,25 @@ export interface ConnectOptions extends CreateLocalTracksOptions {
|
|
29
88
|
*/
|
30
89
|
video?: boolean;
|
31
90
|
/**
|
32
|
-
* default options to use when capturing user
|
91
|
+
* default options to use when capturing user's audio
|
33
92
|
*/
|
34
|
-
|
93
|
+
audioCaptureDefaults?: AudioCaptureOptions;
|
94
|
+
/**
|
95
|
+
* default options to use when capturing user's video
|
96
|
+
*/
|
97
|
+
videoCaptureDefaults?: VideoCaptureOptions;
|
35
98
|
/**
|
36
99
|
* default options to use when publishing tracks
|
37
100
|
*/
|
38
101
|
publishDefaults?: TrackPublishDefaults;
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
102
|
+
/**
|
103
|
+
* should local tracks be stopped when they are unpublished. defaults to true
|
104
|
+
* set this to false if you would prefer to clean up unpublished local tracks manually.
|
105
|
+
*/
|
106
|
+
stopLocalTrackOnUnpublish?: boolean;
|
107
|
+
/**
|
108
|
+
* @internal
|
109
|
+
* experimental flag, disable client managed layer pause when publishing capability is limited
|
110
|
+
*/
|
111
|
+
expDisableLayerPause?: boolean;
|
47
112
|
}
|
package/dist/options.js
CHANGED
@@ -1,13 +1,3 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.LogLevel = void 0;
|
4
|
-
var LogLevel;
|
5
|
-
(function (LogLevel) {
|
6
|
-
LogLevel["trace"] = "trace";
|
7
|
-
LogLevel["debug"] = "debug";
|
8
|
-
LogLevel["info"] = "info";
|
9
|
-
LogLevel["warn"] = "warn";
|
10
|
-
LogLevel["error"] = "error";
|
11
|
-
LogLevel["silent"] = "silent";
|
12
|
-
})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
|
13
3
|
//# sourceMappingURL=options.js.map
|
package/dist/options.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":""}
|
@@ -13,10 +13,19 @@ export declare enum TrackSource {
|
|
13
13
|
CAMERA = 1,
|
14
14
|
MICROPHONE = 2,
|
15
15
|
SCREEN_SHARE = 3,
|
16
|
+
SCREEN_SHARE_AUDIO = 4,
|
16
17
|
UNRECOGNIZED = -1
|
17
18
|
}
|
18
19
|
export declare function trackSourceFromJSON(object: any): TrackSource;
|
19
20
|
export declare function trackSourceToJSON(object: TrackSource): string;
|
21
|
+
export declare enum VideoQuality {
|
22
|
+
LOW = 0,
|
23
|
+
MEDIUM = 1,
|
24
|
+
HIGH = 2,
|
25
|
+
UNRECOGNIZED = -1
|
26
|
+
}
|
27
|
+
export declare function videoQualityFromJSON(object: any): VideoQuality;
|
28
|
+
export declare function videoQualityToJSON(object: VideoQuality): string;
|
20
29
|
export declare enum ConnectionQuality {
|
21
30
|
POOR = 0,
|
22
31
|
GOOD = 1,
|
@@ -35,6 +44,7 @@ export interface Room {
|
|
35
44
|
enabledCodecs: Codec[];
|
36
45
|
metadata: string;
|
37
46
|
numParticipants: number;
|
47
|
+
activeRecording: boolean;
|
38
48
|
}
|
39
49
|
export interface Codec {
|
40
50
|
mime: string;
|
@@ -48,8 +58,8 @@ export interface ParticipantInfo {
|
|
48
58
|
metadata: string;
|
49
59
|
/** timestamp when participant joined room, in seconds */
|
50
60
|
joinedAt: number;
|
51
|
-
/** hidden participant (used for recording) */
|
52
61
|
hidden: boolean;
|
62
|
+
recorder: boolean;
|
53
63
|
}
|
54
64
|
export declare enum ParticipantInfo_State {
|
55
65
|
/** JOINING - websocket' connected, but not offered yet */
|
@@ -82,6 +92,16 @@ export interface TrackInfo {
|
|
82
92
|
disableDtx: boolean;
|
83
93
|
/** source of media */
|
84
94
|
source: TrackSource;
|
95
|
+
layers: VideoLayer[];
|
96
|
+
}
|
97
|
+
/** provide information about available spatial layers */
|
98
|
+
export interface VideoLayer {
|
99
|
+
/** for tracks with a single layer, this should be HIGH */
|
100
|
+
quality: VideoQuality;
|
101
|
+
width: number;
|
102
|
+
height: number;
|
103
|
+
/** target bitrate, server will measure actual */
|
104
|
+
bitrate: number;
|
85
105
|
}
|
86
106
|
/** new DataPacket API */
|
87
107
|
export interface DataPacket {
|
@@ -142,6 +162,13 @@ export declare const TrackInfo: {
|
|
142
162
|
toJSON(message: TrackInfo): unknown;
|
143
163
|
fromPartial(object: DeepPartial<TrackInfo>): TrackInfo;
|
144
164
|
};
|
165
|
+
export declare const VideoLayer: {
|
166
|
+
encode(message: VideoLayer, writer?: _m0.Writer): _m0.Writer;
|
167
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): VideoLayer;
|
168
|
+
fromJSON(object: any): VideoLayer;
|
169
|
+
toJSON(message: VideoLayer): unknown;
|
170
|
+
fromPartial(object: DeepPartial<VideoLayer>): VideoLayer;
|
171
|
+
};
|
145
172
|
export declare const DataPacket: {
|
146
173
|
encode(message: DataPacket, writer?: _m0.Writer): _m0.Writer;
|
147
174
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DataPacket;
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.UserPacket = exports.SpeakerInfo = exports.ActiveSpeakerUpdate = exports.DataPacket = exports.TrackInfo = exports.ParticipantInfo = exports.Codec = exports.Room = exports.dataPacket_KindToJSON = exports.dataPacket_KindFromJSON = exports.DataPacket_Kind = exports.participantInfo_StateToJSON = exports.participantInfo_StateFromJSON = exports.ParticipantInfo_State = exports.connectionQualityToJSON = exports.connectionQualityFromJSON = exports.ConnectionQuality = exports.trackSourceToJSON = exports.trackSourceFromJSON = exports.TrackSource = exports.trackTypeToJSON = exports.trackTypeFromJSON = exports.TrackType = exports.protobufPackage = void 0;
|
6
|
+
exports.UserPacket = exports.SpeakerInfo = exports.ActiveSpeakerUpdate = exports.DataPacket = exports.VideoLayer = exports.TrackInfo = exports.ParticipantInfo = exports.Codec = exports.Room = exports.dataPacket_KindToJSON = exports.dataPacket_KindFromJSON = exports.DataPacket_Kind = exports.participantInfo_StateToJSON = exports.participantInfo_StateFromJSON = exports.ParticipantInfo_State = exports.connectionQualityToJSON = exports.connectionQualityFromJSON = exports.ConnectionQuality = exports.videoQualityToJSON = exports.videoQualityFromJSON = exports.VideoQuality = exports.trackSourceToJSON = exports.trackSourceFromJSON = exports.TrackSource = exports.trackTypeToJSON = exports.trackTypeFromJSON = exports.TrackType = exports.protobufPackage = void 0;
|
7
7
|
/* eslint-disable */
|
8
8
|
const long_1 = __importDefault(require("long"));
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
@@ -52,6 +52,7 @@ var TrackSource;
|
|
52
52
|
TrackSource[TrackSource["CAMERA"] = 1] = "CAMERA";
|
53
53
|
TrackSource[TrackSource["MICROPHONE"] = 2] = "MICROPHONE";
|
54
54
|
TrackSource[TrackSource["SCREEN_SHARE"] = 3] = "SCREEN_SHARE";
|
55
|
+
TrackSource[TrackSource["SCREEN_SHARE_AUDIO"] = 4] = "SCREEN_SHARE_AUDIO";
|
55
56
|
TrackSource[TrackSource["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
56
57
|
})(TrackSource = exports.TrackSource || (exports.TrackSource = {}));
|
57
58
|
function trackSourceFromJSON(object) {
|
@@ -68,6 +69,9 @@ function trackSourceFromJSON(object) {
|
|
68
69
|
case 3:
|
69
70
|
case "SCREEN_SHARE":
|
70
71
|
return TrackSource.SCREEN_SHARE;
|
72
|
+
case 4:
|
73
|
+
case "SCREEN_SHARE_AUDIO":
|
74
|
+
return TrackSource.SCREEN_SHARE_AUDIO;
|
71
75
|
case -1:
|
72
76
|
case "UNRECOGNIZED":
|
73
77
|
default:
|
@@ -85,11 +89,51 @@ function trackSourceToJSON(object) {
|
|
85
89
|
return "MICROPHONE";
|
86
90
|
case TrackSource.SCREEN_SHARE:
|
87
91
|
return "SCREEN_SHARE";
|
92
|
+
case TrackSource.SCREEN_SHARE_AUDIO:
|
93
|
+
return "SCREEN_SHARE_AUDIO";
|
88
94
|
default:
|
89
95
|
return "UNKNOWN";
|
90
96
|
}
|
91
97
|
}
|
92
98
|
exports.trackSourceToJSON = trackSourceToJSON;
|
99
|
+
var VideoQuality;
|
100
|
+
(function (VideoQuality) {
|
101
|
+
VideoQuality[VideoQuality["LOW"] = 0] = "LOW";
|
102
|
+
VideoQuality[VideoQuality["MEDIUM"] = 1] = "MEDIUM";
|
103
|
+
VideoQuality[VideoQuality["HIGH"] = 2] = "HIGH";
|
104
|
+
VideoQuality[VideoQuality["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
105
|
+
})(VideoQuality = exports.VideoQuality || (exports.VideoQuality = {}));
|
106
|
+
function videoQualityFromJSON(object) {
|
107
|
+
switch (object) {
|
108
|
+
case 0:
|
109
|
+
case "LOW":
|
110
|
+
return VideoQuality.LOW;
|
111
|
+
case 1:
|
112
|
+
case "MEDIUM":
|
113
|
+
return VideoQuality.MEDIUM;
|
114
|
+
case 2:
|
115
|
+
case "HIGH":
|
116
|
+
return VideoQuality.HIGH;
|
117
|
+
case -1:
|
118
|
+
case "UNRECOGNIZED":
|
119
|
+
default:
|
120
|
+
return VideoQuality.UNRECOGNIZED;
|
121
|
+
}
|
122
|
+
}
|
123
|
+
exports.videoQualityFromJSON = videoQualityFromJSON;
|
124
|
+
function videoQualityToJSON(object) {
|
125
|
+
switch (object) {
|
126
|
+
case VideoQuality.LOW:
|
127
|
+
return "LOW";
|
128
|
+
case VideoQuality.MEDIUM:
|
129
|
+
return "MEDIUM";
|
130
|
+
case VideoQuality.HIGH:
|
131
|
+
return "HIGH";
|
132
|
+
default:
|
133
|
+
return "UNKNOWN";
|
134
|
+
}
|
135
|
+
}
|
136
|
+
exports.videoQualityToJSON = videoQualityToJSON;
|
93
137
|
var ConnectionQuality;
|
94
138
|
(function (ConnectionQuality) {
|
95
139
|
ConnectionQuality[ConnectionQuality["POOR"] = 0] = "POOR";
|
@@ -217,6 +261,7 @@ const baseRoom = {
|
|
217
261
|
turnPassword: "",
|
218
262
|
metadata: "",
|
219
263
|
numParticipants: 0,
|
264
|
+
activeRecording: false,
|
220
265
|
};
|
221
266
|
exports.Room = {
|
222
267
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
@@ -247,6 +292,9 @@ exports.Room = {
|
|
247
292
|
if (message.numParticipants !== 0) {
|
248
293
|
writer.uint32(72).uint32(message.numParticipants);
|
249
294
|
}
|
295
|
+
if (message.activeRecording === true) {
|
296
|
+
writer.uint32(80).bool(message.activeRecording);
|
297
|
+
}
|
250
298
|
return writer;
|
251
299
|
},
|
252
300
|
decode(input, length) {
|
@@ -284,6 +332,9 @@ exports.Room = {
|
|
284
332
|
case 9:
|
285
333
|
message.numParticipants = reader.uint32();
|
286
334
|
break;
|
335
|
+
case 10:
|
336
|
+
message.activeRecording = reader.bool();
|
337
|
+
break;
|
287
338
|
default:
|
288
339
|
reader.skipType(tag & 7);
|
289
340
|
break;
|
@@ -349,6 +400,13 @@ exports.Room = {
|
|
349
400
|
else {
|
350
401
|
message.numParticipants = 0;
|
351
402
|
}
|
403
|
+
if (object.activeRecording !== undefined &&
|
404
|
+
object.activeRecording !== null) {
|
405
|
+
message.activeRecording = Boolean(object.activeRecording);
|
406
|
+
}
|
407
|
+
else {
|
408
|
+
message.activeRecording = false;
|
409
|
+
}
|
352
410
|
return message;
|
353
411
|
},
|
354
412
|
toJSON(message) {
|
@@ -372,10 +430,12 @@ exports.Room = {
|
|
372
430
|
message.metadata !== undefined && (obj.metadata = message.metadata);
|
373
431
|
message.numParticipants !== undefined &&
|
374
432
|
(obj.numParticipants = message.numParticipants);
|
433
|
+
message.activeRecording !== undefined &&
|
434
|
+
(obj.activeRecording = message.activeRecording);
|
375
435
|
return obj;
|
376
436
|
},
|
377
437
|
fromPartial(object) {
|
378
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
438
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
379
439
|
const message = Object.assign({}, baseRoom);
|
380
440
|
message.sid = (_a = object.sid) !== null && _a !== void 0 ? _a : "";
|
381
441
|
message.name = (_b = object.name) !== null && _b !== void 0 ? _b : "";
|
@@ -391,6 +451,7 @@ exports.Room = {
|
|
391
451
|
}
|
392
452
|
message.metadata = (_g = object.metadata) !== null && _g !== void 0 ? _g : "";
|
393
453
|
message.numParticipants = (_h = object.numParticipants) !== null && _h !== void 0 ? _h : 0;
|
454
|
+
message.activeRecording = (_j = object.activeRecording) !== null && _j !== void 0 ? _j : false;
|
394
455
|
return message;
|
395
456
|
},
|
396
457
|
};
|
@@ -462,6 +523,7 @@ const baseParticipantInfo = {
|
|
462
523
|
metadata: "",
|
463
524
|
joinedAt: 0,
|
464
525
|
hidden: false,
|
526
|
+
recorder: false,
|
465
527
|
};
|
466
528
|
exports.ParticipantInfo = {
|
467
529
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
@@ -486,6 +548,9 @@ exports.ParticipantInfo = {
|
|
486
548
|
if (message.hidden === true) {
|
487
549
|
writer.uint32(56).bool(message.hidden);
|
488
550
|
}
|
551
|
+
if (message.recorder === true) {
|
552
|
+
writer.uint32(64).bool(message.recorder);
|
553
|
+
}
|
489
554
|
return writer;
|
490
555
|
},
|
491
556
|
decode(input, length) {
|
@@ -517,6 +582,9 @@ exports.ParticipantInfo = {
|
|
517
582
|
case 7:
|
518
583
|
message.hidden = reader.bool();
|
519
584
|
break;
|
585
|
+
case 8:
|
586
|
+
message.recorder = reader.bool();
|
587
|
+
break;
|
520
588
|
default:
|
521
589
|
reader.skipType(tag & 7);
|
522
590
|
break;
|
@@ -568,6 +636,12 @@ exports.ParticipantInfo = {
|
|
568
636
|
else {
|
569
637
|
message.hidden = false;
|
570
638
|
}
|
639
|
+
if (object.recorder !== undefined && object.recorder !== null) {
|
640
|
+
message.recorder = Boolean(object.recorder);
|
641
|
+
}
|
642
|
+
else {
|
643
|
+
message.recorder = false;
|
644
|
+
}
|
571
645
|
return message;
|
572
646
|
},
|
573
647
|
toJSON(message) {
|
@@ -585,10 +659,11 @@ exports.ParticipantInfo = {
|
|
585
659
|
message.metadata !== undefined && (obj.metadata = message.metadata);
|
586
660
|
message.joinedAt !== undefined && (obj.joinedAt = message.joinedAt);
|
587
661
|
message.hidden !== undefined && (obj.hidden = message.hidden);
|
662
|
+
message.recorder !== undefined && (obj.recorder = message.recorder);
|
588
663
|
return obj;
|
589
664
|
},
|
590
665
|
fromPartial(object) {
|
591
|
-
var _a, _b, _c, _d, _e, _f;
|
666
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
592
667
|
const message = Object.assign({}, baseParticipantInfo);
|
593
668
|
message.sid = (_a = object.sid) !== null && _a !== void 0 ? _a : "";
|
594
669
|
message.identity = (_b = object.identity) !== null && _b !== void 0 ? _b : "";
|
@@ -602,6 +677,7 @@ exports.ParticipantInfo = {
|
|
602
677
|
message.metadata = (_d = object.metadata) !== null && _d !== void 0 ? _d : "";
|
603
678
|
message.joinedAt = (_e = object.joinedAt) !== null && _e !== void 0 ? _e : 0;
|
604
679
|
message.hidden = (_f = object.hidden) !== null && _f !== void 0 ? _f : false;
|
680
|
+
message.recorder = (_g = object.recorder) !== null && _g !== void 0 ? _g : false;
|
605
681
|
return message;
|
606
682
|
},
|
607
683
|
};
|
@@ -645,12 +721,16 @@ exports.TrackInfo = {
|
|
645
721
|
if (message.source !== 0) {
|
646
722
|
writer.uint32(72).int32(message.source);
|
647
723
|
}
|
724
|
+
for (const v of message.layers) {
|
725
|
+
exports.VideoLayer.encode(v, writer.uint32(82).fork()).ldelim();
|
726
|
+
}
|
648
727
|
return writer;
|
649
728
|
},
|
650
729
|
decode(input, length) {
|
651
730
|
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
652
731
|
let end = length === undefined ? reader.len : reader.pos + length;
|
653
732
|
const message = Object.assign({}, baseTrackInfo);
|
733
|
+
message.layers = [];
|
654
734
|
while (reader.pos < end) {
|
655
735
|
const tag = reader.uint32();
|
656
736
|
switch (tag >>> 3) {
|
@@ -681,6 +761,9 @@ exports.TrackInfo = {
|
|
681
761
|
case 9:
|
682
762
|
message.source = reader.int32();
|
683
763
|
break;
|
764
|
+
case 10:
|
765
|
+
message.layers.push(exports.VideoLayer.decode(reader, reader.uint32()));
|
766
|
+
break;
|
684
767
|
default:
|
685
768
|
reader.skipType(tag & 7);
|
686
769
|
break;
|
@@ -690,6 +773,7 @@ exports.TrackInfo = {
|
|
690
773
|
},
|
691
774
|
fromJSON(object) {
|
692
775
|
const message = Object.assign({}, baseTrackInfo);
|
776
|
+
message.layers = [];
|
693
777
|
if (object.sid !== undefined && object.sid !== null) {
|
694
778
|
message.sid = String(object.sid);
|
695
779
|
}
|
@@ -744,6 +828,11 @@ exports.TrackInfo = {
|
|
744
828
|
else {
|
745
829
|
message.source = 0;
|
746
830
|
}
|
831
|
+
if (object.layers !== undefined && object.layers !== null) {
|
832
|
+
for (const e of object.layers) {
|
833
|
+
message.layers.push(exports.VideoLayer.fromJSON(e));
|
834
|
+
}
|
835
|
+
}
|
747
836
|
return message;
|
748
837
|
},
|
749
838
|
toJSON(message) {
|
@@ -758,6 +847,12 @@ exports.TrackInfo = {
|
|
758
847
|
message.disableDtx !== undefined && (obj.disableDtx = message.disableDtx);
|
759
848
|
message.source !== undefined &&
|
760
849
|
(obj.source = trackSourceToJSON(message.source));
|
850
|
+
if (message.layers) {
|
851
|
+
obj.layers = message.layers.map((e) => e ? exports.VideoLayer.toJSON(e) : undefined);
|
852
|
+
}
|
853
|
+
else {
|
854
|
+
obj.layers = [];
|
855
|
+
}
|
761
856
|
return obj;
|
762
857
|
},
|
763
858
|
fromPartial(object) {
|
@@ -772,6 +867,102 @@ exports.TrackInfo = {
|
|
772
867
|
message.simulcast = (_g = object.simulcast) !== null && _g !== void 0 ? _g : false;
|
773
868
|
message.disableDtx = (_h = object.disableDtx) !== null && _h !== void 0 ? _h : false;
|
774
869
|
message.source = (_j = object.source) !== null && _j !== void 0 ? _j : 0;
|
870
|
+
message.layers = [];
|
871
|
+
if (object.layers !== undefined && object.layers !== null) {
|
872
|
+
for (const e of object.layers) {
|
873
|
+
message.layers.push(exports.VideoLayer.fromPartial(e));
|
874
|
+
}
|
875
|
+
}
|
876
|
+
return message;
|
877
|
+
},
|
878
|
+
};
|
879
|
+
const baseVideoLayer = { quality: 0, width: 0, height: 0, bitrate: 0 };
|
880
|
+
exports.VideoLayer = {
|
881
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
882
|
+
if (message.quality !== 0) {
|
883
|
+
writer.uint32(8).int32(message.quality);
|
884
|
+
}
|
885
|
+
if (message.width !== 0) {
|
886
|
+
writer.uint32(16).uint32(message.width);
|
887
|
+
}
|
888
|
+
if (message.height !== 0) {
|
889
|
+
writer.uint32(24).uint32(message.height);
|
890
|
+
}
|
891
|
+
if (message.bitrate !== 0) {
|
892
|
+
writer.uint32(32).uint32(message.bitrate);
|
893
|
+
}
|
894
|
+
return writer;
|
895
|
+
},
|
896
|
+
decode(input, length) {
|
897
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
898
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
899
|
+
const message = Object.assign({}, baseVideoLayer);
|
900
|
+
while (reader.pos < end) {
|
901
|
+
const tag = reader.uint32();
|
902
|
+
switch (tag >>> 3) {
|
903
|
+
case 1:
|
904
|
+
message.quality = reader.int32();
|
905
|
+
break;
|
906
|
+
case 2:
|
907
|
+
message.width = reader.uint32();
|
908
|
+
break;
|
909
|
+
case 3:
|
910
|
+
message.height = reader.uint32();
|
911
|
+
break;
|
912
|
+
case 4:
|
913
|
+
message.bitrate = reader.uint32();
|
914
|
+
break;
|
915
|
+
default:
|
916
|
+
reader.skipType(tag & 7);
|
917
|
+
break;
|
918
|
+
}
|
919
|
+
}
|
920
|
+
return message;
|
921
|
+
},
|
922
|
+
fromJSON(object) {
|
923
|
+
const message = Object.assign({}, baseVideoLayer);
|
924
|
+
if (object.quality !== undefined && object.quality !== null) {
|
925
|
+
message.quality = videoQualityFromJSON(object.quality);
|
926
|
+
}
|
927
|
+
else {
|
928
|
+
message.quality = 0;
|
929
|
+
}
|
930
|
+
if (object.width !== undefined && object.width !== null) {
|
931
|
+
message.width = Number(object.width);
|
932
|
+
}
|
933
|
+
else {
|
934
|
+
message.width = 0;
|
935
|
+
}
|
936
|
+
if (object.height !== undefined && object.height !== null) {
|
937
|
+
message.height = Number(object.height);
|
938
|
+
}
|
939
|
+
else {
|
940
|
+
message.height = 0;
|
941
|
+
}
|
942
|
+
if (object.bitrate !== undefined && object.bitrate !== null) {
|
943
|
+
message.bitrate = Number(object.bitrate);
|
944
|
+
}
|
945
|
+
else {
|
946
|
+
message.bitrate = 0;
|
947
|
+
}
|
948
|
+
return message;
|
949
|
+
},
|
950
|
+
toJSON(message) {
|
951
|
+
const obj = {};
|
952
|
+
message.quality !== undefined &&
|
953
|
+
(obj.quality = videoQualityToJSON(message.quality));
|
954
|
+
message.width !== undefined && (obj.width = message.width);
|
955
|
+
message.height !== undefined && (obj.height = message.height);
|
956
|
+
message.bitrate !== undefined && (obj.bitrate = message.bitrate);
|
957
|
+
return obj;
|
958
|
+
},
|
959
|
+
fromPartial(object) {
|
960
|
+
var _a, _b, _c, _d;
|
961
|
+
const message = Object.assign({}, baseVideoLayer);
|
962
|
+
message.quality = (_a = object.quality) !== null && _a !== void 0 ? _a : 0;
|
963
|
+
message.width = (_b = object.width) !== null && _b !== void 0 ? _b : 0;
|
964
|
+
message.height = (_c = object.height) !== null && _c !== void 0 ? _c : 0;
|
965
|
+
message.bitrate = (_d = object.bitrate) !== null && _d !== void 0 ? _d : 0;
|
775
966
|
return message;
|
776
967
|
},
|
777
968
|
};
|