HarmonyOS AVScreenCapture使用示例?

如题:HarmonyOS AVScreenCapture使用示例?

阅读 524
1 个回答

使用AVScreenCapture录屏保存到文件:https://gitee.com/openharmony/docs/blob/OpenHarmony-5.0-Beta1/zh-cn/application-dev/media/media/using-avscreencapture-for-file.md

{
  "name":"ohos.permission.MICROPHONE",
  "reason":"$string:EntryAbility_desc",
  "usedScene":
  {
    "abilities": ["EntryAbility"],
    "when":"always"
  }
}

需要申请权限如下:

let context = getContext() as common.UIAbilityContext;
abilityAccessCtrl.createAtManager().requestPermissionsFromUser(context, ['ohos.permission.WRITE_MEDIA']).then(() => {
});
logo
HarmonyOS
子站问答
访问
宣传栏