小程序
小游戏
企业微信
微信支付
扫描小程序码分享
显示的是截图成功,不知道为什么getImageInfo会报错,安卓,ios是正常的,现在是还没支持鸿蒙系统吗,微信版本8.0.13
4 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
我也碰到了这个问题,这个现在有解决吗
代码片段:
const wx_pusher = wx.createLivePusherContext("wx_pusher") //推流成功,视频接通后 截图 wx_pusher.snapshot({ sourceType: 'view', complete:(e)=>{ if (e.tempImagePath) { resolve(e) // 鸿蒙系统返回 {"errno":0,"tempImagePath":"wxfile://tmp_PkEgiO.jpg","width":xx,"height":xx} // 正常手机返回 {"errno":0,"tempImagePath":"wxfile://tmp_e0a2a504360f7bd7c53c8cfc383648e37d2863918a57aa32.jpg","width":xx,"height":xx} wx.getImageInfo({ src: res.tempImagePath, success: async function (ress) { // 鸿蒙系统返回 {"errMsg": "getlmagelnfo:fail:get image info failed"} //正常手机返回 {width: 1080, orientation: "up", type: "jpeg", height: 2150, errMsg: "getImageInfo:ok", …} }}) } else { reject(e) } } })
本回答由AI生成,可能已过期、失效或不适用于当前情形,请谨慎参考
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
const wx_pusher = wx.createLivePusherContext("wx_pusher")
//推流成功,视频接通后 截图
wx_pusher.snapshot({
sourceType: 'view',
complete:(e)=>{
if (e.tempImagePath) {
resolve(e)
// 鸿蒙系统返回 {"errno":0,"tempImagePath":"wxfile://tmp_PkEgiO.jpg","width":xx,"height":xx}
// 正常手机返回 {"errno":0,"tempImagePath":"wxfile://tmp_e0a2a504360f7bd7c53c8cfc383648e37d2863918a57aa32.jpg","width":xx,"height":xx}
wx.getImageInfo({
src: res.tempImagePath,
success: async function (ress) {
// 鸿蒙系统返回
{"errMsg": "getlmagelnfo:fail:get image info failed"}
//正常手机返回
{width: 1080, orientation: "up", type: "jpeg", height: 2150, errMsg: "getImageInfo:ok", …}
}})
} else {
reject(e)
}
}
})
我也碰到了这个问题,这个现在有解决吗
代码片段:
const wx_pusher = wx.createLivePusherContext("wx_pusher") //推流成功,视频接通后 截图 wx_pusher.snapshot({ sourceType: 'view', complete:(e)=>{ if (e.tempImagePath) { resolve(e) // 鸿蒙系统返回 {"errno":0,"tempImagePath":"wxfile://tmp_PkEgiO.jpg","width":xx,"height":xx} // 正常手机返回 {"errno":0,"tempImagePath":"wxfile://tmp_e0a2a504360f7bd7c53c8cfc383648e37d2863918a57aa32.jpg","width":xx,"height":xx} wx.getImageInfo({ src: res.tempImagePath, success: async function (ress) { // 鸿蒙系统返回 {"errMsg": "getlmagelnfo:fail:get image info failed"} //正常手机返回 {width: 1080, orientation: "up", type: "jpeg", height: 2150, errMsg: "getImageInfo:ok", …} }}) } else { reject(e) } } })