@realsee/vreo 0.2.0-alpha.9 → 1.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +16 -5
  3. package/docs/assets/highlight.css +1 -1
  4. package/docs/assets/main.js +2 -2
  5. package/docs/assets/search.js +1 -1
  6. package/docs/assets/style.css +28 -2
  7. package/docs/classes/Player.AudioLike.html +52 -0
  8. package/docs/classes/Player.Controller.html +13 -13
  9. package/docs/classes/Player.Player-1.html +11 -11
  10. package/docs/classes/Player.VideoAgentMesh.html +53 -53
  11. package/docs/classes/Player.VideoAgentScene.html +1 -1
  12. package/docs/demo/assets/AppReact.ea8cbdb3.js +1 -0
  13. package/docs/demo/assets/default.1dd2b2d4.js +3988 -0
  14. package/docs/demo/assets/default.bc4c715d.css +1 -0
  15. package/docs/demo/assets/dynamic.cd7d1da6.js +1 -0
  16. package/docs/demo/assets/examples.98aaf9e2.js +25 -0
  17. package/docs/demo/assets/examples.dac4a6fe.css +1 -0
  18. package/docs/demo/assets/index.9331038f.css +1 -0
  19. package/docs/demo/assets/index.a3d7bd8a.js +1 -0
  20. package/docs/demo/assets/main.f0c47cae.js +1 -0
  21. package/docs/demo/assets/react.2ee8565f.css +1 -0
  22. package/docs/demo/assets/react.5f3bcfc5.js +25 -0
  23. package/docs/demo/assets/znRoyv06SZQeqA7m.0057e8ae.js +1 -0
  24. package/docs/demo/examples.html +17 -0
  25. package/docs/demo/index-react-dynamic.html +20 -0
  26. package/docs/demo/index-react.html +20 -0
  27. package/docs/demo/index.html +19 -0
  28. package/docs/enums/Player.InfoPanelStyleEnum.html +1 -1
  29. package/docs/enums/Player.InfoPanelTypeEnum.html +2 -2
  30. package/docs/enums/Player.PanoEffectEnum.html +2 -2
  31. package/docs/enums/Player.PanoTagEnum.html +2 -2
  32. package/docs/enums/Player.PanoTagStyleEnum.html +7 -0
  33. package/docs/enums/Player.VreoKeyframeEnum.html +12 -12
  34. package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
  35. package/docs/enums/fivePlugins.Rotation.html +1 -1
  36. package/docs/index.html +13 -6
  37. package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -1
  38. package/docs/interfaces/Player.PlayerConfigs.html +4 -3
  39. package/docs/interfaces/Player.Vertex.html +2 -2
  40. package/docs/interfaces/Player.VideoAgentMeshOptions.html +8 -1
  41. package/docs/interfaces/Player.VreoKeyframe.html +2 -2
  42. package/docs/interfaces/Player.VreoUnit.html +2 -2
  43. package/docs/interfaces/Player.VreoVideo.html +2 -2
  44. package/docs/interfaces/fivePlugins.CSS3DRenderPluginExportType.html +4 -0
  45. package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -1
  46. package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +2 -2
  47. package/docs/interfaces/fivePlugins.CameraMovementPluginParameterType.html +1 -1
  48. package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -1
  49. package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -1
  50. package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -1
  51. package/docs/interfaces/fivePlugins.Vector3Position.html +3 -0
  52. package/docs/interfaces/react.VreoActionCallbacks.html +15 -7
  53. package/docs/interfaces/react.VreoProviderProps.html +1 -1
  54. package/docs/modules/Player.html +21 -15
  55. package/docs/modules/custom.html +1 -1
  56. package/docs/modules/fivePlugins.html +5 -2
  57. package/docs/modules/react.html +1 -1
  58. package/docs/modules.html +1 -1
  59. package/lib/PlayController/createHTMLAudioElement.js +6 -11
  60. package/lib/PlayController/index.js +19 -85
  61. package/lib/Player/App.js +7 -29
  62. package/lib/Player/Controller.d.ts +29 -8
  63. package/lib/Player/Controller.js +185 -87
  64. package/lib/Player/custom/SpatialScenePanel/index.js +47 -72
  65. package/lib/Player/hooks.js +2 -12
  66. package/lib/Player/index.d.ts +5 -3
  67. package/lib/Player/index.js +108 -122
  68. package/lib/Player/modules/Drawer/index.js +1 -18
  69. package/lib/Player/modules/PopUp/index.js +1 -11
  70. package/lib/Player/modules/ResizeObserver/index.d.ts +2 -0
  71. package/lib/Player/modules/ResizeObserver/index.js +29 -0
  72. package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +16 -2
  73. package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +124 -145
  74. package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +3 -6
  75. package/lib/Player/modules/VideoAgent/VideoAgentScene.js +25 -52
  76. package/lib/Player/modules/VideoAgent/index.js +46 -22
  77. package/lib/Player/modules/Wave/index.d.ts +5 -0
  78. package/lib/Player/modules/Wave/index.js +77 -0
  79. package/lib/Player/modules/keyframes/BgMusic/index.js +3 -16
  80. package/lib/Player/modules/keyframes/CameraMovement/index.js +4 -28
  81. package/lib/Player/modules/keyframes/InfoPanel/index.js +30 -35
  82. package/lib/Player/modules/keyframes/ModelVideo/index.js +40 -29
  83. package/lib/Player/modules/keyframes/PanoEffect/index.js +16 -44
  84. package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +1 -8
  85. package/lib/Player/modules/keyframes/PanoTag/index.d.ts +1 -2
  86. package/lib/Player/modules/keyframes/PanoTag/index.js +75 -132
  87. package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +3 -0
  88. package/lib/Player/modules/keyframes/PanoTextLabel/index.js +93 -66
  89. package/lib/Player/modules/keyframes/Prompter/index.js +18 -53
  90. package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +22 -25
  91. package/lib/Player/modules/keyframes/VideoEffect/index.js +13 -48
  92. package/lib/Player/typings.d.ts +12 -1
  93. package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts +2 -0
  94. package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +10 -0
  95. package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts +7 -0
  96. package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +31 -0
  97. package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts +3 -0
  98. package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +10 -0
  99. package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +56 -0
  100. package/lib/fivePlugins/CSS3DRenderPlugin/index.js +234 -0
  101. package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts +7 -0
  102. package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +15 -0
  103. package/lib/fivePlugins/CameraMovementPlugin/index.js +36 -82
  104. package/lib/fivePlugins/CameraMovementPlugin/typings.js +0 -4
  105. package/lib/fivePlugins/ModelTVVideoPlugin/index.js +12 -61
  106. package/lib/index.js +0 -1
  107. package/lib/react/index.d.ts +8 -4
  108. package/lib/react/index.js +10 -37
  109. package/lib/shared-utils/AduioLike.d.ts +37 -0
  110. package/lib/shared-utils/AduioLike.js +132 -0
  111. package/lib/shared-utils/Preloader.js +0 -7
  112. package/lib/shared-utils/addResizeListener.d.ts +4 -0
  113. package/lib/shared-utils/addResizeListener.js +46 -0
  114. package/lib/shared-utils/animationFrame/BetterTween.js +7 -39
  115. package/lib/shared-utils/animationFrame/index.js +2 -10
  116. package/lib/shared-utils/animationFrame/tween.js +3 -16
  117. package/lib/shared-utils/createTransMatrix.d.ts +1 -0
  118. package/lib/shared-utils/createTransMatrix.js +28 -0
  119. package/lib/shared-utils/getFileExpandedName.d.ts +1 -0
  120. package/lib/shared-utils/getFileExpandedName.js +12 -0
  121. package/lib/shared-utils/getMediaInfo.d.ts +9 -0
  122. package/lib/shared-utils/getMediaInfo.js +66 -0
  123. package/lib/shared-utils/setElementDataset.d.ts +1 -0
  124. package/lib/shared-utils/setElementDataset.js +22 -0
  125. package/lib/typings/VreoUnit.d.ts +37 -2
  126. package/lib/typings/VreoUnit.js +10 -13
  127. package/package.json +10 -10
  128. package/resources/PlayController/index.ts +0 -13
  129. package/resources/Player/App.tsx +5 -4
  130. package/resources/Player/Controller.ts +274 -146
  131. package/resources/Player/custom/SpatialScenePanel/index.tsx +5 -5
  132. package/resources/Player/hooks.ts +3 -5
  133. package/resources/Player/index.tsx +190 -140
  134. package/resources/Player/modules/ResizeObserver/index.tsx +23 -0
  135. package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +87 -31
  136. package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +27 -24
  137. package/resources/Player/modules/VideoAgent/index.tsx +28 -12
  138. package/resources/Player/modules/Wave/index.tsx +64 -0
  139. package/resources/Player/modules/keyframes/InfoPanel/index.tsx +26 -11
  140. package/resources/Player/modules/keyframes/ModelVideo/index.tsx +36 -3
  141. package/resources/Player/modules/keyframes/PanoTag/index.tsx +52 -97
  142. package/resources/Player/modules/keyframes/PanoTextLabel/index.tsx +86 -34
  143. package/resources/Player/modules/keyframes/Prompter/index.tsx +6 -16
  144. package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +6 -2
  145. package/resources/Player/typings.ts +15 -1
  146. package/resources/fivePlugins/CSS3DRenderPlugin/centerPoint.ts +5 -0
  147. package/resources/fivePlugins/CSS3DRenderPlugin/createResizeObserver.ts +17 -0
  148. package/resources/fivePlugins/CSS3DRenderPlugin/evenNumber.ts +4 -0
  149. package/resources/fivePlugins/CSS3DRenderPlugin/index.ts +254 -0
  150. package/resources/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.ts +5 -0
  151. package/resources/fivePlugins/CameraMovementPlugin/index.ts +19 -12
  152. package/resources/react/index.tsx +7 -3
  153. package/resources/shared-utils/AduioLike.ts +109 -0
  154. package/resources/shared-utils/addResizeListener.ts +46 -0
  155. package/resources/shared-utils/createTransMatrix.ts +12 -0
  156. package/resources/shared-utils/getFileExpandedName.ts +6 -0
  157. package/resources/shared-utils/getMediaInfo.ts +52 -0
  158. package/resources/shared-utils/setElementDataset.ts +18 -0
  159. package/resources/typings/VreoUnit.ts +41 -3
  160. package/stylesheets/custom/SpatialScenePanel.css +2 -1
  161. package/stylesheets/default.css +350 -84
