• Home
Name Date Size #Lines LOC

..--

AppScope/12-May-2024-3633

entry/12-May-2024-1,141966

screenshots/device/12-May-2024-

.gitignoreD12-May-202456 55

README.mdD12-May-20241 KiB1710

README_zh.mdD12-May-20242.8 KiB6432

build-profile.json5D12-May-20241 KiB4241

hvigorfile.jsD12-May-2024168 21

package-lock.jsonD12-May-202453.5 KiB1,2271,226

package.jsonD12-May-2024341 1818

README.md

1# Screen Recorder
2
3### Introduction
4
5 This sample shows how to use graphic and multi-media APIs to record the device screen
6
7### Usage
8
91. Start the sample Application, touch the **Start** button to start recording. During the recording, you can touch the **float window** button on the top with small red rectangle and recording timer, the recording file will be saved and it can be found in the Gallery Application.
10
11### Constraints
12
131. This sample can only be run on standard-system devices.
142. Please use the "DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.993, built on September 4, 2022)" or later IDE version
153. Use the Full SDK is necessary for this sample, please refer the [guide](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md).
164. How to configure the auto signing with system permission, please refer DevEco Studio: File -> Project Structure -> Project -> Signing Configs(TAB page) , on the bottom of this page, please click the hyperlink of "**View the operation guide**".
17

README_zh.md

1# 录屏示例
2
3### 介绍
4
5 该示例展示设备屏幕(含音频)录制功能。屏幕录制的主要工作是通过创建一个虚拟屏,捕获屏幕显示图形帧,完成视频编码并保存到文件中,帮助OEM设备厂家系统应用实现屏幕录制功能,也可以通过此应用抓取屏幕帧用于问题复现录制。
6
7
8
9### 使用说明
10
111.启动应用,首次启动需要用户授予“**访问媒体和文件**”和“**麦克风**”的权限
12
132.点击**启动**按钮,启动屏幕录制。
14
153.启动录制后会弹出一个透明录制悬浮控件,并显示录制时间计时,此时可以操作屏幕,操作过程屏幕显示会被录制下来。
16
174.需要停止录屏时,点击悬浮半透明的红色按钮,屏幕录制停止。
18
195.打开图库应用,在图库中可以看到最新录屏的媒体文件,点击后可支持录屏回放。
20
21
22
23### 效果预览
24
25实现效果如下:
26
27|获取媒体权限|获取录音权限|应用主界面|录制过程界面|
28|--------------------------------|--------------------------------|--------------------------------|--------------------------------|
29|![image](screenshots/device/user_grant1.png)|![image](screenshots/device/user_grant2.png)|![image](screenshots/device/main.png)|![image](screenshots/device/recording.png)|
30
31
32
33### 相关权限
34
35**权限一:用户授权,访问媒体和文件**
36ohos.permission.MEDIA_LOCATION
37ohos.permission.WRITE_MEDIA
38ohos.permission.READ_MEDIA
39
40**权限二:用户授权,使用麦克风**
41ohos.permission.MICROPHONE
42
43**权限三:系统授权,需要配置为system_basic类型系统应用**
44ohos.permission.SYSTEM_FLOAT_WINDOW
45
46**权限四:系统授权,需要配置为system_core类型系统应用**
47
48ohos.permission.CAPTURE_SCREEN
49
50具体[参考指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)51
52
53
54### 约束与限制
55
561.本示例仅支持标准系统上安装运行。
57
582.本示例需要使用DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.993, built on September 4, 2022)及以上版本才可编译运行。
59
603.本示例需要使用@ohos.screen系统权限的系统接口,使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md)61
624.系统权限的自动化签名指南,可通过打开DevEco Studio中菜单,File -> Project Structure -> Project -> Signing Configs(TAB页最下方蓝色字体) -> “**View the operation guide**” 跳转链接,可支持系统权限的自动签名生成。
63
645.rk设备由于芯片限制,应用中videoFrameWidth,videoFrameHeight,videoFrameRate需同比缩小3/5, 才能实现rk上的播放效果。