feat: 目标不在线时进行提示和更新UI
This commit is contained in:
@@ -30,6 +30,9 @@ class RemoteController {
|
||||
/// ICE 连接断开(用于提示用户并返回连接设置)。
|
||||
void Function(String message)? onIceDisconnected;
|
||||
|
||||
/// 目标被控端不在线(服务器回送 TARGET_OFFLINE,用于提示用户并复位 UI)。
|
||||
void Function(String message)? onTargetOffline;
|
||||
|
||||
/// 远端视频渲染器就绪。
|
||||
void Function(RTCVideoRenderer renderer)? onRemoteStream;
|
||||
|
||||
@@ -92,6 +95,11 @@ class RemoteController {
|
||||
final payload = jsonDecode(message.payload!) as Map<String, dynamic>;
|
||||
_webRtc?.handleIceCandidate(payload);
|
||||
break;
|
||||
case 'TARGET_OFFLINE':
|
||||
final text = message.payload ?? '目标被控端不在线,请确认设备已开启并连接服务器';
|
||||
onStatusChanged?.call('状态: $text');
|
||||
onTargetOffline?.call(text);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user