Skip to content

Commit

Permalink
Websocket client tool results
Browse files Browse the repository at this point in the history
  • Loading branch information
mdepinet committed Dec 13, 2024
1 parent 7a95aa1 commit cea0cdb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.7"
version: "0.0.8"
uuid:
dependency: transitive
description:
Expand Down
10 changes: 7 additions & 3 deletions lib/src/session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:livekit_client/livekit_client.dart' as lk;
import 'package:web_socket_channel/web_socket_channel.dart';
import 'dart:convert';

const ultravoxSdkVersion = '0.0.7';
const ultravoxSdkVersion = '0.0.8';

/// The current status of an [UltravoxSession].
enum UltravoxSessionStatus {
Expand Down Expand Up @@ -320,8 +320,12 @@ class UltravoxSession {
throw Exception("Data must contain a 'type' key");
}
final message = jsonEncode(data);
await _room.localParticipant
?.publishData(utf8.encode(message), reliable: true);
final messageBytes = utf8.encode(message);
if (messageBytes.length > 1024) {
_wsChannel.sink.add(message);
} else {
await _room.localParticipant?.publishData(messageBytes, reliable: true);
}
}

Future<void> _disconnect() async {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ultravox_client
description: "Flutter client SDK for Ultravox."
version: 0.0.7
version: 0.0.8
homepage: https://ultravox.ai
repository: https://github.com/fixie-ai/ultravox-client-sdk-flutter
topics:
Expand Down

0 comments on commit cea0cdb

Please sign in to comment.