fix(sender): 串流窗口锁定视频比例,关窗即停流,修正文件传输取 IP
- 独立窗口首帧到达后按视频宽高比自动调整并居中;WM_SIZING 锁定比例,最小 320x180 - 去掉 WS_MAXIMIZEBOX 与双击/F11 全屏,只保留关闭与最小化 - 移除停止投屏按钮;WM_DESTROY 通过 ttstd/video 通道回调 windowClosed,Dart 侧下发 stopMirror - 文件传输地址优先取设备局域网 IP,取不到时回退控制通道 peerIp,并在文件页提供可编辑 IP 输入
This commit is contained in:
1 parent
d3ff293877
commit
d8357a8491
8 files changed
+321
-127
No files matched your search
@@ -15,7 +15,9 @@ class SenderBridge {
|
||||
NativeCore? nativeCore,
|
||||
}) : _method = method ?? const MethodChannel('ttstd/sender'),
|
||||
_events = events ?? const EventChannel('ttstd/sender/events'),
|
||||
_native = nativeCore;
|
||||
_native = nativeCore {
|
||||
_video.setMethodCallHandler(_handleVideoCall);
|
||||
}
|
||||
|
||||
final MethodChannel _method;
|
||||
final EventChannel _events;
|
||||
@@ -25,6 +27,15 @@ class SenderBridge {
|
||||
/// 原生视频解码纹理通道(Windows runner 内嵌插件)。
|
||||
static const MethodChannel _video = MethodChannel('ttstd/video');
|
||||
|
||||
/// 用户关掉独立串流窗口(点关闭按钮 / 按 ESC)时触发,用于停止投屏。
|
||||
void Function()? onVideoWindowClosed;
|
||||
|
||||
Future<void> _handleVideoCall(MethodCall call) async {
|
||||
if (call.method == 'windowClosed') {
|
||||
onVideoWindowClosed?.call();
|
||||
}
|
||||
}
|
||||
|
||||
NativeCore? get nativeCore => _native;
|
||||
|
||||
bool get isLocalSignalingRunning => _localSignaling.isRunning;
|
||||
|
||||
Reference in new issue
Block a user