@@ -1,42 +1,25 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.SpatialScenePanel = SpatialScenePanel;
9
-
10
8
  var React = _interopRequireWildcard(require("react"));
11
-
12
9
  var _reactDom = _interopRequireDefault(require("react-dom"));
13
-
14
10
  var _three = require("three");
15
-
16
- var _BetterTween = require("@realsee/dnalogel/shared-utils/animationFrame/BetterTween");
17
-
18
- var _CSS3DRenderPlugin = require("@realsee/dnalogel/plugins/CSS3DRenderPlugin");
19
-
11
+ var _BetterTween = require("../../../shared-utils/animationFrame/BetterTween");
12
+ var _CSS3DRenderPlugin = require("../../../fivePlugins/CSS3DRenderPlugin");
20
13
  var _VreoUnit = require("../../../typings/VreoUnit");
21
-
22
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
-
24
15
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
-
26
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
-
28
17
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
29
-
30
18
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
31
-
32
19
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
33
-
34
20
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
35
-
36
21
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
37
-
38
22
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
39
-
40
23
  // const getSphere = (position: Vector3, color = 0xffff00) => {
41
24
  // const geometry = new SphereGeometry(0.05, 32, 16)
42
25
  // const material = new MeshBasicMaterial({ color })
@@ -44,28 +27,27 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
44
27
  // sphere.position.copy(position)
