taro 微信小程序,21 listeners of event 16837430422010.1518999634137368_onAudioStateChange_play have been added, possibly causing memory leak,页面卡顿,进度条拖拽不了

crcmnpdw  于 2个月前  发布在  iOS
关注(0)|答案(1)|浏览(33)

相关平台

微信小程序

复现仓库

https://github.com/yangyan123/jwy-dealer.git
小程序基础库: 2.31.1
使用框架: React

复现步骤

打开音乐播放器,部分播放器获取不到时长,播放一段时间后,控制台提示21 listeners of event 16837430422010.1518999634137368_onAudioStateChange_play have been added, possibly causing memory leak,页面卡顿,进度条拖拽不了,我之前提过一个 https://github.com/NervJS/taro/issues/13793,告诉我出现问题的原因是 innerAudioContext 被频繁初始化了,你需要将初始化的代码挪到 react 组件的外层来进行,我一挪到外层,多个音频更难控制,麻烦哪个好心人帮忙看看,或者有什么好用的音乐播放器插件推荐也可以

期望结果

音乐播放器正常播放,进度条正常拖拽,不卡顿

实际结果

音乐播放器不正常播放,进度条不能拖拽,卡顿

环境信息

👽 Taro v3.6.2

  Taro CLI 3.6.2 environment info:
    System:
      OS: macOS 12.4
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.13.0 - /usr/local/bin/node
      Yarn: 1.22.19 - ~/.npm-global/bin/yarn
      npm: 9.2.0 - ~/.npm-global/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.2 => 3.6.2 
      @tarojs/components: 3.6.2 => 3.6.2 
      @tarojs/helper: 3.6.2 => 3.6.2 
      @tarojs/plugin-framework-react: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-alipay: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-h5: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-jd: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-qq: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-swan: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-tt: 3.6.2 => 3.6.2 
      @tarojs/plugin-platform-weapp: 3.6.2 => 3.6.2 
      @tarojs/react: 3.6.2 => 3.6.2 
      @tarojs/runtime: 3.6.2 => 3.6.2 
      @tarojs/shared: 3.6.2 => 3.6.2 
      @tarojs/taro: 3.6.2 => 3.6.2 
      @tarojs/webpack5-runner: 3.6.2 => 3.6.2 
      babel-preset-taro: 3.6.2 => 3.6.2 
      eslint-config-taro: 3.6.2 => 3.6.2 
      react: ^18.0.0 => 18.2.0

相关问题