1v1.wxml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <!-- template 1v1 -->
  2. <template name='1v1'>
  3. <view class="template-1v1">
  4. <view wx:for="{{streamList}}" wx:key="streamID" wx:if="{{item.src && (item.hasVideo || item.hasAudio)}}" class="view-container player-container {{item.isVisible?'':'none'}}">
  5. <live-player
  6. class="player"
  7. id="{{item.streamID}}"
  8. data-userid="{{item.userID}}"
  9. data-streamid="{{item.streamID}}"
  10. data-streamtype="{{item.streamType}}"
  11. src= "{{item.src}}"
  12. mode= "RTC"
  13. autoplay= "{{item.autoplay}}"
  14. mute-audio= "{{item.muteAudio}}"
  15. mute-video= "{{item.muteVideo}}"
  16. orientation= "{{item.orientation}}"
  17. object-fit= "{{item.objectFit}}"
  18. background-mute= "{{item.enableBackgroundMute}}"
  19. min-cache= "{{item.minCache}}"
  20. max-cache= "{{item.maxCache}}"
  21. sound-mode= "{{item.soundMode}}"
  22. enable-recv-message= "{{item.enableRecvMessage}}"
  23. auto-pause-if-navigate= "{{item.autoPauseIfNavigate}}"
  24. auto-pause-if-open-native= "{{item.autoPauseIfOpenNative}}"
  25. debug="{{debug}}"
  26. bindstatechange="_playerStateChange"
  27. bindfullscreenchange="_playerFullscreenChange"
  28. bindnetstatus="_playerNetStatus"
  29. bindaudiovolumenotify ="_playerAudioVolumeNotify"
  30. />
  31. </view>
  32. <view class="view-container pusher-container {{pusher.isVisible?'':'none'}} {{streamList.length===0? 'fullscreen':''}}">
  33. <live-pusher
  34. class="pusher"
  35. url="{{pusher.url}}"
  36. mode="{{pusher.mode}}"
  37. autopush="{{pusher.autopush}}"
  38. enable-camera="{{pusher.enableCamera}}"
  39. enable-mic="{{pusher.enableMic}}"
  40. muted="{{!pusher.enableMic}}"
  41. enable-agc="{{pusher.enableAgc}}"
  42. enable-ans="{{pusher.enableAns}}"
  43. enable-ear-monitor="{{pusher.enableEarMonitor}}"
  44. auto-focus="{{pusher.enableAutoFocus}}"
  45. zoom="{{pusher.enableZoom}}"
  46. min-bitrate="{{pusher.minBitrate}}"
  47. max-bitrate="{{pusher.maxBitrate}}"
  48. video-width="{{pusher.videoWidth}}"
  49. video-height="{{pusher.videoHeight}}"
  50. beauty="{{pusher.beautyLevel}}"
  51. whiteness="{{pusher.whitenessLevel}}"
  52. orientation="{{pusher.videoOrientation}}"
  53. aspect="{{pusher.videoAspect}}"
  54. device-position="{{pusher.frontCamera}}"
  55. remote-mirror="{{pusher.enableRemoteMirror}}"
  56. local-mirror="{{pusher.localMirror}}"
  57. background-mute="{{pusher.enableBackgroundMute}}"
  58. audio-quality="{{pusher.audioQuality}}"
  59. audio-volume-type="{{pusher.audioVolumeType}}"
  60. audio-reverb-type="{{pusher.audioReverbType}}"
  61. waiting-image="{{pusher.waitingImage}}"
  62. debug="{{debug}}"
  63. bindstatechange="_pusherStateChangeHandler"
  64. bindnetstatus="_pusherNetStatusHandler"
  65. binderror="_pusherErrorHandler"
  66. bindbgmstart="_pusherBGMStartHandler"
  67. bindbgmprogress="_pusherBGMProgressHandler"
  68. bindbgmcomplete="_pusherBGMCompleteHandler"
  69. bindaudiovolumenotify="_pusherAudioVolumeNotify"
  70. />
  71. <view class="loading" wx:if="{{streamList.length === 0}}">
  72. <view class="loading-img">
  73. <image src="./static/loading.png" class="rotate-img"></image>
  74. </view>
  75. <view class="loading-text">等待接听中...</view>
  76. </view>
  77. </view>
  78. <view class="handle-btns">
  79. <view class="btn-normal" bindtap="_toggleAudio">
  80. <image class="btn-image" src="{{pusher.enableMic? './static/audio-true.png': './static/audio-false.png'}} "></image>
  81. </view>
  82. <view class="btn-normal" bindtap="switchCamera" >
  83. <image class="btn-image" src="./static/switch.png"></image>
  84. </view>
  85. <!-- <view class="btn-normal" bindtap="_toggleVideo">
  86. <image class="btn-image" src="{{pusher.enableCamera? './static/camera-true.png': './static/camera-false.png'}} "></image>
  87. </view> -->
  88. <view class="btn-normal" bindtap="_toggleSoundMode">
  89. <image class="btn-image" src="{{streamList[0].soundMode === 'ear' ? './static/phone.png': './static/speaker-true.png'}} "></image>
  90. </view>
  91. </view>
  92. <view class="bottom-btns">
  93. <view class="btn-normal" data-key="beautyLevel" data-value="9|0" data-value-type="number" bindtap="_setPuserProperty">
  94. <image class="btn-image" src="{{pusher.beautyLevel == 9 ? './static/beauty-true.png': './static/beauty-false.png'}} "></image>
  95. </view>
  96. <view class="btn-hangup" bindtap="_hangUp">
  97. <image class="btn-image" src="./static/hangup.png"></image>
  98. </view>
  99. <view class="btn-normal" bindtap="_toggleIMPanel">
  100. <image class="btn-image" src="{{enableIM? './static/im.png': './static/im-disable.png'}}"></image>
  101. </view>
  102. </view>
  103. </view>
  104. </template>