45
28
  // return sphere
46
29
  // }
30
+
47
31
  var searchV1 = function searchV1(_ref) {
48
32
  var five = _ref.five,
49
- dom = _ref.dom;
33
+ dom = _ref.dom;
50
34
  var cameraDirection = new _three.Vector3();
51
35
  five.camera.getWorldDirection(cameraDirection);
52
36
  var cameraPosition = five.camera.position;
53
-
54
37
  var _five$model$intersect = five.model.intersectRaycaster(new _three.Raycaster(cameraPosition, cameraDirection)),
55
- _five$model$intersect2 = _slicedToArray(_five$model$intersect, 1),
56
- intersect = _five$model$intersect2[0];
57
-
38
+ _five$model$intersect2 = _slicedToArray(_five$model$intersect, 1),
39
+ intersect = _five$model$intersect2[0];
58
40
  var point = five.project2d(intersect.point);
59
- var widescreen = window.innerWidth > 560 ? true : false; // const width = dom!.clientWidth
60
-
41
+ var widescreen = window.innerWidth > 560 ? true : false;
42
+ // const width = dom!.clientWidth
61
43
  var height = dom.clientHeight;
62
44
  dom.style.left = point.x + 'px';
63
45
  dom.style.top = point.y - height / 2 + 'px';
64
46
  var rect = dom.getBoundingClientRect();
65
47
  var left = rect.left,
66
- top = rect.top,
67
- bottom = rect.bottom,
68
- right = rect.right;
48
+ top = rect.top,
49
+ bottom = rect.bottom,
50
+ right = rect.right;
69
51
  var leftBottom = new _three.Vector3(left, bottom);
70
52
  var leftTop = new _three.Vector3(left, top);
71
53
  var rightTop = new _three.Vector3(right, top);
@@ -75,23 +57,24 @@ var searchV1 = function searchV1(_ref) {
75
57
  point.setY(-(point.y / window.innerHeight) * 2 + (widescreen ? 1.35 : 1.125));
76
58
  point.setZ(0.5);
77
59
  return point.unproject(five.camera).addScaledVector(cameraDirection, 0.2);
78
- }); // __debug__
60
+ });
61
+
62
+ // __debug__
79
63
  // const colors = [0xdc143c, 0xffff00, 0x0000ff, 0x008000]
