Repository navigation
Releases
livekit-client 2.25.0
Minor Changes
- Rebuild transcription events from
lk.transcriptiondata streams and advertise client protocol 3 - #2093 (@1egoman)
Patch Changes
- Retransmit lost audio in single peer connection mode when RED is off, for example with E2EE. - #2270 (@jamesdawsonWD)
- Await
AudioContext.setSinkId()when switching the audio output withwebAudioMixenabled, so the switch only resolves (and emitsActiveDeviceChanged) once routing succeeds, and routing failures reject instead of becoming unhandled rejections - #2276 (@1egoman) - Deprecate the
TranscriptionReceivedroom, participant and track events and theTranscriptionSegmenttype in favor of a text stream handler for thelk.transcriptiontopic - #2093 (@1egoman) - Room events emitted right after a reconnect are no longer held back. The room went back to
Connectedand emittedReconnectedwhile the engine still reported a pending reconnect until its attempt settled, so events such asRoomMetadataChangedorActiveSpeakersChangedsent in that window were buffered and never emitted. - #2186 (@ANDROIDHASSAN) - Keep the last transceiver of the publisher connection when you unpublish its track. A stop of the only transceiver made the browser drop the transport of the connection, and the next publish sent no media. - #2282 (@lukasIO)
- Keep the last audio transceiver and the last video transceiver of the publisher connection when you unpublish their tracks. After a stop of all transceivers, some browsers gave the next track new header extension ids, and the publish failed. - #2284 (@lukasIO)
- Reject with a
TrackInvalidErrorfor a track stopped during a processor restart orsetProcessor()- #2280 (@lukasIO) - Stop the transceivers of a track when you unpublish it or when the server rejects its publish. Chrome then frees their encoders (about 95 MB per screen share) before the room disconnects. This needs a server with protocol 19 or higher; with an older server the transceivers stay inactive as before. - #2249 (@lukasIO)
- Add internal
setWrapperSdkInfoso SDKs built on top of livekit-client (e.g. Unity WebGL) report their own SDK and version inClientInfo, with livekit-client's version inother_sdks- #2265 (@MaxHeimbrock)
v2.24.1
Patch Changes
-
Stop re-sending the whole keyring to the E2EE worker on each
enableacknowledgement, which made the worker re-derive every key once per remote publication and delayed new keys behind that work. OnSignalConnected, only post the keys the worker has not received yet. Log the per-frame missing key warning only when the throttledMissingKeyerror is emitted. - #2250 (@facupedrazzini) -
Fix connecting on browsers without
Object.hasOwnorWeakRef(Safari before 15.4) - #2258 (@lukasIO) -
Report
REACT_NATIVEas the SDK in the v1 join request'sClientInfo, matching thesdk=reactnativequery param sent on the v0 signal path - #2262 (@MaxHeimbrock) -
Guard
instanceof Eventin the signal connect abort handler so React Native (no globalEvent) can still time out a hanging signal dial instead of throwingReferenceError. - #2224 (@ninglinLiu) -
performRpcnow rejects with the newCONNECTION_CLOSED(1506) error when the local participant disconnects from the room. Previously a pending call stayed pending until itsresponseTimeout, then rejected withRESPONSE_TIMEOUT. - #2251 (@u9g)
v2.24.0
Minor Changes
-
Create the publisher data channels as negotiated (fixed IDs) in single peer connection mode when the server supports it (protocol 18), saving the data channel open round trip. Falls back to in-band channels against older servers. - #2160 (@lukasIO)
-
Split
RoomintoCoreRoomplus extensions.createRoom(options, [extensions])fromlivekit-client/corebuilds a room with only the extensions an application needs;e2ee,frameMetadataanddataStreamstake their options directly.Room.dispose()releases a room for good. Video publishing (camera, screen share, simulcast, SVC, backup codecs) is thevideoextension; receiving video stays in core. The newlivekit-client/coreentry (ESM only, experimental) exportsCoreRoomand the extensions.simulateParticipantsand the legacy chat messages are extensions too; the core entry does not offer legacy chat. - #2141 (@lukasIO)
Patch Changes
-
If the server disconnects the participant while
room.connect()is still waiting for the transports (e.g. aDUPLICATE_IDENTITYleave), the connection attempt is now cancelled. Previously it kept waiting untilpeerConnectionTimeout, then failed over to another region and rejoined with the same token after the room had already emittedDisconnected;room.disconnect()could not stop it because the room already looked disconnected. - #2177 (@tobelesa) -
Cancel an incoming data stream when its reader stops early (an aborted
signal, abreakout offor await, or a read error), so the stream is unregistered and later packets for it are dropped instead of buffering until the trailer arrives. A reader can no longer resume a stream after leaving its iteration early. - #2168 (@1egoman) -
Conform placeholder fmtp for codecs without an fmtp line - #2182 (@eleboucher)
-
add datatrack data channel to sync state info - #2159 (@lukasIO)
-
Fix data packet decryption after the sender ratchets its key:
DataCryptornow retries with the ratcheted key instead of the stored one - #2188 (@ninglinLiu) -
Mark data track unpublished after republish fail - #2170 (@1egoman)
-
Fix an unhandled promise rejection when the signal passed to
dataTracks.getDeferred()aborts, even though the caller catches the rejected promise. - #2156 (@Abhishek-B-R) -
Stop playing a remote audio track in Chrome once it is detached. - #2234 (@murilo-teleo)
-
Fix a memory leak where a
Roomwas never garbage collected after the application dropped it. - #2222 (@1egoman) -
Keep the H.264 PPS id readable in E2EE keyframes, so that Chrome no longer drops keyframes from encoders such as Intel Quick Sync - #2181 (@lukasIO)
-
fix(e2ee): keep the encryption state of received tracks per track - #2246 (@lukasIO)
-
fix(e2ee): track the local encryption state separately from remote participants - #2245 (@lukasIO)
-
Speed up the emulation prevention step for encrypted H.264 and H.265 frames.
writeRbspnow returns the input unchanged when no byte needs escaping, and otherwise copies runs of bytes instead of building a JS array. The output does not change. - #2184 (@lukasIO) -
Stop
Room.getLocalDevices()without a kind from callinggetUserMediawhen every device is already listed with a label. - #2232 (@RaphaelFakhri) -
Ignore a late participant update for an older session of a remote participant, so it no longer removes or replaces the participant's current session in
room.remoteParticipants. - #2229 (@Brian-1812) -
Follow a full reconnect that happens during the initial connection (e.g. after the server moves a client off dead UDP) instead of timing out on the closed transports and tearing down the recovered session. The room stays
Connectingwhile a resume, a restart or a browser offline event happens insideconnect()and emits noSignalReconnecting,ReconnectingorReconnected. Also stop polling the transports after the connection timeout, and reject an already-aborted transport wait as cancelled instead of leaving it pending. - #2135 (@rafaelhutter) -
Limit each remote participant to 500 concurrently open incoming data streams by default. Headers for new streams beyond the limit are dropped with an error log, so a participant can no longer exhaust a receiver's memory by opening streams it never closes. The limit can be changed with the
dataStream.maxOpenStreamsPerParticipantroom option. - #2214 (@1egoman) -
Fixes an issue where if a data stream runs into a terminal error, any packets delivered afterwards will be treated as if the stream doesn't exist (and not throw a sync error) - #2167 (@1egoman)
-
Apply the
peerConnectionTimeoutconnect option to the negotiation deadline - #2189 (@ninglinLiu) -
Fix the microphone pre-connect buffer never starting when
preConnectBufferis passed via publish options. - #2252 (@1egoman) -
fix published type declarations for consumers with
skipLibCheck: falseorexactOptionalPropertyTypes- #2175 (@lukasIO) -
Stop a disconnected
SignalClientfrom logging a spurious "ping timeout triggered" warning 15 s afterroom.disconnect(). - #2239 (@Brian-1812) -
Stop logging
error reading from signal streamat error level when the signal socket was closed by the client or replaced; the read failure is now logged at debug level with the ignored close - #2192 (@ninglinLiu) -
The debug log for a ratcheted E2EE key no longer includes the ratchet result, so the chain key and the new key material stay out of the console and out of log extensions. - #2213 (@lukasIO)
-
Keep
engine.pendingReconnectaccurate across reconnect attempts. A failed attempt no longer clears the handle of the retry it just scheduled (which madependingReconnectreadfalsewhile a retry was pending), and the flag now clears as soon as the reconnect timer is cleared. Buffered room events are also flushed when the engine finishes restarting if the room already reports connected. - #2193 (@1egoman) -
Emit
Reconnectedonce and keep room metadata and recording changes when a full reconnect fails over to another region - #2165 (@lukasIO) -
Fix dynacast never pausing video layers on React Native: save sender encodings before skipping the stats monitor - #2163 (@davidliu)
-
Wait for the first frame of a screen share before reading its dimensions, so its simulcast layers are announced at the size the capture delivers instead of the requested resolution. - #2217 (@CSantosM)
-
Ignore signal messages received after the WebSocket is closed on React Native - #2173 (@davidliu)
-
fix(room): skip a deferred track the server stopped sending - #2225 (@lukasIO)
-
Keep the mid to track id mapping of the current publisher answer when an answer to an older offer or an answer with an empty mapping arrives in single peer connection mode, so remote tracks whose
trackevent fires later are no longer dropped - #2196 (@ninglinLiu) -
If
room.disconnect()runs during the signal join, the connection attempt now rejects as cancelled instead of with aTypeError. A stale connection attempt no longer closes the engine of a newer connection or disconnects the room. - #2151 ([@lukasIO](...
v2.23.0
Minor Changes
-
Release the audio contexts and web audio graphs the SDK creates. Previously they accumulated over mute/unmute cycles. They are now collected after
room.disconnect(). - #2029 (@lukasIO)detectSilencetears its context down on the throw path as well as the happy one.- The cleanup from
createAudioAnalyserdisconnects its nodes before it closes the context, and it is now idempotent. - The shared empty audio stream track is refcounted.
releaseEmptyAudioStreamTrackis a new export, and its context closes once the last clone is handed back. - If
webAudioMixis an object without anaudioContext, a room now closes the context it created for itself. - When the underlying track is replaced, audio processors are passed the audio context. This lets them rebuild their filter nodes on unmute. Previously they left the old nodes behind.
- The iOS dummy audio element and its
visibilitychangelistener are torn down on disconnect. Previously the listener outlived every room on the page.
This also fixes a false
AudioSilenceDetected. Silence detection read a zero-filled buffer from a context that never reachedrunning. An autoplay-blocked page therefore reported silence on every track it checked.Three further behavior changes to be aware of:
- A track retained across rooms loses its audio processor.
room.disconnect({ stopTracks: false })detaches the track from the audio context, which stops the processor. CallsetProcessoragain after you republish the track. - Under
webAudioMix, every attached element is muted, not only the first one. A second attached element no longer plays the track twice. When the audio context goes away, those elements are unmuted again and their volume is restored. Participant.setAudioContextandLocalAudioTrack.setAudioContextnow return a promise. Both are marked@internal, but both appear in the published type declarations.
Patch Changes
-
Scale the
x-google-start-bitratehint by connection setup time: the 1 Mbps camera cap now applies to connections that set up within 1.5 s and ramps linearly down to 300 kbps at 3.5 s or slower; screen share stays uncapped. - #2146 (@changt) -
Add jitter to reconnect retries in the default reconnect policy, including the first retry and reconnects requested by the server, so clients that disconnect together don't reconnect at the same time. The first retry waits a random 0 to 500 ms, and later retries scale their existing base delays by a random factor between 0.5 and 1.5. - #2124 (@RaphaelFakhri)
-
Publishing a backup codec now sends correctly sized video layers on that codec's own entry. Before this fix the layers were zero sized, on a field the server ignores. - #2137 (@lukasIO)
-
When an SEI or AUD NALU precedes the slice, encrypt h264 frames from the correct offset. Those NALUs read as h265 slice types, so detection returned h265 and the unencrypted prefix ended inside the leading NALU. The slice header was encrypted and no error was raised. The frame bytes now take precedence over a caller-supplied codec. The sender cryptor is also seeded with the publish codec for h264 and h265. A fallback to VP8 handling now logs the first bytes of the frame. - #2131 (@lukasIO)
-
Do not leave half of a surrogate pair when truncating an
RpcErrormessage or data to its byte limit - #2126 (@RaphaelFakhri) -
Cancel in-flight full reconnects when the engine closes, preventing delayed cleanup, region failover, or join responses from reopening a disconnected session. Honor cancellation before opening a signal transport. - #2095 (@horvatz)
-
Fix E2EE H.264/H.265 decryption failing for encoders that emit 3-byte Annex B start codes (e.g. Intel Quick Sync on Windows). The sender now rewrites them to 4-byte start codes in the unencrypted header, matching what the receiver's depacketizer reconstructs. - #2144 (@1egoman)
-
On Chrome, a disconnected microphone now restarts on the OS default input instead of the first enumerated device. If a restart fails after the user stopped the track, the capture device no longer stays live - #2138 (@lukasIO)
-
fix: lower timeout for validating connection errors and guard against locking - #2148 (@lukasIO)
-
Error in-flight incoming data streams when the room disconnects instead of leaving readers pending - #2125 (@RaphaelFakhri)
-
fix safari specific issue where data channel could change after waiting for headroom - #2130 (@1egoman)
-
Lower the camera
x-google-start-bitratehint further when the browser reports a slow connection (navigator.connection.effectiveType, Chromium only): 300 kbps for2gandslow-2g, 500 kbps for3g. The lower of this and the connection setup time cap applies;4gand browsers without the API keep the setup time cap alone, and screen share stays uncapped. - #2149 (@changt)
v2.22.4
Patch Changes
-
Catch the rejection from the publisher's
negotiate()when ensuring the PC transport connection, so a failed offer no longer surfaces as an unhandled promise rejection - #2142 (@1egoman) -
Catch the rejection from
negotiate()when the server requests media sections, so a failed renegotiation no longer surfaces as an unhandled promise rejection - #2108 (@SergeAx) -
Add
disableIceLiteconnect option to request full ICE from a server running ICE lite. - #2085 (@subham2006) -
Fix Document Picture-in-Picture detection reporting opener-document elements as being in PiP.
isElementInPiPcompared an element's coordinates (computed within its own document) against the PiP window's viewport without checking which document the element belongs to, so while any Document PiP window was open, every observed video element positioned inside the PiP window's bounds - a tile near the top-left of the page, for example - was treated as in PiP. BecauseHTMLElementInfo.visibleisisPiP || isIntersecting, those elements also counted as visible while scrolled out of view, which affected adaptiveStream subscription and layer selection. Detection now requires the element to live in the PiP window's document, or in a frame nested inside it. - #2106 (@dkelson) -
Ignore a duplicated server answer (same offerId) instead of applying it twice and surfacing a
NegotiationError. - #2114 (@pblazej) -
Wait for the first video frame in waitForDimensions on iPadOS, which reports a desktop user agent - #2110 (@1egoman)
-
Avoid attaching a new Closing/Restarting event listener for each negotiate call - #2084 (@1egoman)
-
Wait for first video frame to be received before responding to waitForDimension on ios - #2100 (@1egoman)
-
fix: wait for ReconnectResponse to arrive before declaring signal rec… - #2082 (@lukasIO)
-
Disable data streams v2 compression when CompressionStream exists but doesn't support deflate-raw - #2119 (@1egoman)
-
Retry against other LiveKit Cloud regions when the initial connection is rejected with 403. Cloud signals project-level region pinning with a 403 on the RTC paths, which was previously treated as terminal, so a client that geo-routed to a disallowed region never reached
/settings/regionsand failed to connect. 401 and the 404 "room does not exist" case remain terminal. - #2097 (@xianshijing-lk) -
Fix unhandled RPC timeout rejections when a request fails to publish or takes longer than the ack timeout to send - #2123 (@deepanshupal)
-
refresh subscribed codecs after publisher answer - #2121 (@lukasIO)
-
fix: expose participantIdentity on RoomEvent.DataReceived - #2092 (@mariusgassen)
-
Add
subscriberAllowPauseconnect option to control whether the SFU may pause subscribed video tracks when the subscriber is congested. - #2143 (@1egoman) -
Fix track volume losing effect when set to 0 - #2111 (@robintown)
-
Write the
x-google-start-bitratehint as a single connection-level value, once per publisher connection. - #2102 (@xianshijing-lk)libwebrtc reads this fmtp parameter per m-section but applies it to the shared
Call(WebRtcVideoSendChannel::ApplyChangedParams→SetSdpBitrateParameters), whereRtpBitrateConfiguratorholds one config for the whole peer connection. Differing per-section values were therefore last-writer-wins on m-section order, so publishing a camera and a screen share together could seed the estimator from either one depending on SDP layout. Every video section now carries the same value: the largest hint among the sections that are currently sending.Only sending sections count. The list of registered track bitrates is append-only, and an unpublished section keeps its
a=msid, so matching a section to a track by msid alone would still pair a stale entry with the section it used to occupy — letting an uncapped screen-share target seed a connection that now carries only a camera, or consuming the one-shot hint on a section that sends nothing, which would leave later publishes with no hint at all. The section's direction distinguishes them:a=recvonlyanda=inactivecannot carry local media and are exactly where an unpublished or pre-populated section lands, whilea=sendonly,a=sendrecvand an omitted direction all send.The hint is also written only on the first offer that carries local video, instead of on every offer. libwebrtc retains
start_bitrate_bpsand re-applies it on network route changes (RtpTransportControllerSend::OnNetworkRouteChanged), so rewriting it later is at best a no-op and at worst restarts a converged bandwidth estimator. A full reconnect builds a new peer connection and seeds the new estimator again.Targets below 300 kbps now get no hint, matching the Rust SDK: below that, seeding above the real capacity costs more than the ramp it saves.
v2.22.3
Patch Changes
-
fix: add code 1000 to onclose handler in WebSocketStream - #2086 (@phaitonican)
-
fix: don't reset mid track map on publisher answers with empty map - #2089 (@lukasIO)
-
Support simulcast for svc codecs (vp9/av1) - #2083 (@cnderrauber)
v2.22.2
Patch Changes
-
Fix the subscriber silently buffering remote ICE candidates after a reconnect - #2054 (@xianshijing-lk)
triggerIceRestartput the subscriber intorestartingIceon every reconnect, but only
setRemoteDescriptionclears that — and the server re-offers the subscriber only when the
reconnect moved the participant to a different node. After an ordinary signal-only resume no
offer arrives, so the flag stayed set for the lifetime of the transport and every subsequent
remote candidate was queued instead of applied, leaving the subscriber unable to adopt any new
network path the server proposed. The subscriber no longer enters that state: the server does
not send candidates ahead of the offer that introduces them, so queueing them gains nothing. -
fix: ensure buffered events are flushed on signal reconnection - #2044 (@lukasIO)
-
fix: error on datastreams when chunks are missing - #2073 (@lukasIO)
v2.22.1
Patch Changes
-
Forward
DisconnectReasonto theParticipantDisconnectedevent - #2055 (@seonghunYang) -
fix: enqueue signal requests until queue has been drained - #2061 (@lukasIO)
-
Add roomOptions.dataStream.maxPayloadByteLength to control max data stream size - #2060 (@1egoman)
-
Fix
supportsAdaptiveStreamalways returningtrueby comparingtypeofagainst the'undefined'string. It now returnsfalsein environments withoutResizeObserverorIntersectionObserver. - #2059 (@mrpmohiburrahman) -
Treat TokenSource JWTs without
expas expired, and still honorexpwhennbfis absent - #2057 (@SashaMIT) -
Convert internal exports to be external in examples/demo - #2067 (@1egoman)
v2.22.0
Minor Changes
Patch Changes
-
Decode text data streams without TextDecoder fatal mode for broader runtime support - #2037 (@JoelTowell)
-
fix: ensure buffered events are flushed on signal reconnection - #2043 (@lukasIO)
-
fix: cancel pending onTrack callbacks when subscription fails - #2019 (@lukasIO)
-
fix: match opus fmtp parameters by exact token and look up the opus codec case-insensitively when munging SDP - #2036 (@lukasIO)
-
Only run the
TrackEvent.TimeSyncUpdateanimation frame loop while something is subscribed to the event, and clear the frame handle when a track's monitor is stopped so the loop can be restarted - #2038 (@U-OK) -
fix: emit TrackStreamStateChanged again by reading the previous stream state before overwriting it - #2039 (@tomkail)
-
Apply the resolved degradation preference to the backup codec's sender - #2040 (@xianshijing-lk)
Degradation preference is a property of the sender, not of the track, and a backup codec publishes over its own sender. Previously only the primary sender was configured, so the backup encoder resolved a preference implicitly and could adapt along a different axis than the primary.
-
fix: recover broken publish paths — act on local
ConnectionQuality.Lost, recreate the peer connection when an ICE restart has no remote description, bound how long a transport may stay connecting, and reconnect (instead of disconnecting) on a detected connection state mismatch - #2030 (@lukasIO) -
fix: enable Terser
mangle.safari10to fix scoping issues for variables in react-native - #2028 (@davidliu) -
fix: ensure dd extension also for recvonly - #2052 (@lukasIO)