video-template.wxml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template name="video-template">
  2. <live-pusher
  3. class="pusher-video"
  4. id="pusher"
  5. autopush="{{true}}"
  6. url="{{pusherConfig.pushUrl}}"
  7. enable-camera="{{pusherConfig.enableCamera}}"
  8. audio-volume-type="voicecall"
  9. beauty="5"
  10. enable-mic="{{true}}"
  11. bindstatechange="_pusherStateChangeHandler"
  12. bindaudiovolumenotify="_pusherAudioVolumeNotify"
  13. />
  14. <view wx:for="{{streamList}}" wx:key="streamID" class="view-container player-container">
  15. <live-player
  16. class="{{'player'+streamList.length}}"
  17. id="{{item.streamID}}"
  18. data-userid="{{item.userID}}"
  19. data-streamid="{{item.streamID}}"
  20. data-streamtype="{{item.streamType}}"
  21. src= "{{item.src}}"
  22. mode= "RTC"
  23. object-fit="fillCrop"
  24. autoplay= "{{true}}"
  25. mute-video="{{item.muteVideo}}"
  26. mute-audio="{{item.muteAudio}}"
  27. min-cache= "0.2"
  28. max-cache= "0.8"
  29. sound-mode= "{{soundMode}}"
  30. auto-pause-if-navigate= "{{item.autoPauseIfNavigate}}"
  31. auto-pause-if-open-native= "{{item.autoPauseIfOpenNative}}"
  32. bindstatechange="_playerStateChange"
  33. bindaudiovolumenotify ="_playerAudioVolumeNotify"
  34. />
  35. </view>
  36. <view class="handle-btns">
  37. <view class="btn-normal" bindtap="_toggleAudio">
  38. <image class="btn-image" src="{{pusherConfig.enableMic? './static/audio-true.png': './static/audio-false.png'}} "></image>
  39. </view>
  40. <view class="btn-hangup" bindtap="_hangUp">
  41. <image class="btn-image" src="./static/hangup.png"></image>
  42. </view>
  43. <view class="btn-normal" bindtap="_toggleSoundMode">
  44. <image class="btn-image" src="{{soundMode === 'ear' ? './static/phone.png': './static/speaker-true.png'}} "></image>
  45. </view>
  46. </view>
  47. </template>