feat: ice断开返回配置页面

This commit is contained in:
2026-07-14 14:41:42 +08:00
parent 37fccec6af
commit 67c7e48190
3 changed files with 31 additions and 0 deletions

View File

@@ -27,6 +27,9 @@ class RemoteController {
/// 连接断开。
void Function()? onDisconnected;
/// ICE 连接断开(用于提示用户并返回连接设置)。
void Function(String message)? onIceDisconnected;
/// 远端视频渲染器就绪。
void Function(RTCVideoRenderer renderer)? onRemoteStream;
@@ -72,6 +75,7 @@ class RemoteController {
_webRtc!.onDisconnected = () {
onDisconnected?.call();
};
_webRtc!.onIceDisconnected = (message) => onIceDisconnected?.call(message);
_webRtc!.onRemoteStream = (renderer) => onRemoteStream?.call(renderer);
_webRtc!.initialize().catchError((e) {
onStatusChanged?.call('状态: 连接失败 - $e');