avatar-demo.axml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <view>
  2. <view class="{{'main-center-fullscreen'}}">
  3. <rtc-room
  4. class="{{'rtcroom-full-screen'}}"
  5. id="{{elementId}}"
  6. roomId="{{webrtcInfo.roomId}}"
  7. token="{{webrtcInfo.rtoken}}"
  8. userId="{{webrtcInfo.uid}}"
  9. signature="{{webrtcInfo.signature}}"
  10. extraInfo="{{extraInfo}}"
  11. enable-camera="{{false}}"
  12. mute="{{true}}"
  13. onRoomInfo="onRoomInfo"
  14. onEnterRoom = "onEnterRoom"
  15. onError="onError"
  16. onFirstRender = "onFirstRender"
  17. onReceiveMessage = "onReceiveMessage"
  18. />
  19. <view class="chat-box">
  20. <scroll-view id="scrollView" scroll-y="true" style="max-height:300px" scroll-top="{{scrollTop}}">
  21. <block a:for="{{chatList}}">
  22. <view id="message-{{index}}" style="line-height: 30px;word-wrap: break-word;color: {{item.type== 0?'red':''}}">{{['','Q:','A:'][item.type]}}{{item.text}}</view>
  23. </block>
  24. </scroll-view>
  25. </view>
  26. <view class="btnContainer">
  27. <button type="default" class="btn-avatar" onTap="startAsr" plain>开始录音</button>
  28. <button type="default" class="btn-avatar" onTap="interrupt" plain>打断</button>
  29. <button type="default" class="btn-avatar" onTap="stopAsr" plain>停止录音</button>
  30. <button type="default" class="btn-avatar" onTap="onClear" plain>清空</button>
  31. <button type="default" class="btn-avatar" style="flex:1" onTap="query2" plain>你是谁</button>
  32. <button type="default" class="btn-avatar" style="flex:1" onTap="query1" plain>今天天气怎么样</button>
  33. <!-- <button type="default" class="btn-avatar" onTap="stopLive" plain>关闭流服务</button>-->
  34. </view>
  35. </view>
  36. </view>