Skip to content

Commit

Permalink
* fix: Expose keyRingSize/discardFrameWhenCryptorNotReady parameters …
Browse files Browse the repository at this point in the history
…for KeyProvider. (#495)
  • Loading branch information
cloudwebrtc authored Apr 9, 2024
1 parent 8bb9350 commit 3adcfc7
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 2.1.2

* fix: Expose keyRingSize/discardFrameWhenCryptorNotReady parameters for KeyProvider

## 2.1.1

* update to package:web (#484)
Expand Down
2 changes: 1 addition & 1 deletion ios/livekit_client.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'livekit_client'
s.version = '2.1.1'
s.version = '2.1.2'
s.summary = 'Open source platform for real-time audio and video.'
s.description = 'Open source platform for real-time audio and video.'
s.homepage = 'https://livekit.io/'
Expand Down
22 changes: 14 additions & 8 deletions lib/src/e2ee/key_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const defaultRatchetSalt = 'LKFrameEncryptionKey';
const defaultMagicBytes = 'LK-ROCKS';
const defaultRatchetWindowSize = 16;
const defaultFailureTolerance = -1;
const defaultKeyRingSize = 16;
const defaultDiscardFrameWhenCryptorNotReady = false;

class KeyInfo {
final String participantId;
Expand Down Expand Up @@ -70,16 +72,20 @@ class BaseKeyProvider implements KeyProvider {
String? uncryptedMagicBytes,
int? ratchetWindowSize,
int? failureTolerance,
int? keyRingSize,
bool? discardFrameWhenCryptorNotReady,
}) async {
rtc.KeyProviderOptions options = rtc.KeyProviderOptions(
sharedKey: sharedKey,
ratchetSalt:
Uint8List.fromList((ratchetSalt ?? defaultRatchetSalt).codeUnits),
ratchetWindowSize: ratchetWindowSize ?? defaultRatchetWindowSize,
uncryptedMagicBytes: Uint8List.fromList(
(uncryptedMagicBytes ?? defaultMagicBytes).codeUnits),
failureTolerance: failureTolerance ?? defaultFailureTolerance,
);
sharedKey: sharedKey,
ratchetSalt:
Uint8List.fromList((ratchetSalt ?? defaultRatchetSalt).codeUnits),
ratchetWindowSize: ratchetWindowSize ?? defaultRatchetWindowSize,
uncryptedMagicBytes: Uint8List.fromList(
(uncryptedMagicBytes ?? defaultMagicBytes).codeUnits),
failureTolerance: failureTolerance ?? defaultFailureTolerance,
keyRingSize: keyRingSize ?? defaultKeyRingSize,
discardFrameWhenCryptorNotReady:
defaultDiscardFrameWhenCryptorNotReady);
final keyProvider =
await rtc.frameCryptorFactory.createDefaultKeyProvider(options);
return BaseKeyProvider(keyProvider, options);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/livekit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
/// Main entry point to connect to a room.
/// {@category Room}
class LiveKitClient {
static const version = '2.1.1';
static const version = '2.1.2';
}
2 changes: 1 addition & 1 deletion macos/livekit_client.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'livekit_client'
s.version = '2.1.1'
s.version = '2.1.2'
s.summary = 'Open source platform for real-time audio and video.'
s.description = 'Open source platform for real-time audio and video.'
s.homepage = 'https://livekit.io/'
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
name: livekit_client
description: Flutter Client SDK for LiveKit.
Build real-time video and audio into your apps. Supports iOS, Android, and Web.
version: 2.1.1
version: 2.1.2
homepage: https://github.com/livekit/client-sdk-flutter

environment:
Expand Down

0 comments on commit 3adcfc7

Please sign in to comment.