livekit-client 2.1.1 → 2.1.3
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/dist/livekit-client.esm.mjs +215 -22
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts +2 -1
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/RegionUrlProvider.d.ts +1 -0
- package/dist/src/room/RegionUrlProvider.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +5 -2
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/events.d.ts +20 -1
- package/dist/src/room/events.d.ts.map +1 -1
- package/dist/src/room/participant/Participant.d.ts +2 -1
- package/dist/src/room/participant/Participant.d.ts.map +1 -1
- package/dist/src/room/track/RemoteTrack.d.ts +1 -0
- package/dist/src/room/track/RemoteTrack.d.ts.map +1 -1
- package/dist/src/room/track/Track.d.ts +7 -0
- package/dist/src/room/track/Track.d.ts.map +1 -1
- package/dist/src/room/track/TrackPublication.d.ts +3 -1
- package/dist/src/room/track/TrackPublication.d.ts.map +1 -1
- package/dist/src/room/types.d.ts +8 -0
- package/dist/src/room/types.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts +3 -1
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/ts4.2/src/index.d.ts +1 -1
- package/dist/ts4.2/src/room/RTCEngine.d.ts +2 -1
- package/dist/ts4.2/src/room/RegionUrlProvider.d.ts +1 -0
- package/dist/ts4.2/src/room/Room.d.ts +5 -2
- package/dist/ts4.2/src/room/events.d.ts +20 -1
- package/dist/ts4.2/src/room/participant/Participant.d.ts +2 -1
- package/dist/ts4.2/src/room/track/RemoteTrack.d.ts +1 -0
- package/dist/ts4.2/src/room/track/Track.d.ts +7 -0
- package/dist/ts4.2/src/room/track/TrackPublication.d.ts +3 -1
- package/dist/ts4.2/src/room/types.d.ts +8 -0
- package/dist/ts4.2/src/room/utils.d.ts +3 -1
- package/dist/ts4.2/src/version.d.ts +1 -1
- package/package.json +8 -8
- package/src/api/SignalClient.ts +3 -1
- package/src/index.ts +1 -1
- package/src/room/RTCEngine.ts +51 -10
- package/src/room/RegionUrlProvider.ts +5 -0
- package/src/room/Room.ts +29 -2
- package/src/room/events.ts +23 -0
- package/src/room/participant/Participant.ts +5 -1
- package/src/room/track/RemoteTrack.ts +16 -0
- package/src/room/track/Track.ts +9 -0
- package/src/room/track/TrackPublication.ts +3 -1
- package/src/room/types.ts +9 -0
- package/src/room/utils.ts +17 -2
- package/src/version.ts +1 -1
@@ -3321,10 +3321,8 @@ function normalizeFieldInfos(fieldInfos, packedByDefault) {
|
|
3321
3321
|
f.req = (_e = field.req) !== null && _e !== void 0 ? _e : false;
|
3322
3322
|
f.opt = (_f = field.opt) !== null && _f !== void 0 ? _f : false;
|
3323
3323
|
if (field.packed === undefined) {
|
3324
|
-
|
3324
|
+
{
|
3325
3325
|
f.packed = field.kind == "enum" || field.kind == "scalar" && field.T != ScalarType.BYTES && field.T != ScalarType.STRING;
|
3326
|
-
} else {
|
3327
|
-
f.packed = false;
|
3328
3326
|
}
|
3329
3327
|
}
|
3330
3328
|
// We do not surface options at this time
|
@@ -3359,7 +3357,7 @@ function normalizeFieldInfos(fieldInfos, packedByDefault) {
|
|
3359
3357
|
* Provides functionality for messages defined with the proto3 syntax.
|
3360
3358
|
*/
|
3361
3359
|
const proto3 = makeProtoRuntime("proto3", fields => {
|
3362
|
-
return new InternalFieldList(fields, source => normalizeFieldInfos(source
|
3360
|
+
return new InternalFieldList(fields, source => normalizeFieldInfos(source));
|
3363
3361
|
},
|
3364
3362
|
// TODO merge with proto2 and initExtensionField, also see initPartial, equals, clone
|
3365
3363
|
target => {
|
@@ -3951,6 +3949,12 @@ const TrackInfo = /*@__PURE__*/proto3.makeMessageType("livekit.TrackInfo", () =>
|
|
3951
3949
|
name: "version",
|
3952
3950
|
kind: "message",
|
3953
3951
|
T: TimedVersion
|
3952
|
+
}, {
|
3953
|
+
no: 19,
|
3954
|
+
name: "audio_features",
|
3955
|
+
kind: "enum",
|
3956
|
+
T: proto3.getEnumType(AudioTrackFeature),
|
3957
|
+
repeated: true
|
3954
3958
|
}]);
|
3955
3959
|
|
3956
3960
|
/**
|
@@ -4024,6 +4028,12 @@ const DataPacket = /*@__PURE__*/proto3.makeMessageType("livekit.DataPacket", ()
|
|
4024
4028
|
kind: "message",
|
4025
4029
|
T: SipDTMF,
|
4026
4030
|
oneof: "value"
|
4031
|
+
}, {
|
4032
|
+
no: 7,
|
4033
|
+
name: "transcription",
|
4034
|
+
kind: "message",
|
4035
|
+
T: Transcription,
|
4036
|
+
oneof: "value"
|
4027
4037
|
}]);
|
4028
4038
|
|
4029
4039
|
/**
|
@@ -4104,6 +4114,24 @@ const UserPacket = /*@__PURE__*/proto3.makeMessageType("livekit.UserPacket", ()
|
|
4104
4114
|
kind: "scalar",
|
4105
4115
|
T: 9 /* ScalarType.STRING */,
|
4106
4116
|
opt: true
|
4117
|
+
}, {
|
4118
|
+
no: 8,
|
4119
|
+
name: "id",
|
4120
|
+
kind: "scalar",
|
4121
|
+
T: 9 /* ScalarType.STRING */,
|
4122
|
+
opt: true
|
4123
|
+
}, {
|
4124
|
+
no: 9,
|
4125
|
+
name: "start_time",
|
4126
|
+
kind: "scalar",
|
4127
|
+
T: 4 /* ScalarType.UINT64 */,
|
4128
|
+
opt: true
|
4129
|
+
}, {
|
4130
|
+
no: 10,
|
4131
|
+
name: "end_time",
|
4132
|
+
kind: "scalar",
|
4133
|
+
T: 4 /* ScalarType.UINT64 */,
|
4134
|
+
opt: true
|
4107
4135
|
}]);
|
4108
4136
|
|
4109
4137
|
/**
|
@@ -4121,6 +4149,62 @@ const SipDTMF = /*@__PURE__*/proto3.makeMessageType("livekit.SipDTMF", () => [{
|
|
4121
4149
|
T: 9 /* ScalarType.STRING */
|
4122
4150
|
}]);
|
4123
4151
|
|
4152
|
+
/**
|
4153
|
+
* @generated from message livekit.Transcription
|
4154
|
+
*/
|
4155
|
+
const Transcription = /*@__PURE__*/proto3.makeMessageType("livekit.Transcription", () => [{
|
4156
|
+
no: 2,
|
4157
|
+
name: "participant_identity",
|
4158
|
+
kind: "scalar",
|
4159
|
+
T: 9 /* ScalarType.STRING */
|
4160
|
+
}, {
|
4161
|
+
no: 3,
|
4162
|
+
name: "track_id",
|
4163
|
+
kind: "scalar",
|
4164
|
+
T: 9 /* ScalarType.STRING */
|
4165
|
+
}, {
|
4166
|
+
no: 4,
|
4167
|
+
name: "segments",
|
4168
|
+
kind: "message",
|
4169
|
+
T: TranscriptionSegment,
|
4170
|
+
repeated: true
|
4171
|
+
}]);
|
4172
|
+
|
4173
|
+
/**
|
4174
|
+
* @generated from message livekit.TranscriptionSegment
|
4175
|
+
*/
|
4176
|
+
const TranscriptionSegment = /*@__PURE__*/proto3.makeMessageType("livekit.TranscriptionSegment", () => [{
|
4177
|
+
no: 1,
|
4178
|
+
name: "id",
|
4179
|
+
kind: "scalar",
|
4180
|
+
T: 9 /* ScalarType.STRING */
|
4181
|
+
}, {
|
4182
|
+
no: 2,
|
4183
|
+
name: "text",
|
4184
|
+
kind: "scalar",
|
4185
|
+
T: 9 /* ScalarType.STRING */
|
4186
|
+
}, {
|
4187
|
+
no: 3,
|
4188
|
+
name: "start_time",
|
4189
|
+
kind: "scalar",
|
4190
|
+
T: 4 /* ScalarType.UINT64 */
|
4191
|
+
}, {
|
4192
|
+
no: 4,
|
4193
|
+
name: "end_time",
|
4194
|
+
kind: "scalar",
|
4195
|
+
T: 4 /* ScalarType.UINT64 */
|
4196
|
+
}, {
|
4197
|
+
no: 5,
|
4198
|
+
name: "final",
|
4199
|
+
kind: "scalar",
|
4200
|
+
T: 8 /* ScalarType.BOOL */
|
4201
|
+
}, {
|
4202
|
+
no: 6,
|
4203
|
+
name: "language",
|
4204
|
+
kind: "scalar",
|
4205
|
+
T: 9 /* ScalarType.STRING */
|
4206
|
+
}]);
|
4207
|
+
|
4124
4208
|
/**
|
4125
4209
|
* @generated from message livekit.ParticipantTracks
|
4126
4210
|
*/
|
@@ -5052,6 +5136,7 @@ const LeaveRequest_Action = /*@__PURE__*/proto3.makeEnum("livekit.LeaveRequest.A
|
|
5052
5136
|
* message to indicate published video track dimensions are changing
|
5053
5137
|
*
|
5054
5138
|
* @generated from message livekit.UpdateVideoLayers
|
5139
|
+
* @deprecated
|
5055
5140
|
*/
|
5056
5141
|
const UpdateVideoLayers = /*@__PURE__*/proto3.makeMessageType("livekit.UpdateVideoLayers", () => [{
|
5057
5142
|
no: 1,
|
@@ -9949,6 +10034,11 @@ var RoomEvent;
|
|
9949
10034
|
* args: (payload: Uint8Array, participant: [[Participant]], kind: [[DataPacket_Kind]], topic?: string)
|
9950
10035
|
*/
|
9951
10036
|
RoomEvent["DataReceived"] = "dataReceived";
|
10037
|
+
/**
|
10038
|
+
* Transcription received from a participant's track.
|
10039
|
+
* @beta
|
10040
|
+
*/
|
10041
|
+
RoomEvent["TranscriptionReceived"] = "transcriptionReceived";
|
9952
10042
|
/**
|
9953
10043
|
* Connection quality was changed for a Participant. It'll receive updates
|
9954
10044
|
* from the local participant, as well as any [[RemoteParticipant]]s that we are
|
@@ -10130,6 +10220,11 @@ var ParticipantEvent;
|
|
10130
10220
|
* args: (payload: Uint8Array, kind: [[DataPacket_Kind]])
|
10131
10221
|
*/
|
10132
10222
|
ParticipantEvent["DataReceived"] = "dataReceived";
|
10223
|
+
/**
|
10224
|
+
* Transcription received from this participant as data source.
|
10225
|
+
* @beta
|
10226
|
+
*/
|
10227
|
+
ParticipantEvent["TranscriptionReceived"] = "transcriptionReceived";
|
10133
10228
|
/**
|
10134
10229
|
* Has speaking status changed for the current participant
|
10135
10230
|
*
|
@@ -10199,6 +10294,7 @@ var EngineEvent;
|
|
10199
10294
|
EngineEvent["MediaTrackAdded"] = "mediaTrackAdded";
|
10200
10295
|
EngineEvent["ActiveSpeakersUpdate"] = "activeSpeakersUpdate";
|
10201
10296
|
EngineEvent["DataPacketReceived"] = "dataPacketReceived";
|
10297
|
+
EngineEvent["TranscriptionReceived"] = "transcriptionReceived";
|
10202
10298
|
EngineEvent["RTPVideoMapUpdate"] = "rtpVideoMapUpdate";
|
10203
10299
|
EngineEvent["DCBufferStatusChanged"] = "dcBufferStatusChanged";
|
10204
10300
|
EngineEvent["ParticipantUpdate"] = "participantUpdate";
|
@@ -10281,6 +10377,14 @@ var TrackEvent;
|
|
10281
10377
|
* @internal
|
10282
10378
|
*/
|
10283
10379
|
TrackEvent["AudioTrackFeatureUpdate"] = "audioTrackFeatureUpdate";
|
10380
|
+
/**
|
10381
|
+
* @beta
|
10382
|
+
*/
|
10383
|
+
TrackEvent["TranscriptionReceived"] = "transcriptionReceived";
|
10384
|
+
/**
|
10385
|
+
* @experimental
|
10386
|
+
*/
|
10387
|
+
TrackEvent["TimeSyncUpdate"] = "timeSyncUpdate";
|
10284
10388
|
})(TrackEvent || (TrackEvent = {}));
|
10285
10389
|
|
10286
10390
|
function r(r, e, n) {
|
@@ -10395,10 +10499,10 @@ function getOSVersion(ua) {
|
|
10395
10499
|
return ua.includes('mac os') ? getMatch(/\(.+?(\d+_\d+(:?_\d+)?)/, ua, 1).replace(/_/g, '.') : undefined;
|
10396
10500
|
}
|
10397
10501
|
|
10398
|
-
var version$1 = "2.1.
|
10502
|
+
var version$1 = "2.1.3";
|
10399
10503
|
|
10400
10504
|
const version = version$1;
|
10401
|
-
const protocolVersion =
|
10505
|
+
const protocolVersion = 13;
|
10402
10506
|
|
10403
10507
|
/**
|
10404
10508
|
* Timers that can be overridden with platform specific implementations
|
@@ -10696,6 +10800,9 @@ class Track extends eventsExports.EventEmitter {
|
|
10696
10800
|
if (this.monitorInterval) {
|
10697
10801
|
clearInterval(this.monitorInterval);
|
10698
10802
|
}
|
10803
|
+
if (this.timeSyncHandle) {
|
10804
|
+
cancelAnimationFrame(this.timeSyncHandle);
|
10805
|
+
}
|
10699
10806
|
}
|
10700
10807
|
/** @internal */
|
10701
10808
|
updateLoggerOptions(loggerOptions) {
|
@@ -11500,6 +11607,26 @@ function toHttpUrl(url) {
|
|
11500
11607
|
}
|
11501
11608
|
return url;
|
11502
11609
|
}
|
11610
|
+
function extractTranscriptionSegments(transcription) {
|
11611
|
+
return transcription.segments.map(_ref => {
|
11612
|
+
let {
|
11613
|
+
id,
|
11614
|
+
text,
|
11615
|
+
language,
|
11616
|
+
startTime,
|
11617
|
+
endTime,
|
11618
|
+
final
|
11619
|
+
} = _ref;
|
11620
|
+
return {
|
11621
|
+
id,
|
11622
|
+
text,
|
11623
|
+
startTime: Number.parseInt(startTime.toString()),
|
11624
|
+
endTime: Number.parseInt(endTime.toString()),
|
11625
|
+
final,
|
11626
|
+
language
|
11627
|
+
};
|
11628
|
+
});
|
11629
|
+
}
|
11503
11630
|
|
11504
11631
|
const defaultId = 'default';
|
11505
11632
|
class DeviceManager {
|
@@ -12806,8 +12933,9 @@ class SignalClient {
|
|
12806
12933
|
return this.sendRequest({
|
12807
12934
|
case: 'leave',
|
12808
12935
|
value: new LeaveRequest({
|
12809
|
-
|
12810
|
-
|
12936
|
+
reason: DisconnectReason.CLIENT_INITIATED,
|
12937
|
+
// server doesn't process this field, keeping it here to indicate the intent of a full disconnect
|
12938
|
+
action: LeaveRequest_Action.DISCONNECT
|
12811
12939
|
})
|
12812
12940
|
});
|
12813
12941
|
}
|
@@ -15788,7 +15916,7 @@ class RTCEngine extends eventsExports.EventEmitter {
|
|
15788
15916
|
}();
|
15789
15917
|
});
|
15790
15918
|
this.handleDataMessage = message => __awaiter(this, void 0, void 0, function* () {
|
15791
|
-
var _c, _d;
|
15919
|
+
var _c, _d, _e;
|
15792
15920
|
// make sure to respect incoming data message order by processing message events one after the other
|
15793
15921
|
const unlock = yield this.dataProcessLock.lock();
|
15794
15922
|
try {
|
@@ -15810,6 +15938,8 @@ class RTCEngine extends eventsExports.EventEmitter {
|
|
15810
15938
|
this.emit(EngineEvent.ActiveSpeakersUpdate, dp.value.value.speakers);
|
15811
15939
|
} else if (((_d = dp.value) === null || _d === void 0 ? void 0 : _d.case) === 'user') {
|
15812
15940
|
this.emit(EngineEvent.DataPacketReceived, dp.value.value, dp.kind);
|
15941
|
+
} else if (((_e = dp.value) === null || _e === void 0 ? void 0 : _e.case) === 'transcription') {
|
15942
|
+
this.emit(EngineEvent.TranscriptionReceived, dp.value.value);
|
15813
15943
|
}
|
15814
15944
|
} finally {
|
15815
15945
|
unlock();
|
@@ -16094,7 +16224,7 @@ class RTCEngine extends eventsExports.EventEmitter {
|
|
16094
16224
|
}
|
16095
16225
|
configure(joinResponse) {
|
16096
16226
|
return __awaiter(this, void 0, void 0, function* () {
|
16097
|
-
var _a;
|
16227
|
+
var _a, _b;
|
16098
16228
|
// already configured
|
16099
16229
|
if (this.pcManager && this.pcManager.currentState !== PCTransportState.NEW) {
|
16100
16230
|
return;
|
@@ -16139,7 +16269,9 @@ class RTCEngine extends eventsExports.EventEmitter {
|
|
16139
16269
|
this.pcManager.onTrack = ev => {
|
16140
16270
|
this.emit(EngineEvent.MediaTrackAdded, ev.track, ev.streams[0], ev.receiver);
|
16141
16271
|
};
|
16142
|
-
|
16272
|
+
if (!supportOptionalDatachannel((_b = joinResponse.serverInfo) === null || _b === void 0 ? void 0 : _b.protocol)) {
|
16273
|
+
this.createDataChannels();
|
16274
|
+
}
|
16143
16275
|
});
|
16144
16276
|
}
|
16145
16277
|
setupSignalClientCallbacks() {
|
@@ -16206,17 +16338,27 @@ class RTCEngine extends eventsExports.EventEmitter {
|
|
16206
16338
|
this.handleDisconnect('signal', ReconnectReason.RR_SIGNAL_DISCONNECTED);
|
16207
16339
|
};
|
16208
16340
|
this.client.onLeave = leave => {
|
16209
|
-
if (leave === null || leave === void 0 ? void 0 : leave.canReconnect) {
|
16210
|
-
this.fullReconnectOnNext = true;
|
16211
|
-
// reconnect immediately instead of waiting for next attempt
|
16212
|
-
this.handleDisconnect(leaveReconnect);
|
16213
|
-
} else {
|
16214
|
-
this.emit(EngineEvent.Disconnected, leave === null || leave === void 0 ? void 0 : leave.reason);
|
16215
|
-
this.close();
|
16216
|
-
}
|
16217
16341
|
this.log.debug('client leave request', Object.assign(Object.assign({}, this.logContext), {
|
16218
16342
|
reason: leave === null || leave === void 0 ? void 0 : leave.reason
|
16219
16343
|
}));
|
16344
|
+
if (leave.regions && this.regionUrlProvider) {
|
16345
|
+
this.log.debug('updating regions', this.logContext);
|
16346
|
+
this.regionUrlProvider.setServerReportedRegions(leave.regions);
|
16347
|
+
}
|
16348
|
+
switch (leave.action) {
|
16349
|
+
case LeaveRequest_Action.DISCONNECT:
|
16350
|
+
this.emit(EngineEvent.Disconnected, leave === null || leave === void 0 ? void 0 : leave.reason);
|
16351
|
+
this.close();
|
16352
|
+
break;
|
16353
|
+
case LeaveRequest_Action.RECONNECT:
|
16354
|
+
this.fullReconnectOnNext = true;
|
16355
|
+
// reconnect immediately instead of waiting for next attempt
|
16356
|
+
this.handleDisconnect(leaveReconnect);
|
16357
|
+
break;
|
16358
|
+
case LeaveRequest_Action.RESUME:
|
16359
|
+
// reconnect immediately instead of waiting for next attempt
|
16360
|
+
this.handleDisconnect(leaveReconnect);
|
16361
|
+
}
|
16220
16362
|
};
|
16221
16363
|
}
|
16222
16364
|
makeRTCConfiguration(serverResponse) {
|
@@ -16600,7 +16742,15 @@ class RTCEngine extends eventsExports.EventEmitter {
|
|
16600
16742
|
if (!transport) {
|
16601
16743
|
throw new ConnectionError("".concat(transportName, " connection not set"));
|
16602
16744
|
}
|
16603
|
-
|
16745
|
+
let needNegotiation = false;
|
16746
|
+
if (!subscriber && !_this2.dataChannelForKind(kind, subscriber)) {
|
16747
|
+
_this2.createDataChannels();
|
16748
|
+
needNegotiation = true;
|
16749
|
+
}
|
16750
|
+
if (!needNegotiation && !subscriber && !_this2.pcManager.publisher.isICEConnected && _this2.pcManager.publisher.getICEConnectionState() !== 'checking') {
|
16751
|
+
needNegotiation = true;
|
16752
|
+
}
|
16753
|
+
if (needNegotiation) {
|
16604
16754
|
// start negotiation
|
16605
16755
|
_this2.negotiate();
|
16606
16756
|
}
|
@@ -16653,6 +16803,10 @@ class RTCEngine extends eventsExports.EventEmitter {
|
|
16653
16803
|
return;
|
16654
16804
|
}
|
16655
16805
|
this.pcManager.requirePublisher();
|
16806
|
+
// don't negotiate without any transceivers or data channel, it will generate sdp without ice frag then negotiate failed
|
16807
|
+
if (this.pcManager.publisher.getTransceivers().length == 0 && !this.lossyDC && !this.reliableDC) {
|
16808
|
+
this.createDataChannels();
|
16809
|
+
}
|
16656
16810
|
const abortController = new AbortController();
|
16657
16811
|
const handleClosed = () => {
|
16658
16812
|
abortController.abort();
|
@@ -16793,6 +16947,9 @@ class RTCEngine extends eventsExports.EventEmitter {
|
|
16793
16947
|
}
|
16794
16948
|
}
|
16795
16949
|
class SignalReconnectError extends Error {}
|
16950
|
+
function supportOptionalDatachannel(protocol) {
|
16951
|
+
return protocol !== undefined && protocol > 13;
|
16952
|
+
}
|
16796
16953
|
|
16797
16954
|
class RegionUrlProvider {
|
16798
16955
|
constructor(url, token) {
|
@@ -16851,6 +17008,10 @@ class RegionUrlProvider {
|
|
16851
17008
|
}
|
16852
17009
|
});
|
16853
17010
|
}
|
17011
|
+
setServerReportedRegions(regions) {
|
17012
|
+
this.regionSettings = regions;
|
17013
|
+
this.lastUpdateAt = Date.now();
|
17014
|
+
}
|
16854
17015
|
}
|
16855
17016
|
function getCloudConfigUrl(serverUrl) {
|
16856
17017
|
return "".concat(serverUrl.protocol.replace('ws', 'http'), "//").concat(serverUrl.host, "/settings");
|
@@ -16915,6 +17076,28 @@ class RemoteTrack extends Track {
|
|
16915
17076
|
if (!this.monitorInterval) {
|
16916
17077
|
this.monitorInterval = setInterval(() => this.monitorReceiver(), monitorFrequency);
|
16917
17078
|
}
|
17079
|
+
this.registerTimeSyncUpdate();
|
17080
|
+
}
|
17081
|
+
registerTimeSyncUpdate() {
|
17082
|
+
const loop = () => {
|
17083
|
+
var _a;
|
17084
|
+
this.timeSyncHandle = requestAnimationFrame(() => loop());
|
17085
|
+
const sources = (_a = this.receiver) === null || _a === void 0 ? void 0 : _a.getSynchronizationSources()[0];
|
17086
|
+
if (sources) {
|
17087
|
+
const {
|
17088
|
+
timestamp,
|
17089
|
+
rtpTimestamp
|
17090
|
+
} = sources;
|
17091
|
+
if (rtpTimestamp && this.rtpTimestamp !== rtpTimestamp) {
|
17092
|
+
this.emit(TrackEvent.TimeSyncUpdate, {
|
17093
|
+
timestamp,
|
17094
|
+
rtpTimestamp
|
17095
|
+
});
|
17096
|
+
this.rtpTimestamp = rtpTimestamp;
|
17097
|
+
}
|
17098
|
+
}
|
17099
|
+
};
|
17100
|
+
loop();
|
16918
17101
|
}
|
16919
17102
|
}
|
16920
17103
|
|
@@ -20006,6 +20189,16 @@ class Room extends eventsExports.EventEmitter {
|
|
20006
20189
|
// also emit on the participant
|
20007
20190
|
participant === null || participant === void 0 ? void 0 : participant.emit(ParticipantEvent.DataReceived, userPacket.payload, kind);
|
20008
20191
|
};
|
20192
|
+
this.bufferedSegments = new Map();
|
20193
|
+
this.handleTranscription = transcription => {
|
20194
|
+
// find the participant
|
20195
|
+
const participant = transcription.participantIdentity === this.localParticipant.identity ? this.localParticipant : this.remoteParticipants.get(transcription.participantIdentity);
|
20196
|
+
const publication = participant === null || participant === void 0 ? void 0 : participant.trackPublications.get(transcription.trackId);
|
20197
|
+
const segments = extractTranscriptionSegments(transcription);
|
20198
|
+
publication === null || publication === void 0 ? void 0 : publication.emit(TrackEvent.TranscriptionReceived, segments);
|
20199
|
+
participant === null || participant === void 0 ? void 0 : participant.emit(ParticipantEvent.TranscriptionReceived, segments, publication);
|
20200
|
+
this.emit(RoomEvent.TranscriptionReceived, segments, participant, publication);
|
20201
|
+
};
|
20009
20202
|
this.handleAudioPlaybackStarted = () => {
|
20010
20203
|
if (this.canPlaybackAudio) {
|
20011
20204
|
return;
|
@@ -20231,7 +20424,7 @@ class Room extends eventsExports.EventEmitter {
|
|
20231
20424
|
this.onTrackAdded(mediaTrack, stream, receiver);
|
20232
20425
|
}).on(EngineEvent.Disconnected, reason => {
|
20233
20426
|
this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, reason);
|
20234
|
-
}).on(EngineEvent.ActiveSpeakersUpdate, this.handleActiveSpeakersUpdate).on(EngineEvent.DataPacketReceived, this.handleDataPacket).on(EngineEvent.Resuming, () => {
|
20427
|
+
}).on(EngineEvent.ActiveSpeakersUpdate, this.handleActiveSpeakersUpdate).on(EngineEvent.DataPacketReceived, this.handleDataPacket).on(EngineEvent.TranscriptionReceived, this.handleTranscription).on(EngineEvent.Resuming, () => {
|
20235
20428
|
this.clearConnectionReconcile();
|
20236
20429
|
this.isResuming = true;
|
20237
20430
|
this.log.info('Resuming signal connection', this.logContext);
|
@@ -20417,7 +20610,7 @@ class Room extends eventsExports.EventEmitter {
|
|
20417
20610
|
if (onLeave) {
|
20418
20611
|
onLeave(new LeaveRequest({
|
20419
20612
|
reason: DisconnectReason.CLIENT_INITIATED,
|
20420
|
-
|
20613
|
+
action: LeaveRequest_Action.RECONNECT
|
20421
20614
|
}));
|
20422
20615
|
}
|
20423
20616
|
});
|