livekit-client
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -36,3 +36,3 @@ import { DataPacket_Kind, DisconnectReason, SubscriptionError } from '@livekit/protocol'; | ||
export * from './room/track/types'; | ||
export type { DataPublishOptions, SimulationScenario } from './room/types'; | ||
export type { DataPublishOptions, SimulationScenario, TranscriptionSegment } from './room/types'; | ||
export * from './version'; | ||
@@ -39,0 +39,0 @@ export { ConnectionQuality, ConnectionState, CriticalTimers, DataPacket_Kind, DefaultReconnectPolicy, DisconnectReason, LocalAudioTrack, LocalParticipant, LocalTrack, LocalTrackPublication, LocalVideoTrack, LogLevel, LoggerNames, Participant, RemoteAudioTrack, RemoteParticipant, RemoteTrack, RemoteTrackPublication, RemoteVideoTrack, Room, SubscriptionError, TrackPublication, createAudioAnalyser, getBrowser, getEmptyAudioStreamTrack, getEmptyVideoStreamTrack, getLogger, isBrowserSupported, setLogExtension, setLogLevel, supportsAV1, supportsAdaptiveStream, supportsDynacast, supportsVP9, Mutex, }; |
@@ -177,2 +177,7 @@ /** | ||
/** | ||
* Transcription received from a participant's track. | ||
* @beta | ||
*/ | ||
TranscriptionReceived = "transcriptionReceived", | ||
/** | ||
* Connection quality was changed for a Participant. It'll receive updates | ||
@@ -358,2 +363,7 @@ * from the local participant, as well as any [[RemoteParticipant]]s that we are | ||
/** | ||
* Transcription received from this participant as data source. | ||
* @beta | ||
*/ | ||
TranscriptionReceived = "transcriptionReceived", | ||
/** | ||
* Has speaking status changed for the current participant | ||
@@ -424,2 +434,3 @@ * | ||
DataPacketReceived = "dataPacketReceived", | ||
TranscriptionReceived = "transcriptionReceived", | ||
RTPVideoMapUpdate = "rtpVideoMapUpdate", | ||
@@ -505,4 +516,12 @@ DCBufferStatusChanged = "dcBufferStatusChanged", | ||
*/ | ||
AudioTrackFeatureUpdate = "audioTrackFeatureUpdate" | ||
AudioTrackFeatureUpdate = "audioTrackFeatureUpdate", | ||
/** | ||
* @beta | ||
*/ | ||
TranscriptionReceived = "transcriptionReceived", | ||
/** | ||
* @experimental | ||
*/ | ||
TimeSyncUpdate = "timeSyncUpdate" | ||
} | ||
//# sourceMappingURL=events.d.ts.map |
@@ -9,3 +9,3 @@ import { DataPacket_Kind, ParticipantInfo, ParticipantPermission, ConnectionQuality as ProtoQuality, SubscriptionError } from '@livekit/protocol'; | ||
import type { TrackPublication } from '../track/TrackPublication'; | ||
import type { LoggerOptions } from '../types'; | ||
import type { LoggerOptions, TranscriptionSegment } from '../types'; | ||
export declare enum ConnectionQuality { | ||
@@ -103,2 +103,3 @@ Excellent = "excellent", | ||
dataReceived: (payload: Uint8Array, kind: DataPacket_Kind) => void; | ||
transcriptionReceived: (transcription: TranscriptionSegment[], publication?: TrackPublication) => void; | ||
isSpeakingChanged: (speaking: boolean) => void; | ||
@@ -105,0 +106,0 @@ connectionQualityChanged: (connectionQuality: ConnectionQuality) => void; |
@@ -1,2 +0,2 @@ | ||
import { DataPacket_Kind, DisconnectReason, ParticipantPermission, SubscriptionError } from '@livekit/protocol'; | ||
import { DataPacket_Kind, DisconnectReason, ParticipantPermission, SubscriptionError, TranscriptionSegment as TranscriptionSegmentModel } from '@livekit/protocol'; | ||
import type TypedEmitter from 'typed-emitter'; | ||
@@ -15,3 +15,3 @@ import 'webrtc-adapter'; | ||
import type { TrackPublication } from './track/TrackPublication'; | ||
import type { SimulationOptions, SimulationScenario } from './types'; | ||
import type { SimulationOptions, SimulationScenario, TranscriptionSegment } from './types'; | ||
export declare enum ConnectionState { | ||
@@ -179,2 +179,4 @@ Disconnected = "disconnected", | ||
private handleDataPacket; | ||
bufferedSegments: Map<string, TranscriptionSegmentModel>; | ||
private handleTranscription; | ||
private handleAudioPlaybackStarted; | ||
@@ -246,2 +248,3 @@ private handleAudioPlaybackFailed; | ||
dataReceived: (payload: Uint8Array, participant?: RemoteParticipant, kind?: DataPacket_Kind, topic?: string) => void; | ||
transcriptionReceived: (transcription: TranscriptionSegment[], participant?: Participant, publication?: TrackPublication) => void; | ||
connectionQualityChanged: (quality: ConnectionQuality, participant: Participant) => void; | ||
@@ -248,0 +251,0 @@ mediaDevicesError: (error: Error) => void; |
@@ -1,2 +0,2 @@ | ||
import { type AddTrackRequest, type ConnectionQualityUpdate, DataPacket, DataPacket_Kind, DisconnectReason, type JoinResponse, ParticipantInfo, Room as RoomModel, SpeakerInfo, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackInfo, TrackUnpublishedResponse, UserPacket } from '@livekit/protocol'; | ||
import { type AddTrackRequest, type ConnectionQualityUpdate, DataPacket, DataPacket_Kind, DisconnectReason, type JoinResponse, ParticipantInfo, Room as RoomModel, SpeakerInfo, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackInfo, TrackUnpublishedResponse, Transcription, UserPacket } from '@livekit/protocol'; | ||
import type TypedEventEmitter from 'typed-emitter'; | ||
@@ -141,2 +141,3 @@ import type { SignalOptions } from '../api/SignalClient'; | ||
dataPacketReceived: (userPacket: UserPacket, kind: DataPacket_Kind) => void; | ||
transcriptionReceived: (transcription: Transcription) => void; | ||
transportsCreated: (publisher: PCTransport, subscriber: PCTransport) => void; | ||
@@ -143,0 +144,0 @@ /** @internal */ |
@@ -22,3 +22,4 @@ import type { LoggerOptions } from '../types'; | ||
protected abstract monitorReceiver(): void; | ||
registerTimeSyncUpdate(): void; | ||
} | ||
//# sourceMappingURL=RemoteTrack.d.ts.map |
@@ -31,2 +31,4 @@ import { AudioTrackFeature, StreamState as ProtoStreamState, TrackSource, TrackType } from '@livekit/protocol'; | ||
streamState: Track.StreamState; | ||
/** @internal */ | ||
rtpTimestamp: number | undefined; | ||
protected _mediaStreamTrack: MediaStreamTrack; | ||
@@ -37,2 +39,3 @@ protected _mediaStreamID: string; | ||
private loggerContextCb; | ||
protected timeSyncHandle: number | undefined; | ||
protected _currentBitrate: number; | ||
@@ -142,4 +145,5 @@ protected monitorInterval?: ReturnType<typeof setInterval>; | ||
audioTrackFeatureUpdate: (track: any, feature: AudioTrackFeature, enabled: boolean) => void; | ||
timeSyncUpdate: (timestamp: number) => void; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=Track.d.ts.map |
import { Encryption_Type } from '@livekit/protocol'; | ||
import type { SubscriptionError, TrackInfo, UpdateSubscription, UpdateTrackSettings } from '@livekit/protocol'; | ||
import type TypedEventEmitter from 'typed-emitter'; | ||
import type { LoggerOptions } from '../types'; | ||
import type { LoggerOptions, TranscriptionSegment } from '../types'; | ||
import LocalAudioTrack from './LocalAudioTrack'; | ||
@@ -75,4 +75,6 @@ import LocalVideoTrack from './LocalVideoTrack'; | ||
subscriptionFailed: (error: SubscriptionError) => void; | ||
transcriptionReceived: (transcription: TranscriptionSegment[]) => void; | ||
timeSyncUpdate: (timestamp: number) => void; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=TrackPublication.d.ts.map |
@@ -38,2 +38,10 @@ export type SimulationOptions = { | ||
}; | ||
export interface TranscriptionSegment { | ||
id: string; | ||
text: string; | ||
language: string; | ||
startTime: number; | ||
endTime: number; | ||
final: boolean; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
@@ -1,5 +0,6 @@ | ||
import { ClientInfo } from '@livekit/protocol'; | ||
import { ClientInfo, Transcription as TranscriptionModel } from '@livekit/protocol'; | ||
import type LocalAudioTrack from './track/LocalAudioTrack'; | ||
import type RemoteAudioTrack from './track/RemoteAudioTrack'; | ||
import { VideoCodec } from './track/options'; | ||
import type { TranscriptionSegment } from './types'; | ||
export declare const ddExtensionURI = "https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension"; | ||
@@ -96,2 +97,3 @@ export declare function unpackStreamId(packed: string): string[]; | ||
export declare function toHttpUrl(url: string): string; | ||
export declare function extractTranscriptionSegments(transcription: TranscriptionModel): TranscriptionSegment[]; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -36,3 +36,3 @@ import { DataPacket_Kind, DisconnectReason, SubscriptionError } from '@livekit/protocol'; | ||
export * from './room/track/types'; | ||
export type { DataPublishOptions, SimulationScenario } from './room/types'; | ||
export type { DataPublishOptions, SimulationScenario, TranscriptionSegment } from './room/types'; | ||
export * from './version'; | ||
@@ -39,0 +39,0 @@ export { ConnectionQuality, ConnectionState, CriticalTimers, DataPacket_Kind, DefaultReconnectPolicy, DisconnectReason, LocalAudioTrack, LocalParticipant, LocalTrack, LocalTrackPublication, LocalVideoTrack, LogLevel, LoggerNames, Participant, RemoteAudioTrack, RemoteParticipant, RemoteTrack, RemoteTrackPublication, RemoteVideoTrack, Room, SubscriptionError, TrackPublication, createAudioAnalyser, getBrowser, getEmptyAudioStreamTrack, getEmptyVideoStreamTrack, getLogger, isBrowserSupported, setLogExtension, setLogLevel, supportsAV1, supportsAdaptiveStream, supportsDynacast, supportsVP9, Mutex, }; |
@@ -177,2 +177,7 @@ /** | ||
/** | ||
* Transcription received from a participant's track. | ||
* @beta | ||
*/ | ||
TranscriptionReceived = "transcriptionReceived", | ||
/** | ||
* Connection quality was changed for a Participant. It'll receive updates | ||
@@ -358,2 +363,7 @@ * from the local participant, as well as any [[RemoteParticipant]]s that we are | ||
/** | ||
* Transcription received from this participant as data source. | ||
* @beta | ||
*/ | ||
TranscriptionReceived = "transcriptionReceived", | ||
/** | ||
* Has speaking status changed for the current participant | ||
@@ -424,2 +434,3 @@ * | ||
DataPacketReceived = "dataPacketReceived", | ||
TranscriptionReceived = "transcriptionReceived", | ||
RTPVideoMapUpdate = "rtpVideoMapUpdate", | ||
@@ -505,4 +516,12 @@ DCBufferStatusChanged = "dcBufferStatusChanged", | ||
*/ | ||
AudioTrackFeatureUpdate = "audioTrackFeatureUpdate" | ||
AudioTrackFeatureUpdate = "audioTrackFeatureUpdate", | ||
/** | ||
* @beta | ||
*/ | ||
TranscriptionReceived = "transcriptionReceived", | ||
/** | ||
* @experimental | ||
*/ | ||
TimeSyncUpdate = "timeSyncUpdate" | ||
} | ||
//# sourceMappingURL=events.d.ts.map |
@@ -9,3 +9,3 @@ import { DataPacket_Kind, ParticipantInfo, ParticipantPermission, ConnectionQuality as ProtoQuality, SubscriptionError } from '@livekit/protocol'; | ||
import type { TrackPublication } from '../track/TrackPublication'; | ||
import type { LoggerOptions } from '../types'; | ||
import type { LoggerOptions, TranscriptionSegment } from '../types'; | ||
export declare enum ConnectionQuality { | ||
@@ -103,2 +103,3 @@ Excellent = "excellent", | ||
dataReceived: (payload: Uint8Array, kind: DataPacket_Kind) => void; | ||
transcriptionReceived: (transcription: TranscriptionSegment[], publication?: TrackPublication) => void; | ||
isSpeakingChanged: (speaking: boolean) => void; | ||
@@ -105,0 +106,0 @@ connectionQualityChanged: (connectionQuality: ConnectionQuality) => void; |
@@ -1,2 +0,2 @@ | ||
import { DataPacket_Kind, DisconnectReason, ParticipantPermission, SubscriptionError } from '@livekit/protocol'; | ||
import { DataPacket_Kind, DisconnectReason, ParticipantPermission, SubscriptionError, TranscriptionSegment as TranscriptionSegmentModel } from '@livekit/protocol'; | ||
import type TypedEmitter from 'typed-emitter'; | ||
@@ -15,3 +15,3 @@ import 'webrtc-adapter'; | ||
import type { TrackPublication } from './track/TrackPublication'; | ||
import type { SimulationOptions, SimulationScenario } from './types'; | ||
import type { SimulationOptions, SimulationScenario, TranscriptionSegment } from './types'; | ||
export declare enum ConnectionState { | ||
@@ -179,2 +179,4 @@ Disconnected = "disconnected", | ||
private handleDataPacket; | ||
bufferedSegments: Map<string, TranscriptionSegmentModel>; | ||
private handleTranscription; | ||
private handleAudioPlaybackStarted; | ||
@@ -246,2 +248,3 @@ private handleAudioPlaybackFailed; | ||
dataReceived: (payload: Uint8Array, participant?: RemoteParticipant, kind?: DataPacket_Kind, topic?: string) => void; | ||
transcriptionReceived: (transcription: TranscriptionSegment[], participant?: Participant, publication?: TrackPublication) => void; | ||
connectionQualityChanged: (quality: ConnectionQuality, participant: Participant) => void; | ||
@@ -248,0 +251,0 @@ mediaDevicesError: (error: Error) => void; |
import type { AddTrackRequest, ConnectionQualityUpdate, JoinResponse, StreamStateUpdate, SubscriptionPermissionUpdate, SubscriptionResponse } from '@livekit/protocol'; | ||
import { DataPacket, DataPacket_Kind, DisconnectReason, ParticipantInfo, Room as RoomModel, SpeakerInfo, SubscribedQualityUpdate, TrackInfo, TrackUnpublishedResponse, UserPacket } from '@livekit/protocol'; | ||
import { DataPacket, DataPacket_Kind, DisconnectReason, ParticipantInfo, Room as RoomModel, SpeakerInfo, SubscribedQualityUpdate, TrackInfo, TrackUnpublishedResponse, Transcription, UserPacket } from '@livekit/protocol'; | ||
import type TypedEventEmitter from 'typed-emitter'; | ||
@@ -142,2 +142,3 @@ import type { SignalOptions } from '../api/SignalClient'; | ||
dataPacketReceived: (userPacket: UserPacket, kind: DataPacket_Kind) => void; | ||
transcriptionReceived: (transcription: Transcription) => void; | ||
transportsCreated: (publisher: PCTransport, subscriber: PCTransport) => void; | ||
@@ -144,0 +145,0 @@ /** @internal */ |
@@ -22,3 +22,4 @@ import type { LoggerOptions } from '../types'; | ||
protected abstract monitorReceiver(): void; | ||
registerTimeSyncUpdate(): void; | ||
} | ||
//# sourceMappingURL=RemoteTrack.d.ts.map |
@@ -31,2 +31,4 @@ import { AudioTrackFeature, StreamState as ProtoStreamState, TrackSource, TrackType } from '@livekit/protocol'; | ||
streamState: Track.StreamState; | ||
/** @internal */ | ||
rtpTimestamp: number | undefined; | ||
protected _mediaStreamTrack: MediaStreamTrack; | ||
@@ -37,2 +39,3 @@ protected _mediaStreamID: string; | ||
private loggerContextCb; | ||
protected timeSyncHandle: number | undefined; | ||
protected _currentBitrate: number; | ||
@@ -142,4 +145,5 @@ protected monitorInterval?: ReturnType<typeof setInterval>; | ||
audioTrackFeatureUpdate: (track: any, feature: AudioTrackFeature, enabled: boolean) => void; | ||
timeSyncUpdate: (timestamp: number) => void; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=Track.d.ts.map |
import { Encryption_Type } from '@livekit/protocol'; | ||
import type { SubscriptionError, TrackInfo, UpdateSubscription, UpdateTrackSettings } from '@livekit/protocol'; | ||
import type TypedEventEmitter from 'typed-emitter'; | ||
import type { LoggerOptions } from '../types'; | ||
import type { LoggerOptions, TranscriptionSegment } from '../types'; | ||
import LocalAudioTrack from './LocalAudioTrack'; | ||
@@ -75,4 +75,6 @@ import LocalVideoTrack from './LocalVideoTrack'; | ||
subscriptionFailed: (error: SubscriptionError) => void; | ||
transcriptionReceived: (transcription: TranscriptionSegment[]) => void; | ||
timeSyncUpdate: (timestamp: number) => void; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=TrackPublication.d.ts.map |
@@ -38,2 +38,10 @@ export type SimulationOptions = { | ||
}; | ||
export interface TranscriptionSegment { | ||
id: string; | ||
text: string; | ||
language: string; | ||
startTime: number; | ||
endTime: number; | ||
final: boolean; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
@@ -1,5 +0,6 @@ | ||
import { ClientInfo } from '@livekit/protocol'; | ||
import { ClientInfo, Transcription as TranscriptionModel } from '@livekit/protocol'; | ||
import type LocalAudioTrack from './track/LocalAudioTrack'; | ||
import type RemoteAudioTrack from './track/RemoteAudioTrack'; | ||
import { VideoCodec } from './track/options'; | ||
import type { TranscriptionSegment } from './types'; | ||
export declare const ddExtensionURI = "https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension"; | ||
@@ -96,2 +97,3 @@ export declare function unpackStreamId(packed: string): string[]; | ||
export declare function toHttpUrl(url: string): string; | ||
export declare function extractTranscriptionSegments(transcription: TranscriptionModel): TranscriptionSegment[]; | ||
//# sourceMappingURL=utils.d.ts.map |
{ | ||
"name": "livekit-client", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "JavaScript/TypeScript client SDK for LiveKit", | ||
@@ -39,3 +39,3 @@ "main": "./dist/livekit-client.umd.js", | ||
"dependencies": { | ||
"@livekit/protocol": "1.13.0", | ||
"@livekit/protocol": "1.15.0", | ||
"events": "^3.3.0", | ||
@@ -50,4 +50,4 @@ "loglevel": "^1.8.0", | ||
"devDependencies": { | ||
"@babel/core": "7.24.4", | ||
"@babel/preset-env": "7.24.4", | ||
"@babel/core": "7.24.5", | ||
"@babel/preset-env": "7.24.5", | ||
"@bufbuild/protoc-gen-es": "^1.3.0", | ||
@@ -78,3 +78,3 @@ "@changesets/cli": "2.27.1", | ||
"prettier": "^3.0.0", | ||
"rollup": "4.14.0", | ||
"rollup": "4.17.2", | ||
"rollup-plugin-delete": "^2.0.0", | ||
@@ -84,6 +84,6 @@ "rollup-plugin-re": "1.0.7", | ||
"size-limit": "^8.2.4", | ||
"typedoc": "0.25.12", | ||
"typedoc": "0.25.13", | ||
"typedoc-plugin-no-inherit": "1.4.0", | ||
"typescript": "5.4.3", | ||
"vite": "5.0.13", | ||
"typescript": "5.4.5", | ||
"vite": "5.2.10", | ||
"vitest": "^1.0.0" | ||
@@ -90,0 +90,0 @@ }, |
@@ -47,3 +47,3 @@ import { DataPacket_Kind, DisconnectReason, SubscriptionError } from '@livekit/protocol'; | ||
export * from './room/track/types'; | ||
export type { DataPublishOptions, SimulationScenario } from './room/types'; | ||
export type { DataPublishOptions, SimulationScenario, TranscriptionSegment } from './room/types'; | ||
export * from './version'; | ||
@@ -50,0 +50,0 @@ export { |
@@ -201,2 +201,8 @@ /** | ||
/** | ||
* Transcription received from a participant's track. | ||
* @beta | ||
*/ | ||
TranscriptionReceived = 'transcriptionReceived', | ||
/** | ||
* Connection quality was changed for a Participant. It'll receive updates | ||
@@ -407,2 +413,8 @@ * from the local participant, as well as any [[RemoteParticipant]]s that we are | ||
/** | ||
* Transcription received from this participant as data source. | ||
* @beta | ||
*/ | ||
TranscriptionReceived = 'transcriptionReceived', | ||
/** | ||
* Has speaking status changed for the current participant | ||
@@ -484,2 +496,3 @@ * | ||
DataPacketReceived = 'dataPacketReceived', | ||
TranscriptionReceived = 'transcriptionReceived', | ||
RTPVideoMapUpdate = 'rtpVideoMapUpdate', | ||
@@ -568,2 +581,12 @@ DCBufferStatusChanged = 'dcBufferStatusChanged', | ||
AudioTrackFeatureUpdate = 'audioTrackFeatureUpdate', | ||
/** | ||
* @beta | ||
*/ | ||
TranscriptionReceived = 'transcriptionReceived', | ||
/** | ||
* @experimental | ||
*/ | ||
TimeSyncUpdate = 'timeSyncUpdate', | ||
} |
@@ -19,3 +19,3 @@ import { | ||
import type { TrackPublication } from '../track/TrackPublication'; | ||
import type { LoggerOptions } from '../types'; | ||
import type { LoggerOptions, TranscriptionSegment } from '../types'; | ||
@@ -333,2 +333,6 @@ export enum ConnectionQuality { | ||
dataReceived: (payload: Uint8Array, kind: DataPacket_Kind) => void; | ||
transcriptionReceived: ( | ||
transcription: TranscriptionSegment[], | ||
publication?: TrackPublication, | ||
) => void; | ||
isSpeakingChanged: (speaking: boolean) => void; | ||
@@ -335,0 +339,0 @@ connectionQualityChanged: (connectionQuality: ConnectionQuality) => void; |
@@ -26,2 +26,3 @@ import { | ||
TrackUnpublishedResponse, | ||
Transcription, | ||
UpdateSubscription, | ||
@@ -638,2 +639,4 @@ UserPacket, | ||
this.emit(EngineEvent.DataPacketReceived, dp.value.value, dp.kind); | ||
} else if (dp.value?.case === 'transcription') { | ||
this.emit(EngineEvent.TranscriptionReceived, dp.value.value); | ||
} | ||
@@ -1362,2 +1365,3 @@ } finally { | ||
dataPacketReceived: (userPacket: UserPacket, kind: DataPacket_Kind) => void; | ||
transcriptionReceived: (transcription: Transcription) => void; | ||
transportsCreated: (publisher: PCTransport, subscriber: PCTransport) => void; | ||
@@ -1364,0 +1368,0 @@ /** @internal */ |
@@ -80,5 +80,18 @@ import { TrackEvent } from '../events'; | ||
} | ||
this.registerTimeSyncUpdate(); | ||
} | ||
protected abstract monitorReceiver(): void; | ||
registerTimeSyncUpdate() { | ||
const loop = () => { | ||
this.timeSyncHandle = requestAnimationFrame(() => loop()); | ||
const newTime = this.receiver?.getSynchronizationSources()[0]?.rtpTimestamp; | ||
if (newTime && this.rtpTimestamp !== newTime) { | ||
this.emit(TrackEvent.TimeSyncUpdate, newTime); | ||
this.rtpTimestamp = newTime; | ||
} | ||
}; | ||
loop(); | ||
} | ||
} |
@@ -56,2 +56,5 @@ import { | ||
/** @internal */ | ||
rtpTimestamp: number | undefined; | ||
protected _mediaStreamTrack: MediaStreamTrack; | ||
@@ -67,2 +70,4 @@ | ||
protected timeSyncHandle: number | undefined; | ||
protected _currentBitrate: number = 0; | ||
@@ -260,2 +265,5 @@ | ||
} | ||
if (this.timeSyncHandle) { | ||
cancelAnimationFrame(this.timeSyncHandle); | ||
} | ||
} | ||
@@ -523,2 +531,3 @@ | ||
audioTrackFeatureUpdate: (track: any, feature: AudioTrackFeature, enabled: boolean) => void; | ||
timeSyncUpdate: (timestamp: number) => void; | ||
}; |
@@ -12,3 +12,3 @@ import { Encryption_Type } from '@livekit/protocol'; | ||
import { TrackEvent } from '../events'; | ||
import type { LoggerOptions } from '../types'; | ||
import type { LoggerOptions, TranscriptionSegment } from '../types'; | ||
import LocalAudioTrack from './LocalAudioTrack'; | ||
@@ -178,2 +178,4 @@ import LocalVideoTrack from './LocalVideoTrack'; | ||
subscriptionFailed: (error: SubscriptionError) => void; | ||
transcriptionReceived: (transcription: TranscriptionSegment[]) => void; | ||
timeSyncUpdate: (timestamp: number) => void; | ||
}; |
@@ -58,1 +58,10 @@ export type SimulationOptions = { | ||
}; | ||
export interface TranscriptionSegment { | ||
id: string; | ||
text: string; | ||
language: string; | ||
startTime: number; | ||
endTime: number; | ||
final: boolean; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { ClientInfo, ClientInfo_SDK } from '@livekit/protocol'; | ||
import { ClientInfo, ClientInfo_SDK, Transcription as TranscriptionModel } from '@livekit/protocol'; | ||
import { getBrowser } from '../utils/browserParser'; | ||
@@ -9,3 +9,3 @@ import { protocolVersion, version } from '../version'; | ||
import { getNewAudioContext } from './track/utils'; | ||
import type { LiveKitReactNativeInfo } from './types'; | ||
import type { LiveKitReactNativeInfo, TranscriptionSegment } from './types'; | ||
@@ -531,1 +531,16 @@ const separator = '|'; | ||
} | ||
export function extractTranscriptionSegments( | ||
transcription: TranscriptionModel, | ||
): TranscriptionSegment[] { | ||
return transcription.segments.map(({ id, text, language, startTime, endTime, final }) => { | ||
return { | ||
id, | ||
text, | ||
startTime: Number.parseInt(startTime.toString()), | ||
endTime: Number.parseInt(endTime.toString()), | ||
final, | ||
language, | ||
}; | ||
}); | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
5453706
48776
+ Added@livekit/protocol@1.15.0(transitive)
- Removed@livekit/protocol@1.13.0(transitive)
Updated@livekit/protocol@1.15.0