audio-template.wxml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <!-- 语音通话模版占位样式 您应根据自己的业务需要进行调整 -->
  2. <template name="audio-template">
  3. <view class="audio-place-holder">
  4. <view class="{{'TRTCCalling-call-audio-img' + streamList.length}}">
  5. <image src="./static/avatar1_100.png" class="img-place-holder">
  6. <view class="audio-volume">
  7. <image wx:if="{{pusherConfig.volume>10}}" class="image" src="./static/micro-open.png"></image>
  8. </view>
  9. </image>
  10. </view>
  11. <view class="{{'TRTCCalling-call-audio-img' + streamList.length}}" wx:for="{{streamList}}" wx:key="userID">
  12. <image src="./static/avatar2_100.png" class="img-place-holder">
  13. <view class="audio-volume">
  14. <image wx:if="{{item.volume>10}}" class="image" src="./static/micro-open.png"></image>
  15. </view>
  16. </image>
  17. </view>
  18. <live-pusher
  19. class="pusher-audio"
  20. id="pusher"
  21. mode="RTC"
  22. autopush="{{true}}"
  23. url="{{pusherConfig.pushUrl}}"
  24. audio-volume-type="voicecall"
  25. enable-camera="{{false}}"
  26. enable-mic="{{true}}"
  27. bindstatechange="_pusherStateChangeHandler"
  28. bindaudiovolumenotify="_pusherAudioVolumeNotify"
  29. />
  30. <view wx:for="{{streamList}}" wx:key="streamID" class="view-container player-container player-audio">
  31. <live-player
  32. class="player-audio"
  33. id="{{item.streamID}}"
  34. data-userid="{{item.userID}}"
  35. data-streamid="{{item.streamID}}"
  36. data-streamtype="{{item.streamType}}"
  37. src= "{{item.src}}"
  38. mode= "RTC"
  39. object-fit="fillCrop"
  40. autoplay= "{{true}}"
  41. mute-video="{{true}}"
  42. mute-audio="{{item.muteAudio}}"
  43. min-cache= "0.2"
  44. max-cache= "0.8"
  45. sound-mode= "{{soundMode}}"
  46. auto-pause-if-navigate= "{{item.autoPauseIfNavigate}}"
  47. auto-pause-if-open-native= "{{item.autoPauseIfOpenNative}}"
  48. bindstatechange="_playerStateChange"
  49. bindaudiovolumenotify="_playerAudioVolumeNotify"
  50. />
  51. </view>
  52. </view>
  53. <view class="handle-btns">
  54. <view class="btn-normal" bindtap="_toggleAudio">
  55. <image class="btn-image" src="{{pusherConfig.enableMic ? './static/audio-true.png': './static/audio-false.png'}} "></image>
  56. </view>
  57. <view class="btn-hangup" bindtap="_hangUp">
  58. <image class="btn-image" src="./static/hangup.png"></image>
  59. </view>
  60. <view class="btn-normal" bindtap="_toggleSoundMode">
  61. <image class="btn-image" src="{{soundMode === 'ear' ? './static/phone.png': './static/speaker-true.png'}} "></image>
  62. </view>
  63. </view>
  64. </template>