fix(webrtc): 修复 ICE 服务器解析逻辑,支持自定义端口与标准参数

修正 ice_servers.dart 中的 URL 解析,使 stun/turn 地址能正确识别自定义端口及 transport/port 参数;同步调整 webrtc_controller.dart 中的调用方式以适配新解析逻辑。
This commit is contained in:
TongTongStudio
2026-08-02 11:47:10 +08:00
parent 376a2c1217
commit 7bb44b10be
3 changed files with 65 additions and 18 deletions

View File

@@ -307,6 +307,7 @@ class _ControllerHomeState extends State<ControllerHome> {
};
_controller!.onConnectionFailed = (error) {
if (mounted) setState(() => _connecting = false);
debugPrint('[WebRTC] onConnectionFailed: $error');
_showAlert('连接失败:$error');
};
_controller!.onDisconnected = () {
@@ -560,6 +561,7 @@ class _ControllerHomeState extends State<ControllerHome> {
} catch (e) {
if (mounted) {
setState(() => _recordStatus = '');
debugPrint('_startRecording error: $e');
_showAlert('开始录制失败:$e');
}
}