80
64
  // points.forEach((p, index) => five.scene.add(getSphere(p, colors[index])))
81
- // 判断是手机 150
82
65
 
66
+ // 判断是手机 150
83
67
  var ratio = leftBottom.distanceTo(rightBottom) / (widescreen ? 150 : 120);
84
68
  return {
85
69
  points: points,
86
70
  ratio: ratio
87
71
  };
88
72
  };
73
+
89
74
  /**
90
75
  * 空间场景面板
91
76
  * @returns
92
77
  */
93
-
94
-
95
78
  function SpatialScenePanel(props) {
96
79
  var timeoutRef = React.useRef(null);
97
80
  var ref = React.useRef(null);
@@ -101,68 +84,63 @@ function SpatialScenePanel(props) {
101
84
  if (!ref.current) {
102
85
  return;
103
86
  }
104
-
105
87
  var callback = function callback(keyframe) {
106
88
  if (keyframe.data.customType !== 'SpatialScenePanel') {
107
89
  return;
108
90
  }
91
+ var data = keyframe.data;
109
92
 
110
- var data = keyframe.data; // const data = mockData
111
-
93
+ // const data = mockData
112
94
  var _searchV = searchV1({
113
- five: props.five,
114
- dom: ref.current
115
- }),
116
- points = _searchV.points,
117
- ratio = _searchV.ratio;
118
-
95
+ five: props.five,
96
+ dom: ref.current
97
+ }),
98
+ points = _searchV.points,
99
+ ratio = _searchV.ratio;
119
100
  var _ref2 = rendererRef.current.create3DDomContainer(points, {
120
- ratio: ratio,
121
- autoRender: false
122
- }) || {},
123
- container = _ref2.container,
124
- dispose = _ref2.dispose,
125
- css3DObject = _ref2.css3DObject,
126
- render = _ref2.render;
127
-
101
+ ratio: ratio,
102
+ autoRender: false
103
+ }) || {},
104
+ container = _ref2.container,
105
+ dispose = _ref2.dispose,
106
+ css3DObject = _ref2.css3DObject,
107
+ render = _ref2.render;
128
108
  Object.assign(window, {
129
109
  $css3DObject: css3DObject
130
110
  });
131
111
  if (!container) return;
