1v1.wxml 5.2 KB

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