已开启
feat(screenrecorder): 录屏前增加音频模式选择弹窗与3-2-1倒计时 #10
feat(screenrecorder): 录屏前增加音频模式选择弹窗与3-2-1倒计时 #10
已开启
fbfb创建于 18 天前
fbfb
18 天前

一、内容说明(相关的Issue)

https://gitcode.com/openharmony/applications_screenrecorder/issues/9

phone 产品在启动录屏前先弹出选项弹窗(声音模式二选一 + 显示触摸白点复选框),点“开始录制”后进行 3、2、1 倒计时再正式起录;取消则不启动录屏。弹窗与倒计时窗口在采集启动前销毁,不会出现在录制的视频中。

二、建议测试周期和提测地址

建议测试完成时间:2026.11.06
投产上线时间:随版本发布计划
提测地址:本 PR CI 门禁构建产物 / DevEco Studio 本地编译
测试账号:无

三、变更内容

  • 3.1 关联PR列表
    无

  • 3.2 数据库和部署说明

    1. 常规更新
    2. 无需重启服务
    3. 无需重启服务
    4. 迁移任务:无
    5. rake脚本:无
  • 3.4 其他技术优化内容(做了什么,变更了什么)

    • 新增 RecordOptionsManager:通过 ServiceExtensionAbility 上下文创建全屏 TYPE_SCREENSHOT 系统窗承载弹窗,以 Promise 等待用户选择;确认后将结果写入既有偏好 isMicEnabled / showTouchState,由现有机制在录制初始化与胶囊创建时生效,停止录屏后恢复系统原显示触摸设置
    • 新增 RecordOptionsDialog 组件与 RecordOptionsPage 页面(含 3-2-1 倒计时动效),页面仅注册到 phone 产品 main_pages.json
    • 触发链路:ExtAbilityProxy.triggerRecorder() 在未处于录屏状态时先 await 弹窗结果,取消则走 postKillProcessMessage() 退出,确认则沿用原 recordManager.trigger() 启动录制
    • 窗口获焦时序复用工程内胶囊窗方案(显示前 focusable(false),显示后延时 100ms 置 focusable(true)),避免影响底层界面焦点
    • 新增 6 条资源字符串(base/zh_CN),覆盖弹窗全部文案
    • 记住上次选择,下次打开弹窗时预选
  • 3.5 废弃通知(什么字段、方法弃用?)
    无

  • 3.6 后向不兼容变更(是否有无法向后兼容的变更?)
    无(未修改任何对外接口;控制中心二级页的原有开关与胶囊切换能力不变,偏好键复用)

四、研发自测点(自测哪些?冒烟用例全部自测?)

自测测试结论:RT80 真机(DevEco Studio 编译 phone 产品 HAP 安装)全部通过

  • 控制中心触发录屏 → 弹窗正常显示,选项切换正常
  • 取消 / 点击遮罩空白处 → 弹窗关闭,不启动录屏,进程正常退出
  • 选择“媒体声音和麦克风” + 勾选白点 → 倒计时 3-2-1 后起录,视频含麦克风声音与触摸白点
  • 选择“媒体声音” → 视频不含麦克风声音
  • 再次触发 → 预选上次的选择
  • 录制中胶囊通知(时长/停止/麦克风/白点切换)、停止后预览缩略图、锁屏/息屏停止等原有链路无回归
  • 弹窗与倒计时不包含在录制的视频文件中

五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方)

检查点:

需求名称 影响范围 是否需要新权限 是否依赖其他子系统
录屏前置选项弹窗 仅 phone 产品触发链路 不需要(复用 MICROPHONE/CAPTURE_SCREEN) 不依赖

接口测试:无对外接口变更

性能测试:弹窗窗口触发时才创建,取消/开始后即销毁;倒计时约 3s,起录耗时可接受

并发测试:连续快速触发录屏(已有 isProcessing/最小间隔防抖)不会叠加弹窗

其他:

  • 已知限制:弹窗暂不提供“无声音”选项——AVScreenCaptureRecorder 只有 setMicEnabled 接口、无法关闭设备内录,待媒体子系统提供内录开关 API 后再补充该选项
  • pad/PC 形态本次未接入,后续扩展
likedislike
合并受阻
openharmony_ciopenharmony_ci成员
18 天前 添加了label:waiting_on_author
openharmony_ci
openharmony_ci成员
18 天前 评论:

感谢提交 Pull Requests!如果您提交的PR已经开发完毕,请评论 "start build" 触发门禁,更多交互操作,请访问OpenHarmony社区支持命令清单。如果需要调整订阅PR、Issue的变更状态,请访问订阅链接。