132
-
133
112
  _reactDom["default"].render( /*#__PURE__*/React.createElement(Panel, {
134
113
  ref: function ref(_ref3) {
135
114
  return panelRef.current = _ref3;
136
115
  },
137
116
  data: data
138
117
  }), container);
139
-
140
118
  var startRotateY = -(Math.PI * 2) / 9;
141
119
  var lastRotateY = 0;
142
120
  (0, _BetterTween.tweenProgress)(1000).onUpdate(function (_ref4) {
143
121
  var progress = _ref4.progress;
144
122
  var needRotateY = Math.PI / 90 * 11 * progress;
145
123
  var rotateY = needRotateY - lastRotateY;
146
- css3DObject === null || css3DObject === void 0 ? void 0 : css3DObject.rotateY(rotateY); // css3DObject?.rotateZ
147
-
124
+ css3DObject === null || css3DObject === void 0 ? void 0 : css3DObject.rotateY(rotateY);
125
+ // css3DObject?.rotateZ
148
126
  lastRotateY = needRotateY;
149
127
  }).onStart(function () {
150
128
  css3DObject === null || css3DObject === void 0 ? void 0 : css3DObject.rotateY(startRotateY);
151
129
  render();
152
130
  }).onDispose(function () {
153
131
  var _panelRef$current;
154
-
155
132
  (_panelRef$current = panelRef.current) === null || _panelRef$current === void 0 ? void 0 : _panelRef$current.classList.add('show');
156
- }).play(); // Object.assign(window, { $dispose: () => {
133
+ }).play();
134
+
135
+ // Object.assign(window, { $dispose: () => {
157
136
  // panelRef.current?.classList.add('hide')
158
137
  // setTimeout(() => dispose?.(), 1500)
159
138
  // } })
160
139
 
161
140
  var start = keyframe.start,
162
- end = keyframe.end;
141
+ end = keyframe.end;
163
142
  timeoutRef.current = setTimeout(function () {
164
143
  var _panelRef$current2;
165
-
166
144
  (_panelRef$current2 = panelRef.current) === null || _panelRef$current2 === void 0 ? void 0 : _panelRef$current2.classList.add('hide');
167
145
  timeoutRef.current = setTimeout(function () {
168
146
  dispose === null || dispose === void 0 ? void 0 : dispose();
@@ -170,15 +148,14 @@ function SpatialScenePanel(props) {
170
148
  }, 1500);
171
149
  }, end - start);
172
150
  };
173
-
174
151
  Object.assign(window, {
175
152
  $callback: callback
176
- }); // setTimeout(() => {callback()}, 8000)
153
+ });
177
154
 
155
+ // setTimeout(() => {callback()}, 8000)
178
156
  props.subscribe.on(_VreoUnit.VreoKeyframeEnum.Custom, callback);
179
157
  return function () {
180
158
  props.subscribe.off(_VreoUnit.VreoKeyframeEnum.Custom, callback);
181
-
182
159
  if (timeoutRef.current) {
183
160
  clearTimeout(timeoutRef.current);
184
161
  }
@@ -189,27 +166,22 @@ function SpatialScenePanel(props) {
189
166
  ref: ref
190
167
  });
191
168
  }
192
- /** 背景动画:控制延迟 */
193
-
194
169
 
