diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart index c5775236a..0662fce2b 100644 --- a/flutter/lib/mobile/pages/remote_page.dart +++ b/flutter/lib/mobile/pages/remote_page.dart @@ -582,13 +582,35 @@ class _RemotePageState extends State { value: 'block-input')); } } - if (gFFI.ffiModel.permissions["restart"] != false && + if (perms["restart"] != false && (pi.platform == "Linux" || pi.platform == "Windows" || pi.platform == "Mac OS")) { more.add(PopupMenuItem( child: Text(translate('Restart Remote Device')), value: 'restart')); } + // Currently only support VP9 + if (gFFI.recordingModel.start || + (perms["recording"] != false && + gFFI.qualityMonitorModel.data.codecFormat == "VP9")) { + more.add(PopupMenuItem( + child: Row( + children: [ + Text(translate(gFFI.recordingModel.start + ? 'Stop session recording' + : 'Start session recording')), + Padding( + padding: EdgeInsets.only(left: 12), + child: Icon( + gFFI.recordingModel.start + ? Icons.pause_circle_filled + : Icons.videocam_outlined, + color: MyTheme.accent), + ) + ], + ), + value: 'record')); + } () async { var value = await showMenu( context: context, @@ -630,6 +652,8 @@ class _RemotePageState extends State { gFFI.cursorModel.reset(); } else if (value == 'restart') { showRestartRemoteDevice(pi, widget.id, gFFI.dialogManager); + } else if (value == 'record') { + gFFI.recordingModel.toggle(); } }(); } diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index 79cd7ad54..8e5723588 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -231,7 +231,8 @@ class FfiModel with ChangeNotifier { } else if (type == 'input-password') { enterPasswordDialog(id, dialogManager); } else if (type == 'restarting') { - showMsgBox(id, type, title, text, link, false, dialogManager, hasCancel: false); + showMsgBox(id, type, title, text, link, false, dialogManager, + hasCancel: false); } else { var hasRetry = evt['hasRetry'] == 'true'; showMsgBox(id, type, title, text, link, hasRetry, dialogManager); @@ -1003,16 +1004,16 @@ class RecordingModel with ChangeNotifier { get start => _start; onSwitchDisplay() { - if (!isDesktop || !_start) return; + if (isIOS || !_start) return; var id = parent.target?.id; int? width = parent.target?.canvasModel.getDisplayWidth(); - int? height = parent.target?.canvasModel.getDisplayWidth(); + int? height = parent.target?.canvasModel.getDisplayHeight(); if (id == null || width == null || height == null) return; bind.sessionRecordScreen(id: id, start: true, width: width, height: height); } toggle() { - if (!isDesktop) return; + if (isIOS) return; var id = parent.target?.id; if (id == null) return; _start = !_start; @@ -1025,7 +1026,7 @@ class RecordingModel with ChangeNotifier { } onClose() { - if (!isDesktop) return; + if (isIOS) return; var id = parent.target?.id; if (id == null) return; _start = false;