当前位置:网站首页>Why does the remote end receive a check-out notice when the TRTC applet turns off audio and video locally

Why does the remote end receive a check-out notice when the TRTC applet turns off audio and video locally

2022-06-24 06:36:00 sskingss

TRTC The applet will automatically switch identities , If there is no local audio and video uplink , Will automatically switch to the identity of the audience ( After all, it is impossible to maintain a large room with tens of thousands of people userList, It's hard to make a loop in a small program )

So in this context , What to do if there is a strict distinction between the anchor scenes ,

keep enable-mic by true, adopt muted Property to set the mute , In this way, the host location will not be changed in the background , The remote end will not receive a check-out notice

this.setData({
  pusher: this.setPusherAttributes({muted: true})
})
live-pusher attribute

To bind this property to live-pusher On

//page.wxml
<live-pusher
  class="pusher"
  url="{{pusher.url}}"
  mode="{{pusher.mode}}"
  autopush="{{pusher.autopush}}"
  enable-camera="{{pusher.enableCamera}}"
  enable-mic="{{pusher.enableMic}}"
  muted="{{!pusher.muted}}" //  Here we need to control them separately 
  enable-agc="{{pusher.enableAgc}}"
  enable-ans="{{pusher.enableAns}}"
  enable-ear-monitor="{{pusher.enableEarMonitor}}"
  auto-focus="{{pusher.enableAutoFocus}}"
  zoom="{{pusher.enableZoom}}"
  min-bitrate="{{pusher.minBitrate}}"
  max-bitrate="{{pusher.maxBitrate}}"
  video-width="{{pusher.videoWidth}}"
  video-height="{{pusher.videoHeight}}"
  beauty="{{pusher.beautyLevel}}"
  whiteness="{{pusher.whitenessLevel}}"
  orientation="{{pusher.videoOrientation}}"
  aspect="{{pusher.videoAspect}}"
  device-position="{{pusher.frontCamera}}"
  remote-mirror="{{pusher.enableRemoteMirror}}"
  local-mirror="{{pusher.localMirror}}"
  background-mute="{{pusher.enableBackgroundMute}}"
  audio-quality="{{pusher.audioQuality}}"
  audio-volume-type="{{pusher.audioVolumeType}}"
  audio-reverb-type="{{pusher.audioReverbType}}"
  waiting-image="{{pusher.waitingImage}}"
  beauty-style="{{pusher.beautyStyle}}"
  filter="{{pusher.filter}}"
  bindstatechange="_pusherStateChangeHandler"
  bindnetstatus="_pusherNetStatusHandler"
  binderror="_pusherErrorHandler"
  bindbgmstart="_pusherBGMStartHandler"
  bindbgmprogress="_pusherBGMProgressHandler"
  bindbgmcomplete="_pusherBGMCompleteHandler"
  bindaudiovolumenotify="_pusherAudioVolumeNotify"
  />

Anchor's enable-mic The control of can always be true, And then through muted Controls whether to uplink , Audience's enableMic and enableCamera Can never false

原网站

版权声明
本文为[sskingss]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/07/20210713164858860u.html