index.wxml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <xr-demo-viewer
  2. title="录屏和截屏"
  3. intro="展示了如何配置并截屏/录屏。"
  4. code=""
  5. >
  6. <xr-basic-share
  7. disable-scroll
  8. id="main-frame"
  9. width="{{renderWidth}}"
  10. height="{{renderHeight}}"
  11. style="width:{{width}}px;height:{{height}}px;top:{{top}}px;left:{{left}}px;display:block;"
  12. bind:sceneReady="handleReady"
  13. captureState="{{captureState}}"
  14. recordState="{{recordState}}"
  15. captureType="{{captureType}}"
  16. captureQuality="{{captureQuality}}"
  17. recordFPS="{{recordFPS}}"
  18. recordBPS="{{recordBPS}}"
  19. recordWidth="{{recordWidth}}"
  20. recordHeight="{{recordHeight}}"
  21. />
  22. <view class="button-wrap">
  23. <button class="action-button" bindtap="changeCaptureState">截屏分享</button>
  24. <button class="action-button" bindtap="changeRecordState">{{recordState == 1 ? '停止录屏' : '启动录屏'}}</button>
  25. </view>
  26. <view class="form-entry">
  27. <view class="form-entry-title">截频格式</view>
  28. <radio-group name="pp-type" bindchange="changeCaptureType">
  29. <label class="radio-item"><radio value="jpg" checked />JPG</label>
  30. <label class="radio-item"><radio value="png"/>PNG</label>
  31. </radio-group>
  32. </view>
  33. <view class="form-entry">
  34. <view class="form-entry-title">截频质量</view>
  35. <slider show-value bindchange="changeCaptureQuality" value="{{captureQuality}}" min="{{0.5}}" max="{{1}}" step="{{0.1}}"></slider>
  36. </view>
  37. <view class="form-entry">
  38. <view class="form-entry-title">录屏FPS</view>
  39. <slider show-value bindchange="changeRecordFPS" value="{{recordFPS}}" min="{{10}}" max="{{60}}" step="{{10}}"></slider>
  40. </view>
  41. <view class="form-entry">
  42. <view class="form-entry-title">录屏尺寸系数</view>
  43. <slider show-value bindchange="changeRecordScale" value="{{recordScale}}" min="{{0.5}}" max="{{1}}" step="{{0.1}}"></slider>
  44. </view>
  45. <view class="form-entry">
  46. <view class="form-entry-title">录屏BPS</view>
  47. <slider show-value bindchange="changeRecordBPS" value="{{recordBPS}}" min="{{500}}" max="{{2000}}" step="{{100}}"></slider>
  48. </view>
  49. </xr-demo-viewer>