HarmonyOS 鸿蒙Next根据官网提供的代码进行录像时报错

发布于 1周前 作者 nodeper 来自 鸿蒙OS

HarmonyOS 鸿蒙Next根据官网提供的代码进行录像时报错

使用官网的 https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/camera-recording-case-V5 这个代码例子真机调试时报错 

prepare call failed. error code: {“code”:5400102,“name”:“BusinessError”}

getInputSurface call failed. error code: {“code”:5400102,“name”:“BusinessError”}

看官网说 操作不允许,到底是为什么不允许也不知道
这个是权限列表 

“requestPermissions”: [
{
“name”: “ohos.permission.INTERNET”
},
{
“name”: “ohos.permission.RECORD_AUDIO”
},
{
“name”: “ohos.permission.GET_NETWORK_INFO”
},
{
“name”: “ohos.permission.WRITE_MEDIA”,
“reason”: “$string:app_name”,
“usedScene”: {
“abilities”: [
“FormAbility”
],
“when”: “always”
}
},
{
“name”: “ohos.permission.MEDIA_LOCATION”,
“reason”: “$string:app_name”,
“usedScene”: {
“abilities”: [
“FormAbility”
],
“when”: “always”
}
},
{
“name”: “ohos.permission.MICROPHONE”,
“reason”: “$string:app_name”,
“usedScene”: {
“abilities”: [
“FormAbility”
],
“when”: “always”
}
},
{
“name”: “ohos.permission.CAMERA”,
“reason”: “$string:app_name”,
“usedScene”: {
“abilities”: [
“FormAbility”
],
“when”: “always”
}
},
{
“name”: “ohos.permission.READ_MEDIA”,
“reason”: “$string:app_name”,
“usedScene”: {
“abilities”: [
“FormAbility”
],
“when”: “always”
}
}
]

希望能帮忙解答下



关于HarmonyOS 鸿蒙Next根据官网提供的代码进行录像时报错的问题,您也可以访问:https://www.itying.com/category-93-b0.html 联系官网客服。

1 回复
1、录音、相机是敏感权限,需要做弹窗用户授权。 2、录制时间需要长一点,写入的路径需要是真实的。
回到顶部