Repository navigation
Data streams v2, backed by the shared Rust core on native platforms, plus a large round of reconnect, data and audio fixes.
Highlights
- Data streams v2. On native platforms data streams now run on the Rust core (
livekit_ffi), which adds single-packet inline sends, compression,LocalParticipant.sendBytesandParticipant.capabilities. Web keeps the Dart implementation and interoperates as a pre-v2 peer. - More reliable data. A send completes once its packets reach the data channel, so a failed send throws and a large send no longer buffers the whole payload in memory. Reliable data sent during a reconnect goes out when the reconnect finishes.
- Audio. RED is now on by default as documented.
AudioPublishOptions.redwas inverted, so apps that setred: falseto get RED should remove it. On iOS, remote audio no longer drops to call volume when capture uses software voice processing. - Reconnect and publishing. Fixes for
disconnect()during a full reconnect, back to back track publishes, out of order participant updates, and simulcast layers re-enabled after renegotiation. - Security. Access tokens are no longer written to logs, and region URLs from region discovery are validated before failover.
What's Changed
- Added: Wire in the livekit_ffi Rust core behind a native-only facade, delivered as a bundled cdylib via Native Assets
- Added: ConnectOptions.dataStream with maxPayloadByteLength, bounding the payload a single incoming data stream may deliver
- Added:
DataReceivedEvent.participantIdentityreports the sender even whenparticipantis null, for example when data arrives before the sender's join is announced or after the sender has left - Changed: Require livekit_ffi 0.15.0, whose Dart bindings no longer leak the byte and string payloads that cross to the Rust core
- Changed: Import package:flutter/widgets.dart instead of the deprecated package:flutter/material.dart wherever Material is not used, so the package analyzes cleanly on Flutter 3.50
- Changed: Data streams are now backed by the Rust core (livekit-ffi) on native platforms, adding data streams v2: single-packet inline sends, deflate-raw compression and MTU-bounded headers. Adds LocalParticipant.sendBytes, a compress option, Participant.capabilities and ClientProtocolVersion.v2. Web keeps the existing Dart implementation and interoperates as a pre-v2 peer.
- Fixed: The signalling URL is no longer logged with the access token in it. On web the token is carried as a query parameter, because browsers cannot set headers on a WebSocket, and the whole URL was logged at FINE level, so an app that enabled FINE logging, or forwarded SDK logs, wrote a usable access token to its logs. The token is now masked in that log line, matching the JS SDK; the remaining query parameters are still logged
- Fixed: A data stream send completes once its packets are handed to the data channel, so a failed send throws and a large send no longer buffers the whole payload in memory
- Fixed: Prevent stale video renderer attachments and listener leaks during async initialization, track changes, and disposal
- Fixed: Audio tracks now publish with RED (redundant audio data) enabled by default as documented. AudioPublishOptions.red was inverted, so the default red: true disabled RED and red: false enabled it. Apps that set red: false to get RED working should remove it
- Fixed: Fix a room that rejoined after being disposed while a full reconnect was tearing down, and fail data stream writes started after the room was disposed
- Fixed: RPC error
messageanddataare now truncated by UTF-8 byte length rather than by UTF-16 code unit count, so the 15 KB cap actually bounds the packet and a truncated field no longer ends in half a surrogate pair - Fixed: Calling disconnect() while a full reconnect is in progress no longer reconnects the room and joins again with the old token
- Fixed: Closing a data stream writer more than once ends the stream once instead of sending another trailer, and a write after close fails with DataStreamErrorReason.AlreadyClosed instead of sending a chunk after the stream ended
- Fixed: iOS: remote audio no longer has to drop to the device's call volume as soon as local capture starts. iOS applies a reduced, call-tuned output gain while the audio session runs a chat mode (
videoChat/voiceChat), which Apple's Voice Processing I/O compensates for; without VPIO there is nothing to compensate, so a capture that resolves to WebRTC software voice processing now getsplayAndRecordwith thedefaultmode and keeps media loudness. The newAudioManager.setPlatformVoiceProcessingAllowedguarantees Voice Processing I/O is never used, which is what lets thedefaultmode stick, iOS rewrites the mode back tovoiceChatwhenever VPIO is instantiated, so a session mode alone cannot avoid the call-tuned gain. In automatic modeplayAndRecordis additionally kept across mute toggles until the engine stops, instead of flipping back toplaybackon every mute: that flip moved playback between iOS's media and call volume registers (audible as a loud-then-quiet jump) and tore down echo cancellation mid-call.LiveKitClient.initialize(bypassVoiceProcessing: true)now also tells the audio device module to drop processing, matching what it already does to thegetUserMediaconstraints; previously it left Apple voice processing requested, so the session kept a chat mode whose call-tuned gain had nothing left to compensate it and remote audio became close to inaudible. The automatic speaker policy now also setsdefaultToSpeaker, which thedefaultmode needs to stay on the speaker - Fixed: Reliable data sent during a reconnect now goes out once the reconnect finishes, instead of being reported as sent and dropped. Such sends wait for the reconnect and fail with UnexpectedConnectionState if the room disconnects instead
- Fixed: A duplicated server answer is now ignored instead of being applied a second time, which failed on the peer connection and re-ran the transport's post-answer work for a message that should have been dropped
- Fixed: Keep the pre-connect audio buffer recording through a region failover on connect, so the microphone is still published when the first attempt is rejected (for example by a region-pinned LiveKit Cloud project)
- Fixed:
setLoggingLevelanddisableLoggingno longer throwUnsupportedErrorin an app that has not turned onhierarchicalLoggingEnableditself. They now turn it on, so the SDK logger can have a level of its own. Loggers without their own level keep followingLogger.root - Fixed: Apply kotlin-android through pluginManager on Android so Flutter no longer warns that livekit_client applies the Kotlin Gradle Plugin when built-in Kotlin is active
- Fixed: The access token the server refreshes during a session is no longer written to the log. The internal event that carries it printed the token, and every emitted event is logged at FINEST level, so an app that enabled the most verbose logging or forwarded SDK logs wrote a usable token to its logs
- Fixed: A data stream packet that arrives after the room closed no longer opens a stream that nothing finishes or fails
- Fixed: iOS/macOS: audio device module and local track calls act on the calling Flutter engine's WebRTC instance when more than one engine initializes WebRTC
- Fixed: In shared-key E2EE mode, newly published tracks and encrypted data packets now use the key index passed to
setSharedKeyinstead of always starting at index 0, which made them unreadable to other participants when the key lived at another index - Fixed: Region URLs returned by region discovery are now validated before the SDK fails over to them. Only encrypted (
wss/https) LiveKit Cloud URLs are accepted, and the check is applied to both sources of a region list: the/settings/regionsresponse and the regions the server reports over signalling.isCloudUrlalso now matches the Cloud domains on the host suffix rather than withcontains, so a host such asproject.livekit.cloud.example.comis no longer treated as LiveKit Cloud - Fixed: A track published right after another one is no longer left unpublished. Its offer was dropped when the request arrived while the answer to the previous offer was being applied, for example a microphone enabled right after the camera
- Fixed: Stop resolving a remote participant by its old sid after another session takes over its identity
- Fixed: Fix remote tracks going missing and duplicate participants when participant updates arrive back to back or out of order
- Fixed:
DataStreamErroris now aLiveKitException, soon LiveKitExceptionalso catches data stream failures, such as a write cut off by disposing the room - Fixed: A data packet in flight when the room is disposed no longer fails with a PlatformException from the closed data channel. The send completes when the packet went out and fails with UnexpectedConnectionState when it did not
- Fixed: Fix data stream writes that could hang after a full reconnect, carried on after the room disconnected, or leaked a listener while waiting for the send buffer to drain. Writes now also wait for a reconnect to finish
- Fixed: A track processor now stays attached across mute and unmute with the default stop-on-mute capture options, and across restartTrack such as a camera switch, instead of being silently dropped. It is restarted on the new media track, and the sender carries its processed track when it has one
- Fixed: Reconnect delays now carry proportional jitter, so clients disconnected by the same event no longer retry in lockstep. The first retry draws from a small random window instead of firing immediately, and later retries are scaled by a random factor between 0.5 and 1.5
- Fixed: The last subscribed codecs are now re-applied to the local video senders after each publisher renegotiation, so simulcast layers that dynacast paused are no longer re-enabled by the SFU answer
- Fixed: Data stream writes on a closed engine fail with UnexpectedConnectionState instead of a plain string error
- Fixed:
LiveKitVideoGrantnow reads the camelCase keys of thevideoclaim (roomJoin,canPublish, and so on), soTokenSourceResponse.jwtPayload?.videoreturns the grants of a real LiveKit token instead of null fields
Full Changelog: v2.13.2...v2.14.0