582 Commits

Author SHA1 Message Date
Hiroshi Horie
2dff49603b Simplify enabling E2EE with Session API (#1053)
Some checks failed
Build / Dart Format Check (push) Has been cancelled
Build / Import Sorter Check (push) Has been cancelled
Build / Version Consistency Check (push) Has been cancelled
Build / Dart Analyze Check (push) Has been cancelled
Build / Dart Test Check (push) Has been cancelled
Build / Build for Flutter Android (push) Has been cancelled
Build / Build for Flutter iOS (push) Has been cancelled
Build / Build for Flutter Windows (push) Has been cancelled
Build / Build for Flutter macOS (push) Has been cancelled
Build / Build for Flutter Linux (push) Has been cancelled
Build / Build for Flutter Web (push) Has been cancelled
Build / Build for Flutter Web WASM (push) Has been cancelled
deploy web on github-page / Build and deploy web example (push) Has been cancelled
Publish docs / Publish docs (push) Has been cancelled
2026-04-19 03:22:11 +08:00
Hiroshi Horie
094b956b15 Minor fixes 1 (#1041)
A collection of minor/simple fixes.
2026-03-29 19:57:00 +08:00
Hiroshi Horie
8dfaf67339 v2.7.0 (#1040)
Some checks failed
Publish to pub.dev / publish (push) Has been cancelled
2026-03-24 21:26:33 +09:00
Hiroshi Horie
b1005c7bf6 Set video dimensions API (#1037) 2026-03-24 16:31:27 +09:00
Hiroshi Horie
889ad25148 Fix dynacast (#1033)
- For SVC codecs (VP9/AV1), keep all quality layers enabled and let the
SFU handle spatial layer selection, matching JS SDK behavior
- Pass per-codec `isSVC` through the layer publishing call chain instead
of using the track's primary codec, fixing multi-codec scenarios
- Set `track.codec` unconditionally (was gated by Firefox check)
- Rename `updatePublishingLayers` → `setPublishingLayers` to match JS
SDK
2026-03-24 15:59:55 +09:00
Hiroshi Horie
867e706f67 Ping RTT (#1035) 2026-03-24 13:07:24 +09:00
Hiroshi Horie
f8373c165a Retry jitter (#1036) 2026-03-24 12:53:51 +09:00
Hiroshi Horie
dd3bc71f5f Processor fixes 1 (#1038) 2026-03-24 12:52:56 +09:00
CloudWebRTC
4af50af299 chore: bump flutter-webrtc and upgrade to libwebrtc m144. (#1029)
Changes:
* Bump libwebrtc to m144.
* Added `DataPacketCryptor` support for Windows/Linux.
* Add enum `KeyDerivationAlgorithm` to KeyProviderOptions (support
HKDF).

---------

Co-authored-by: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com>
2026-03-17 16:17:44 +09:00
Hiroshi Horie
ab7a68241f Fix signal resume events (#1027)
Emit RoomReconnectedEvent after signal resume. Fix _sendSyncState()
timing to run after WS reconnects instead of before. Add
RoomResumingEvent separate from RoomReconnectingEvent with shared
ReconnectingEvent base mixin.
2026-03-17 15:40:32 +09:00
Hiroshi Horie
85dc99d2b2 Fix missing offer in syncState (#1028)
It appears that the server is not using this field anyway, but this
aligns with the other SDKs.
2026-03-17 15:18:21 +09:00
Hiroshi Horie
85b94bdc52 v2.6.5 (#1023) 2026-03-06 22:57:51 +09:00
Hiroshi Horie
3fd7731eb0 Add audio renderer API (#1004)
Public API to get audio frames if user desires .
2026-03-06 13:22:40 +09:00
Hiroshi Horie
12c11deaf8 Fix microphone stopping after pre-connect audio (#1021) 2026-03-06 13:21:48 +09:00
CloudWebRTC
f3efa6e30f chore: Add ReconnectReason for reconnect. (#1020) 2026-03-05 19:46:48 +09:00
Hiroshi Horie
1314700a88 Fix: preserve audio category options when forcing speaker output (#1015)
forceSpeakerOutput replaced all category options with only
defaultToSpeaker, losing allowBluetooth/allowBluetoothA2DP/allowAirPlay.
Now adds defaultToSpeaker to the existing options instead.
2026-03-04 17:47:51 +09:00
Hiroshi Horie
48709c1e6c Fix: use correct ProcessorOptions type based on track kind (#1014)
setProcessor() always created AudioProcessorOptions regardless of track
type. Video tracks now get VideoProcessorOptions.
2026-03-04 12:29:03 +09:00
Hiroshi Horie
bef5a00f43 Fix duplicate track publish (#1009)
Use a SerialRunner pattern similar to Swift SDK.
Resolves https://github.com/livekit/client-sdk-flutter/issues/419,
https://github.com/livekit/client-sdk-flutter/issues/501
2026-03-02 21:36:56 +09:00
Hiroshi Horie
31ec6b09cc Fix audio visualizer exception (#1008)
Fix `MissingPluginException` when stopping audio visualizer.
2026-03-02 21:19:24 +09:00
Hiroshi Horie
410a15d632 Fix pub score static analysis (#1010) 2026-02-27 15:33:16 +09:00
Hiroshi Horie
60e5303c35 Protocol v16 support (#1003) 2026-02-27 15:28:05 +09:00
Hiroshi Horie
832a523ace v2.6.4 (#1005)
Some checks failed
Publish to pub.dev / publish (push) Has been cancelled
2026-02-27 03:17:33 +09:00
Hiroshi Horie
5c4f2e073f Fix web pre-connect audio buffer sample rate (#1007)
Pass sampleRate to AudioContext
2026-02-27 02:51:54 +09:00
Hiroshi Horie
da398e5654 Fix web audio capture on Safari (#1006)
- Call `AudioContext.resume()` after creation to ensure it's running
- Browsers (especially Safari) may create AudioContext in suspended
state, causing the AudioWorklet to silently never fire
2026-02-26 18:22:35 +09:00
Hiroshi Horie
55bfa208a9 Add web support for pre-connect audio buffer (#1000)
- Extract `AudioFrameCapture` abstraction with conditional imports
(native/web)
- Implement web audio capture using AudioWorklet API
2026-02-26 10:27:23 +09:00
Hiroshi Horie
6b896eb6bb Optimize audio renderer payloads (#988)
This PR changes audio renderer events to send raw PCM bytes instead of
boxed sample arrays, which reduces codec overhead and GC pressure
between native and Flutter.
2026-02-24 01:45:43 +09:00
Hiroshi Horie
ac709cd94b Fix duplicate leave (#999) 2026-02-23 00:14:31 +09:00
Hiroshi Horie
a0adcb60f1 Fix setVideoInputDevice (#973)
Fixes: https://github.com/livekit/client-sdk-flutter/issues/863

- Fix camera switching by comparing against the pre-update device id
when deciding to call switchCamera.
- Keep room options updated for future tracks while still allowing the
active track to change devices.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Fixed an issue where switching the camera could fail; the app now
correctly detects and switches the active video input device.
* Added a changelog entry noting the patch that resolves camera
switching behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-17 02:23:15 +09:00
Hiroshi Horie
ef92005511 chore: fix missing @internal annotations (#993)
Fix missing @internal annotations
2026-02-14 02:00:58 +09:00
Hiroshi Horie
08b12d6388 v2.6.3 (#991)
Some checks failed
Publish to pub.dev / publish (push) Has been cancelled
2026-02-13 01:04:59 +09:00
Hiroshi Horie
b5a360dde1 Fix publisher pc causing redundant renegotiations (#990)
Fixes publisher pc handling that could cause redundant negotiations and
instability on lower-end devices when sending data packets under load.
2026-02-13 00:49:57 +09:00
Hiroshi Horie
f225dca313 Prevent crashes from writing to closed data stream controllers (#989)
Changes:
- Add isClosed guards to write(), error(), and close() on
DataStreamController
- Fix fallthrough bug in handleStreamChunk where a chunk would still be
written after an encryption mismatch error
- Close stream controllers in validateParticipantHasNoActiveDataStreams
after sending the error, so readAll() consumers don't hang indefinitely

Closes #978
2026-02-11 22:25:21 +09:00
Hiroshi Horie
208d8d69f5 Fix concurrent modification (#986)
Snapshot collections with .toList() / List.of() before iterating,
preventing modification by concurrent async event handlers.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Fixed potential concurrent modification exceptions that could occur
during async operations when iterating over participant data, event
listeners, and audio elements.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-07 16:49:34 +09:00
Hiroshi Horie
df41188357 Fix region provider related bugs (#983)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Fixed cache expiry behavior for region URL lookups by correcting
time-unit handling and extending the short cache interval.
* Corrected region validation during leave events so region data is
properly checked before being returned.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-06 17:40:54 +09:00
Hiroshi Horie
da801a918d Fix meta package import errors (#981)
fix: use explicit imports to prevent missing meta annotations on some
Flutter versions

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Refactored import statements throughout the codebase from broad
imports with hide directives to explicit symbol declarations using show
clauses. This improves code clarity, reduces unnecessary symbol
exposure, and enhances maintainability.
* Consolidated imports to leverage specialized packages for improved
code organization.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-06 14:59:19 +09:00
Hiroshi Horie
be1389eb91 chore: Bump protobuf to v1.44.0 (#980)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
  * Added support for bridge and RTSP bridge participant types
  * Added auto-subscribe option for data tracks in connection settings
  * Enhanced video streaming with repair SSRC capability

* **Chores**
  * Updated protobuf to version 1.44.0

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-06 04:47:00 +09:00
CloudWebRTC
57c8d42de0 fix: debounce for ensurePublisherConnected. (#967)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved publisher connection stability by centralizing connection
handling, adding a single awaited connection flow with automatic reset
on failure, and ensuring connections are cleared and retried after
restarts or when peer connection states become
closed/failed/disconnected. This reduces race conditions and improves
reliability for publishing and data sending paths.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-03 10:26:17 +08:00
Hiroshi Horie
b58f55ad5a v2.6.2 (#976)
Some checks failed
Publish to pub.dev / publish (push) Has been cancelled
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Release**
  * Version bumped to 2.6.2

* **New Features**
  * Bitrate priority control APIs

* **Bug Fixes**
  * Windows: stop camera after unpublishing video track
  * Keep mute state in sync with server
  * Fix example prejoin device dropdown handling

* **Chores**
  * Mark LocalVideoTrack constructor as internal
  * Update protobuf to v6.0.0
  * Misc. packaging/documentation updates
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-02 12:29:08 +08:00
italomiguelpinheiro
2eb4c48d30 fix: change local video track constructor (#971)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Updated the internal initialization structure of video track
components for improved code organization and maintainability.

Thir PR updates the LocalVideoTrack definition to carry an "@internal"
annotation and match the LocalAudioTrack version.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-02 12:12:27 +08:00
Hiroshi Horie
690f276d29 Ensure mute state stays in sync after reconnect (#965)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Fixed mute state synchronization to ensure the client's local mute
status remains in sync with the server, preventing inconsistencies
during track publishing and codec operations.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-02 00:39:38 +08:00
Hiroshi Horie
306b65e02e Add bitrate priority control (#969)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Bitrate priority controls for audio and video encodings with preset
encoding profiles for common audio use cases.
* New priority levels (veryLow, low, medium, high) for bitrate and
network priority.
* Audio publish options now accept encoding presets instead of legacy
numeric bitrate fields.
  * RTC configuration adds an option to enable DSCP for improved QoS.

* **Chores**
  * Updated WebRTC-related package versions for compatibility.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-01 18:08:01 +08:00
CloudWebRTC
2e421d49e5 fix: stop camera after stop publishing video track(windows). (#960)
close #355 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Adjusted track mute behavior so the platform-specific condition now
targets only Firefox on web.
* Fixed Windows behavior to ensure the camera stops after a video track
is unpublished.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com>
2026-01-27 17:50:59 +08:00
Karthikeyan Sankaran
c7d9facf70 fix: set proper mute state for audio/video tracks after reconnection (#963)
Closes https://github.com/livekit/client-sdk-flutter/issues/962

### How does it fix that?

The methods `publishAudioTrack` and `publishVideoTrack` are called on
call reconnection here -

70d4d1f5fd/lib/src/participant/local.dart (L560-L570)

But inside the methods we're not passing the `muted` state from the old
tracks we have. It defaults to `false` because it's not set in protobuf:

70d4d1f5fd/lib/src/proto/livekit_rtc.pb.dart (L1153)

By passing it correctly, this PR fixes the bug in the linked issue.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Fixed an issue where the muted state of audio and video tracks was not
being correctly propagated when publishing to the server.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-25 02:27:00 +08:00
Hiroshi Horie
70d4d1f5fd Update protobuf dependency to v6 (#957) 2026-01-14 01:41:34 +09:00
Hiroshi Horie
ee938fd145 v2.6.1 (#954)
Some checks failed
Publish to pub.dev / publish (push) Has been cancelled
2026-01-10 01:26:20 +09:00
StevenLin
b835995fbb fix: Enable E2EE for VP9 codec (#953)
### Problem
While using the Flutter SDK with JS SDK and with E2EE enabled, the video
from Web can not be decrypted by the Flutter app.

## Summary
Enables end-to-end encryption (E2EE) for VP9 codec. Previously, E2EE was
skipped for all SVC codecs. This aligns the Flutter SDK with the JS SDK,
where E2EE works with VP9 codec.

## Changes
Removed `isSVCCodec()` and use `isAV1Codec()` to enable E2EE setup for
VP9 codec in `LocalTrackPublishedEvent` handler
Removed `isSVCCodec()` and use `isAV1Codec()` to enable E2EE setup for
VP9 codec in `TrackSubscribedEvent` handler

Is there any specific reason why E2EE is disabled for SVC codecs? 
I tried VP9 with this patch and the VP9 video from Web can be decrypted
by Flutter app.
2026-01-07 20:21:56 +08:00
Hiroshi Horie
db96f8fe4e Minor disposer improvement (#949)
Ensure all dispose functions are executed even if one throws.
2025-12-25 18:29:24 +09:00
Hiroshi Horie
8e148f1870 Improve session api related docs (#946) 2025-12-15 16:36:20 +09:00
Hiroshi Horie
d14a6c5832 Fix typos in docs and code (#944) 2025-12-12 18:57:51 +09:00
Hiroshi Horie
0b7d9f5baa v2.6.0 (#936)
Some checks failed
Publish to pub.dev / publish (push) Has been cancelled
2025-12-09 04:18:15 +09:00