170
+ /** 背景动画:控制延迟 */
195
171
  function SpatialScenePanelBg() {
196
172
  var ref = React.useRef(null);
197
173
  var timeoutRef = React.useRef(null);
198
174
  React.useEffect(function () {
199
175
  if (!ref.current) return;
200
-
201
176
  var listener = function listener() {
202
177
  var _ref$current;
203
-
204
178
  (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.setAttribute('class', 'SpatialScenePanel-bg');
205
179
  timeoutRef.current = setTimeout(function () {
206
180
  var _ref$current2;
207
-
208
181
  (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.setAttribute('class', 'SpatialScenePanel-bg SpatialScenePanel-bg--animation');
209
182
  timeoutRef.current = null;
210
183
  }, 3000);
211
184
  };
212
-
213
185
  ref.current.addEventListener('animationend', listener);
214
186
  return function () {
215
187
  if (ref.current) ref.current.removeEventListener('animationend', listener);
@@ -221,10 +193,8 @@ function SpatialScenePanelBg() {
221
193
  className: "SpatialScenePanel-bg SpatialScenePanel-bg--animation"
222
194
  });
223
195
  }
224
-
225
196
  var Panel = /*#__PURE__*/React.forwardRef(function (props, myRef) {
226
197
  var _props$data, _props$data2, _props$data3, _props$data3$stateLis;
227
-
228
198
  return /*#__PURE__*/React.createElement("div", {
229
199
  className: "SpatialScenePanel",
230
200
  ref: myRef
@@ -244,7 +214,8 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, myRef) {
244
214
  className: "SpatialScenePanel-item index_".concat(index)
245
215
  }, /*#__PURE__*/React.createElement("img", {
246
216
  className: "SpatialScenePanel-icon",
247
- src: state.icon
217
+ src: state.icon,
218
+ alt: "".concat(state.text)
248
219
  }), /*#__PURE__*/React.createElement("div", {
249
220
  className: "SpatialScenePanel-text"
250
221
  }, state.text), /*#__PURE__*/React.createElement("div", {
@@ -253,8 +224,11 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, myRef) {
253
224
  }))), /*#__PURE__*/React.createElement("div", {
254
225
  className: "SpatialScenePanel-disappear-area"
255
226
  }));
256
- }); // export function SpatialScenePanel() {
227
+ });
228
+
229
+ // export function SpatialScenePanel() {
257
230
  // // const data = mockData
231
+
258
232
  // return (
259
233
  // <div className="SpatialScenePanel" >
260
234
  // <div className="SpatialScenePanel-show-area">
@@ -273,6 +247,7 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, myRef) {
273
247
  // ))}
274
248
  // </div>
275
249
  // </div>
250
+
276
251
  // <div className="SpatialScenePanel-disappear-area"></div>
277
252
  // </div>
278
253
  // )
@@ -6,33 +6,23 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useController = useController;
7
7
  exports.useFiveInstance = useFiveInstance;
8
8
  exports.useFiveProject2d = useFiveProject2d;
9
-
10
9
  var _react = _interopRequireDefault(require("react"));
11
-
12
10
  var _Controller = require("./Controller");
13
-
14
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
-
16
12
  function useController() {
17
13
  var controller = _react["default"].useContext(_Controller.ControllerContext);
18
-
19
14
  if (!controller) {
20
15
  throw new Error('没有找到 "ControllerContext"');
21
16
  }
22
-
23
17
  return controller;
24
18
  }
25
-
26
19
  function useFiveInstance() {
27
20
  var controller = useController();
28
-
29
- if (!controller.$five) {
21
+ if (!controller.five) {
30
22
  throw new Error('没有找到 "five" 实例');
31
23
  }
32
-
33
- return controller.$five;
24
+ return controller.five;
34
25
  }
35
-
36
26
  function useFiveProject2d() {
37
27
  var five = useFiveInstance();
38
28
  return function (vector) {
@@ -1,16 +1,18 @@
1
1
  import { Five, Subscribe } from '@realsee/five';
2
2
  import { VreoKeyframeEvent, VreoUnit } from '../typings/VreoUnit';
3
- import { PlayerConfigs } from './typings';
3
+ import { Appearance, PlayerConfigs } from './typings';
4
4
  export declare class Player extends Subscribe<VreoKeyframeEvent> {
5
5
  $five: Five;
6
6
  private controller;
7
7
  configs: Readonly<PlayerConfigs>;
8
8
  constructor(five: Five, configs?: Partial<PlayerConfigs>);
9
- load(vreoUnit: VreoUnit, currentTime?: number, preload?: boolean): Promise<boolean>;
9
+ load(vreoUnit: VreoUnit, currentTime?: number, preload?: boolean, force?: boolean): Promise<boolean>;
10
10
  get paused(): boolean;
11
- play(): boolean;
11
+ play(currentTime?: number): boolean;
12
+ setAppearance(appearance: Appearance): void;
12
13
  pause(): void;
13
14
  show(): void;
14
15
  hide(): void;
16
+ getCurrentTime(): number;
15
17
  dispose(): void;
16
18
  }