热门问题
待回答
最新问题
热门回答
  • 1

    回答

    742

    浏览
    HarmonyOS vibrator如何自定义震动时长

    使用vibrator过程中,希望能够自定义震动时长,但官方文档中只有震动1000ms和震动35ms选项

    HarmonyOS
      superinsect 进行了回答 • 2024-12-25 19:27:58
  • 1

    回答

    924

    浏览
    HarmonyOS SoundPool播放rawfile音频失败
    HarmonyOS
      fox280 进行了回答 • 2024-12-25 19:27:38
  • 1

    回答

    1029

    浏览
    HarmonyOS AVPlayer设置surfaceId报错

    XComponent({id:'xxx',type:XComponentType.SURFACE})this.avpPlayer.surfaceId'xxx';调用报错:{"code":401,"msg":"InvalidParameter:SurfaceUtilscannotconvertIDtoSurface"}

    HarmonyOS
      shlp 进行了回答 • 2024-12-25 19:27:27
  • 1

    回答

    1190

    浏览
    HarmonyOS 卡证识别类问题

    1.卡证识别保存路径file:…的图片保存时间是多久?2.图片能否通过代码删除?3.该图片其他app能访问吗?

    HarmonyOS
      Heiang 进行了回答 • 2024-12-25 19:27:22
  • 1

    回答

    976

    浏览
    HarmonyOS photoViewPicker传入RecommendationType不生效

    按照官方API说明,在使用PhotoViewPicker时传入RecommendationType,如二维码类型,未在相册中对二维码图片进行筛选。

    HarmonyOS
      put_get 进行了回答 • 2024-12-25 19:27:16
  • 1

    回答

    778

    浏览
    HarmonyOS AVPlayer在暂停或完成状态下重新设置surfaceId后,没有画面

    AVPlayer在PAUSED或者COMPLETED状态下,重新赋值surfaceId,没有画面,重新播放才会有视频画面。

    HarmonyOS
      zbw_apple 进行了回答 • 2024-12-25 19:27:15
  • 1

    回答

    778

    浏览
    HarmonyOS 打开默认界面扫描,用户主动关闭页面没有回调

    打开默认界面扫描,用户主动关闭页面没有回调。scanBarcode.startScanForResult(getContext(this),options)API12

    HarmonyOS
      aquaa 进行了回答 • 2024-12-25 19:27:13
  • 1

    回答

    950

    浏览
    HarmonyOS 把系统的图片及视频资源提取到app中展示用什么Api可以实现?

    在不需要额外申请权限的情况下怎么读取系统的图片及视频资源在App中展示。暂时用的api是photoAccessHelper,但是需要申请ohos.permission.READIMAGEVIDEO。

    HarmonyOS
      aquaa 进行了回答 • 2024-12-25 19:27:02
  • 1

    回答

    976

    浏览
    HarmonyOS 自定义扫一扫功能

    自定义扫一扫相机流是否可以控制开启关闭,释放掉之后如何重新调取相机流。变焦比好像无法无法实现实时的进行修改与效果展示,捏合事件改变变焦比,无法呈现效果。熄屏就会关闭相机流是否可以强制保持,或者有什么方式保持息屏相机流保持。

    HarmonyOS
      superinsect 进行了回答 • 2024-12-25 19:26:55
  • 1

    回答

    760

    浏览
    HarmonyOS 读取相册文件问题咨询

    在开发一个选取照片上传的功能,读取uri的代码一直不返回,导致无法上传,请问是怎么回事呢?代码如下:privateasyncgetConvertUploadUri(params:UploadParams,uri:string,customFileName:string):Promise{if(MediaUtils.isNormalPicture(uri)&&params.mIsCompressPictrue){压缩;letmimeMediaUtils.getPictureMime(uri)LogUtils.info(TAG,"upload获取mime"+mime+"开始open原始文件准备压缩..."+uri)letfileawaitfs.open(uri,fs...

    HarmonyOS
      shlp 进行了回答 • 2024-12-25 19:26:54
  • 1

    回答

    1176

    浏览
    HarmonyOS 使用XComponent和AvPlayer播放视频出现有声音无画面问题

    参考代码:Row(){XComponent({id:'xcomponent',type:XComponentType.SURFACE,controller:this.xcomponentController}).onLoad((){this.surfaceIDthis.xcomponentController.getXComponentSurfaceId()Logger.info(TAG,"surfaceId"+this.surfaceID);this.xComponentContextthis.xcomponentController.getXComponentContext()asRecordvoidletsurfaceRect:SurfaceRect{offsetX:0,offsetY:0,surfaceWidth:500,surfaceHeight:500}this...

    HarmonyOS
      superinsect 进行了回答 • 2024-12-25 19:26:51
  • 1

    回答

    1319

    浏览
    HarmonyOS 音频播放组件解决方案

    应用核心功能是音频播放。想实现网络资源的流下载,缓存,解码,自定义音频的解密处理,播放,上述一系列的能力,并且是以数据流的形式。正在寻求相似的工具,分析了平台推荐的ijkPlayer,并没有发现缓存和自定义音频数据处理的功能。如果将上述能力拆分,在HarmonyOS原生平台是有提供网络下载,文件写入,解码,播放的各能力,自己组装起来会比较耗时。

    HarmonyOS
      Heiang 进行了回答 • 2024-12-25 19:26:50
  • 1

    回答

    1060

    浏览
    HarmonyOS Image及ImageSpan组件是否可支持APNG

    APNG动图在HarmonyOS上无法播放,仅展示首帧在部分场景下需要展示动态图片,APNG因透明度支持好故替代了GIF图片

    HarmonyOS
      Excelsior_abit 进行了回答 • 2024-12-25 19:26:48
  • 1

    回答

    879

    浏览
    HarmonyOS SoundPool循环播放,循环之间会有停顿,如何设置?

    letplayParameters:media.PlayParameters{loop:1,无限循环rate:audio.AudioRendererRate.RENDERRATENORMAL,正常倍速leftVolume:1,range0.01.0rightVolume:1,range0.01.0priority:100,最低优先级}this.soundPool.play(this.soundID,playParameters,(error:BusinessError,streamId:number){if(error){console.error(Failedtoplaysoundpool:errCodeis${error.code},errMessageis${error.message})}else{streamIDstreamId;console.info('Succeededinplayingsoundpool,streamId:'+streamId);}});每次播放完一遍,会停顿一下,然后再播放,请问如何无缝衔接循环播放?

    HarmonyOS
      put_get 进行了回答 • 2024-12-25 19:26:20
  • 1

    回答

    1052

    浏览
    HarmonyOS avplayer错误码好像不对

    服务端未开播的时候去连,返回的错误码是5400106,对照开发文档中给出的错误码,是不支持该格式的意思。

    HarmonyOS
      aquaa 进行了回答 • 2024-12-25 19:26:04
  • 1

    回答

    945

    浏览
    HarmonyOS h5页面如何接入智能图片picker
    HarmonyOS
      aquaa 进行了回答 • 2024-12-25 19:25:25
  • 1

    回答

    1062

    浏览
    HarmonyOS 如何实现定时本地通知

    想要实现类似用户设定几天后固定时间提醒产检的本地通知功能。遇到的问题:1、使用notificationManager.publish指定deliveryTime好像没有用,都是直接发送了,是使用reminderAgentManager这个么,可以给一个例子吗。2、点击通知需要打开指定页面,现在使用的是Navigation路由管理页面,应该如何定义wantAgent

    HarmonyOS
      Excelsior_abit 进行了回答 • 2024-12-25 19:25:24
  • 1

    回答

    1273

    浏览
    HarmonyOS H265视频无法播放

    importabilityAccessCtrlfrom'ohos.abilityAccessCtrl';import{BusinessError}from'ohos.base';importcommonfrom'ohos.app.ability.common';EntryComponentstructIndex{Statemessage:string'HelloWorld';build(){RelativeContainer(){显示消息的文本组件Text(this.message).id('HelloWorld').fontSize(50).fontWeight(FontWeight.Bold).alignRules({center:{anchor:'container',align:VerticalAlign.Center},middle:{anchor:'co...

    HarmonyOS
      Heiang 进行了回答 • 2024-12-25 19:25:00
  • 1

    回答

    1683

    浏览
    HarmonyOS AVPlayer创建失败,5400102是什么原因?

    https:developer.huawei.comconsumercndocharmonyosreferencesV5errorcodemediaV5section5400102当前状态机不支持此操作这个错误码是什么原因呢?该怎么解决?

    HarmonyOS
      Heiang 进行了回答 • 2024-12-25 19:24:53
  • 1

    回答

    820

    浏览
    HarmonyOS 快门声音怎么实现

    拍照时需要开启快门声音。

    HarmonyOS
      Heiang 进行了回答 • 2024-12-25 19:24:36
  • 1

    回答

    1196

    浏览
    HarmonyOS 本地推送没有提示

    创建本地推送的时候,没有任何的提示,如何创建才能给用户提示有新消息呢?创建代码在下方asyncpushTest(){letimgawaitgetContext(this).resourceManager.getMediaContent($r('app.media.nbicon'));letimageSource:image.ImageSourceimage.createImageSource(img.buffer.slice(0));letdecodingOptions:image.DecodingOptions{editable:true,desiredPixelFormat:3,}创建pixelMapleticon:image.PixelMapundefinedawaitimageSource...

    HarmonyOS
      Excelsior_abit 进行了回答 • 2024-12-25 19:24:17
  • 1

    回答

    1082

    浏览
    HarmonyOS 银行卡识别canIUse问题

    如图,提示使用canIUse判断是否可用,但是调用canIUse(‘CardRecognition’)会返回false,明明是可用的。

    HarmonyOS
      superinsect 进行了回答 • 2024-12-25 19:24:16
  • 1

    回答

    1690

    浏览
    HarmonyOS 取消http请求

    我在使用kit.NetworkKit时,使用lethttpRequesthttp.createHttp();创建了网络请求。在请求过程中如果想要取消本次请求,我没有找到cancel方法,是否应该调用httpRequest.destroy();?这个就是取消请求吗?我看指南里在请求结束后才调用destroy(),但我在下载的示例代码里又没看到调用这个方法,所以这个destroy是必须调用的吗?如果不调用会有什么问题?总结起来是两个问题:1、取消本次请求,是否是直接调用httpRequest.destro...

    HarmonyOS
      FengTianYa 进行了回答 • 2024-12-25 19:23:54
  • 1

    回答

    938

    浏览
    HarmonyOS 希望对CardRecognition返回的cardImageUri做人证对比

    希望对CardRecognition返回的cardImageUri与另外一张图片做相似度对比,但在获取cardImageUri后,将其转换成pixelMap时报错:image.createImageSource(cardImageUri)返回为undefind。报错代码:import{image}from'kit.ImageKit';constsourceawaitimage.createImageSource(cardImageUri).createPixelMap();请问该如何对CardRecognition返回的cardImageUri做人证对比?

    HarmonyOS
      put_get 进行了回答 • 2024-12-25 19:23:47
  • 1

    回答

    1556

    浏览
    HarmonyOS 代码如何获取imei号
    HarmonyOS
      Heiang 进行了回答 • 2024-12-25 19:23:27
  • 1

    回答

    916

    浏览
    HarmonyOS 如何实现扫脸登录的功能
    HarmonyOS
      zbw_apple 进行了回答 • 2024-12-25 19:23:20
  • 1

    回答

    843

    浏览
  • 1

    回答

    701

    浏览
  • 1

    回答

    1169

    浏览
    HarmonyOS 列表播放视频,平滑切换到全屏播放
    HarmonyOS
      Heiang 进行了回答 • 2024-12-25 19:22:16
  • 1

    回答

    730

    浏览
    HarmonyOS Socket中send是否可以指定编码

    Socket中send发送是否可以指定编码格式?例如,想使用utf8作为编码格式,是否支持指定发送时指定编码格式?类似node中发送:client.write(sendBuffer,‘UTF8’)

    HarmonyOS
      zxjiu 进行了回答 • 2024-12-25 19:22:03
3.8w问题, 4.1w人参与
94%的提问收到了回答

优秀答主

  • 回答了3个问题,0个赞同
  • 回答了3个问题,0个赞同
  • 回答了3个问题,1个赞同
  • 回答了2个问题,0个赞同
  • 回答了2个问题,1个赞同
  • 写回答 帮助更多的人