index.js 1.4 KB

1234567891011121314151617181920212223242526
  1. var sceneReadyBehavior = require('../../behavior-scene/scene-ready');
  2. var handleDecodedXML = require('../../behavior-scene/util').handleDecodedXML;
  3. var xmlCode = `<xr-scene ar-system="modes:Marker" bind:ready="handleReady">
  4. <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
  5. <xr-asset-load
  6. type="video-texture" asset-id="hikari"
  7. src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/2dmarker/hikari.mp4" options="autoPlay:true,loop:true"
  8. />
  9. </xr-assets>
  10. <xr-node wx:if="{{loaded}}">
  11. <xr-ar-tracker mode="Marker" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/2dmarker/hikari.jpg">
  12. <xr-mesh node-id="mesh-plane" geometry="plane" uniforms="u_baseColorMap: video-hikari" />
  13. </xr-ar-tracker>
  14. <xr-camera
  15. id="camera" node-id="camera" position="1 1 1" clear-color="0.925 0.925 0.925 1"
  16. background="ar" is-ar-camera
  17. />
  18. </xr-node>
  19. </xr-scene>`;
  20. Page({
  21. behaviors:[sceneReadyBehavior],
  22. data: {
  23. xmlCode: '<div class="codeWrap">' + handleDecodedXML(xmlCode) + '</div>'
  24. }
  25. });