收藏
回答

小程序live-player安卓播放无声音?

安卓微信版本8.0.35,ios微信版本8.0.37,通话过程中不断收到 audiovolumenotify 事件,安卓手机中 event.detail.volume值一直为0,所有的声音权限都是有的,ios正常,组件部分代码如下:

<view class="player-wrapper">
  <live-player
          hidden="{{playConfig.hidden}}"
          id="{{playerId}}"
          src="{{playConfig.src}}"
          mode="{{playConfig.mode}}"
          autoplay="{{playConfig.autoplay}}"
          muted="{{playConfig.muted}}"
          orientation="{{playConfig.orientation}}"
          object-fit="{{playConfig.objectFit}}"
          min-cache="{{playConfig.minCache}}"
          max-cache="{{playConfig.maxCache}}"
          sound-mode="{{playConfig.soundMode}}"
          picture-in-picture-mode="{{playConfig.pictureInPictureMode}}"
          auto-pause-if-navigate="{{playConfig.autoPauseIfNavigate}}"
          auto-pause-if-open-native="{{playConfig.autoPauseIfOpenNative}}"
          debug="{{playConfig.debug}}"
          bindstatechange="onStateChange"
          bindfullscreenchange="onFullScreenChange"
          bindnetstatus="onNetStateChange"
          bindaudiovolumenotify="onAudioVolumeNotify"
          bindenterpictureinpicture="onEnterPictureInPicture"
          bindleavepictureinpicture="onLeavePictureInPicture"
  >
  <slot></slot>
  </live-player>
</view>

onNetStateChange(event) {
    console.log('onNetStateChange', event)
},
onAudioVolumeNotify(event) {
    console.log('onAudioVolumeNotify', event)
    console.log('playConfig', this.data.playConfig)
},

回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容