From fc4efc6edf7e838760eab5e4c430983b65888528 Mon Sep 17 00:00:00 2001 From: Jolie <412895109@qq.com> Date: Wed, 19 Nov 2025 01:17:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(rtc):=20=E6=B7=BB=E5=8A=A0-=E5=8F=91?= =?UTF-8?q?=E9=80=81=E6=B6=88=E6=81=AF=E5=8A=9F=E8=83=BD=20=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=20sendMessage=20=E6=96=B9=E6=B3=95=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=AD=97=E7=AC=A6=E4=B8=B2=E6=B6=88=E6=81=AF?= =?UTF-8?q?=20-=20=E4=BD=BF=E7=94=A8=20UTF-8=20=E7=BC=96=E7=A0=81=E5=B0=86?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E8=BD=AC=E6=8D=A2=E4=B8=BA=E5=AD=97=E8=8A=82?= =?UTF-8?q?=E6=B5=81=20-=20=E8=B0=83=E7=94=A8=E5=BC=95=E6=93=8E=E7=9A=84?= =?UTF-8?q?=20sendStreamMessage=20=E6=8E=A5=E5=8F=A3=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=20-=20=E6=89=93=E5=8D=B0=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E7=9A=84=E6=97=A5=E5=BF=97=E4=BF=A1=E6=81=AF?= =?UTF-8?q?-=20=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87=20streamId=20=E5=8F=91?= =?UTF-8?q?=E9=80=81=E6=B6=88=E6=81=AF=E5=88=B0=E6=8C=87=E5=AE=9A=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rtc/rtc_manager.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/rtc/rtc_manager.dart b/lib/rtc/rtc_manager.dart index 6150f64..f49fcd1 100644 --- a/lib/rtc/rtc_manager.dart +++ b/lib/rtc/rtc_manager.dart @@ -421,6 +421,17 @@ class RTCManager { print('客户端角色已设置为:$role'); } + /// 发送消息 + Future sendMessage(String message) async { + Uint8List data = utf8.encode(message); + await _engine!.sendStreamMessage( + streamId: _streamId ?? 0, + data: data, + length: data.length, + ); + print('已发送消息:$message'); + } + /// 获取当前频道ID String? get currentChannelId => _currentChannelId;