Thanks for submitting the pull request. If your Pull Request has already been developed, you can leave a "start build" comment to trigger the gated system. For more commands, please visit OpenHarmony Command List. If you need to change the subscription of a Pull Request or Issue, please visit the link.

likedislike
openharmony_ciopenharmony_ci成员
18 天前 添加了label:dco检查成功
fbfb
17 天前 评论:

start build

likedislike
openharmony_ci
openharmony_ci成员
17 天前 评论:

该提交没有关联任何Issue,请先关联一个Issue后再触发构建
The PR is not associated with any Issue, Please associate the PR with one Issue before trigger build.

likedislike
Ffbfb
17 天前 修改了pull request 的描述
fbfb
17 天前 评论:

start build

likedislike
openharmony_ci
openharmony_ci成员
17 天前 评论:

首次触发
门禁构建开始,包含静态检查、代码编译【hap_build编译, master_inner_build编译, x86_64_virt编译】,预计在60分钟内完成,门禁结果会同步发送到注册邮箱。您可以通过如下链接跟踪门禁进展:http://dcp.openharmony.cn/workbench/cicd/detail/6ad1c2b864650f998bf0a92d/runlist

likedislike
openharmony_ciopenharmony_ci成员
17 天前 添加了label:静态检查失败
openharmony_ci
openharmony_ci成员
17 天前 评论:

代码门禁未通过
您可以通过如下链接查看门禁报告:http://dcp.openharmony.cn/workbench/cicd/detail/6ad1c2b864650f998bf0a92d/runlist

静态检查:

# check type result report
1 codeCheck noPass >>>

编译测试:
# Device build result package
1 hap_build pending NA
2 master_inner_build pending NA
3 x86_64_virt pending NA

likedislike
Ffbfb
17 天前 推送  1 个提交:214a0f14-fix(screenrecorder): drop unavailable no-sound option and reword comments
openharmony_ciopenharmony_ci成员
17 天前 删除了label:静态检查失败
openharmony_ci
openharmony_ci成员
17 天前 评论:

代码有更新,重置PR验证状态

likedislike
openharmony_ci
openharmony_ci成员
17 天前 评论:

感谢提交 Pull Requests!如果您提交的PR已经开发完毕,请评论 "start build" 触发门禁,更多交互操作,请访问OpenHarmony社区支持命令清单。如果需要调整订阅PR、Issue的变更状态,请访问订阅链接。


Thanks for submitting the pull request. If your Pull Request has already been developed, you can leave a "start build" comment to trigger the gated system. For more commands, please visit OpenHarmony Command List. If you need to change the subscription of a Pull Request or Issue, please visit the link.

likedislike
Ffbfb
17 天前 修改了pull request 的描述
fbfb
17 天前 评论:

start build

likedislike
openharmony_ci
openharmony_ci成员
17 天前 评论:

本地或库上代码有更新,全量重新构建,重置所有关联PR的验证状态
门禁构建开始,包含静态检查、代码编译【hap_build编译, x86_64_virt编译, master_inner_build编译】,预计在60分钟内完成,门禁结果会同步发送到注册邮箱。您可以通过如下链接跟踪门禁进展:http://dcp.openharmony.cn/workbench/cicd/detail/6ad1c9d964650f998bf3f3af/runlist

likedislike
openharmony_ciopenharmony_ci成员
17 天前 添加了label:编译成功
openharmony_ciopenharmony_ci成员
17 天前 添加了label:静态检查成功
openharmony_ciopenharmony_ci成员
17 天前 通过测试
openharmony_ci
openharmony_ci成员
17 天前 评论:

代码门禁通过
您可以通过如下链接查看门禁报告:http://dcp.openharmony.cn/workbench/cicd/detail/6ad1c9d964650f998bf3f3af/runlist

静态检查:

# check type result report
1 codeCheck pass >>>

编译测试:
# Device build result package
1 hap_build success >>>
2 master_inner_build success(IGNORE) >>>
3 x86_64_virt success >>>

likedislike
openharmony_ciopenharmony_ci成员
17 天前 删除了label:waiting_on_author
openharmony_ciopenharmony_ci成员
17 天前 添加了label:waiting_for_review
openharmony_ci
openharmony_ci成员
17 天前 评论:

您好,Committer @xx20cw @peizheng ,请分配检视人员检视该PR,可以通过命令"assign [@someone_id]"分配检视人员,也可以直接评论"assign"分配给自己进行检视。


Hello, Committer @xx20cw @peizheng . Please assign someone to review the PR. You can assign a reviewer by using the command "assign [@someone_id]", or you can comment "assign" to review the PR by yourself.

likedislike