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

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 (156) 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.d0ee843a.js +1 -0
  13. package/docs/demo/assets/default.63925584.js +3984 -0
  14. package/docs/demo/assets/default.f3f3ca8c.css +1 -0
  15. package/docs/demo/assets/dynamic.76506c2c.js +1 -0
  16. package/docs/demo/assets/examples.3d8323db.js +25 -0
  17. package/docs/demo/assets/examples.dac4a6fe.css +1 -0
  18. package/docs/demo/assets/index.7e31122c.js +1 -0
  19. package/docs/demo/assets/index.9331038f.css +1 -0
  20. package/docs/demo/assets/main.79b11b9d.js +1 -0
  21. package/docs/demo/assets/react.2ee8565f.css +1 -0
  22. package/docs/demo/assets/react.c1c07c14.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/index.js +4 -5
  60. package/lib/Player/App.js +9 -7
  61. package/lib/Player/Controller.d.ts +29 -8
  62. package/lib/Player/Controller.js +193 -27
  63. package/lib/Player/custom/SpatialScenePanel/index.js +5 -4
  64. package/lib/Player/hooks.js +2 -2
  65. package/lib/Player/index.d.ts +5 -3
  66. package/lib/Player/index.js +97 -53
  67. package/lib/Player/modules/Drawer/index.js +1 -1
  68. package/lib/Player/modules/PopUp/index.js +1 -1
  69. package/lib/Player/modules/ResizeObserver/index.d.ts +2 -0
  70. package/lib/Player/modules/ResizeObserver/index.js +37 -0
  71. package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +16 -2
  72. package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +132 -59
  73. package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +3 -6
  74. package/lib/Player/modules/VideoAgent/VideoAgentScene.js +31 -36
  75. package/lib/Player/modules/VideoAgent/index.js +53 -12
  76. package/lib/Player/modules/Wave/index.d.ts +5 -0
  77. package/lib/Player/modules/Wave/index.js +51 -0
  78. package/lib/Player/modules/keyframes/BgMusic/index.js +1 -1
  79. package/lib/Player/modules/keyframes/CameraMovement/index.js +1 -1
  80. package/lib/Player/modules/keyframes/InfoPanel/index.js +22 -10
  81. package/lib/Player/modules/keyframes/ModelVideo/index.js +46 -9
  82. package/lib/Player/modules/keyframes/PanoEffect/index.js +1 -1
  83. package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +1 -1
  84. package/lib/Player/modules/keyframes/PanoTag/index.d.ts +1 -2
  85. package/lib/Player/modules/keyframes/PanoTag/index.js +79 -119
  86. package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +3 -0
  87. package/lib/Player/modules/keyframes/PanoTextLabel/index.js +96 -44
  88. package/lib/Player/modules/keyframes/Prompter/index.js +10 -23
  89. package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +10 -6
  90. package/lib/Player/modules/keyframes/VideoEffect/index.js +1 -1
  91. package/lib/Player/typings.d.ts +12 -1
  92. package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts +2 -0
  93. package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +12 -0
  94. package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts +7 -0
  95. package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +32 -0
  96. package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts +3 -0
  97. package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +11 -0
  98. package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +56 -0
  99. package/lib/fivePlugins/CSS3DRenderPlugin/index.js +275 -0
  100. package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts +7 -0
  101. package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +18 -0
  102. package/lib/fivePlugins/CameraMovementPlugin/index.js +13 -12
  103. package/lib/fivePlugins/ModelTVVideoPlugin/index.js +1 -1
  104. package/lib/react/index.d.ts +8 -4
  105. package/lib/react/index.js +3 -3
  106. package/lib/shared-utils/AduioLike.d.ts +37 -0
  107. package/lib/shared-utils/AduioLike.js +166 -0
  108. package/lib/shared-utils/addResizeListener.d.ts +4 -0
  109. package/lib/shared-utils/addResizeListener.js +51 -0
  110. package/lib/shared-utils/animationFrame/BetterTween.js +7 -3
  111. package/lib/shared-utils/animationFrame/tween.js +1 -1
  112. package/lib/shared-utils/createTransMatrix.d.ts +1 -0
  113. package/lib/shared-utils/createTransMatrix.js +43 -0
  114. package/lib/shared-utils/getFileExpandedName.d.ts +1 -0
  115. package/lib/shared-utils/getFileExpandedName.js +13 -0
  116. package/lib/shared-utils/getMediaInfo.d.ts +9 -0
  117. package/lib/shared-utils/getMediaInfo.js +75 -0
  118. package/lib/shared-utils/setElementDataset.d.ts +1 -0
  119. package/lib/shared-utils/setElementDataset.js +24 -0
  120. package/lib/typings/VreoUnit.d.ts +37 -2
  121. package/lib/typings/VreoUnit.js +13 -1
  122. package/package.json +10 -10
  123. package/resources/PlayController/index.ts +0 -13
  124. package/resources/Player/App.tsx +5 -4
  125. package/resources/Player/Controller.ts +277 -146
  126. package/resources/Player/custom/SpatialScenePanel/index.tsx +5 -5
  127. package/resources/Player/hooks.ts +3 -5
  128. package/resources/Player/index.tsx +189 -141
  129. package/resources/Player/modules/ResizeObserver/index.tsx +23 -0
  130. package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +87 -31
  131. package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +27 -24
  132. package/resources/Player/modules/VideoAgent/index.tsx +28 -12
  133. package/resources/Player/modules/Wave/index.tsx +18 -0
  134. package/resources/Player/modules/keyframes/InfoPanel/index.tsx +26 -11
  135. package/resources/Player/modules/keyframes/ModelVideo/index.tsx +36 -3
  136. package/resources/Player/modules/keyframes/PanoTag/index.tsx +53 -97
  137. package/resources/Player/modules/keyframes/PanoTextLabel/index.tsx +86 -34
  138. package/resources/Player/modules/keyframes/Prompter/index.tsx +6 -16
  139. package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +6 -2
  140. package/resources/Player/typings.ts +15 -1
  141. package/resources/fivePlugins/CSS3DRenderPlugin/centerPoint.ts +5 -0
  142. package/resources/fivePlugins/CSS3DRenderPlugin/createResizeObserver.ts +17 -0
  143. package/resources/fivePlugins/CSS3DRenderPlugin/evenNumber.ts +4 -0
  144. package/resources/fivePlugins/CSS3DRenderPlugin/index.ts +254 -0
  145. package/resources/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.ts +5 -0
  146. package/resources/fivePlugins/CameraMovementPlugin/index.ts +19 -12
  147. package/resources/react/index.tsx +7 -3
  148. package/resources/shared-utils/AduioLike.ts +109 -0
  149. package/resources/shared-utils/addResizeListener.ts +46 -0
  150. package/resources/shared-utils/createTransMatrix.ts +12 -0
  151. package/resources/shared-utils/getFileExpandedName.ts +6 -0
  152. package/resources/shared-utils/getMediaInfo.ts +52 -0
  153. package/resources/shared-utils/setElementDataset.ts +18 -0
  154. package/resources/typings/VreoUnit.ts +41 -3
  155. package/stylesheets/custom/SpatialScenePanel.css +2 -1
  156. package/stylesheets/default.css +348 -84
@@ -1,6 +1,6 @@
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); }
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); }
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -15,17 +15,39 @@ var React = _interopRequireWildcard(require("react"));
15
15
 
16
16
  var _animationFrame = require("../shared-utils/animationFrame");
17
17
 
18
+ var _setElementDataset = _interopRequireDefault(require("../shared-utils/setElementDataset"));
19
+
20
+ var _getMediaInfo = require("../shared-utils/getMediaInfo");
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
+
18
24
  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); }
19
25
 
20
26
  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; }
21
27
 
28
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
29
+
30
+ 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
+ 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
+ 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
+ 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
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
39
+
40
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
41
+
42
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
43
+
22
44
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
45
 
24
46
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
25
47
 
26
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
48
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
27
49
 
28
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
50
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
29
51
 
30
52
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
31
53
 
@@ -49,46 +71,161 @@ var Controller = /*#__PURE__*/function (_Subscribe) {
49
71
 
50
72
  var _super = _createSuper(Controller);
51
73
 
52
- function Controller() {
74
+ function Controller(_ref) {
53
75
  var _this;
54
76
 
77
+ var five = _ref.five,
78
+ container = _ref.container,
79
+ configs = _ref.configs;
80
+
55
81
  _classCallCheck(this, Controller);
56
82
 
57
83
  _this = _super.call(this);
58
84
 
59
85
  _defineProperty(_assertThisInitialized(_this), "playing", false);
60
86
 
87
+ _defineProperty(_assertThisInitialized(_this), "ended", false);
88
+
89
+ _defineProperty(_assertThisInitialized(_this), "loading", false);
90
+
91
+ _defineProperty(_assertThisInitialized(_this), "waveAppearance", null);
92
+
93
+ _defineProperty(_assertThisInitialized(_this), "appearance", {
94
+ waveStyle: 'solid'
95
+ });
96
+
61
97
  _defineProperty(_assertThisInitialized(_this), "visible", false);
62
98
 
63
99
  _defineProperty(_assertThisInitialized(_this), "popUp", null);
64
100
 
65
101
  _defineProperty(_assertThisInitialized(_this), "drawerConfig", null);
66
102
 
103
+ _this.configs = configs;
104
+ _this.container = container;
105
+ _this.five = five;
106
+ _this.appSize = configs.appSize;
107
+ _this.appearance = _objectSpread(_objectSpread({}, _this.appearance), configs.appearance);
67
108
  (0, _mobx.makeObservable)(_assertThisInitialized(_this), {
68
109
  visible: _mobx.observable,
69
110
  setVisible: _mobx.action,
70
111
  playing: _mobx.observable,
71
112
  setPlaying: _mobx.action,
113
+ loading: _mobx.observable,
114
+ setLoading: _mobx.action,
72
115
  popUp: _mobx.observable.ref,
73
116
  openPopUp: _mobx.action,
74
117
  drawerConfig: _mobx.observable.ref,
75
- openDrawer: _mobx.action
76
- }); // 监听播放情况:抛出触发时机
118
+ openDrawer: _mobx.action,
119
+ ended: _mobx.observable,
120
+ waveAppearance: _mobx.observable,
121
+ avatar: _mobx.observable,
122
+ containerSize: _mobx.observable,
123
+ setContainerSize: _mobx.action,
124
+ appearance: _mobx.observable,
125
+ setAppearance: _mobx.action,
126
+ configs: _mobx.observable.ref,
127
+ setEnded: _mobx.action,
128
+ setAvatar: _mobx.action
129
+ });
130
+ (0, _mobx.reaction)(function () {
131
+ return [_this.appearance.waveStyle, _this.loading];
132
+ }, function (_ref2) {
133
+ var _ref3 = _slicedToArray(_ref2, 2),
134
+ waveStyle = _ref3[0],
135
+ loading = _ref3[1];
136
+
137
+ if (loading === null) {
138
+ _this.waveAppearance = null;
139
+ return;
140
+ }
141
+
142
+ if (waveStyle === 'wave') {
143
+ switch (loading) {
144
+ case true:
145
+ _this.waveAppearance = 'double';
146
+ break;
77
147
 
148
+ case false:
149
+ _this.waveAppearance = 'solid';
150
+ break;
151
+ }
152
+ } else if (waveStyle === 'solid') {
153
+ switch (loading) {
154
+ case true:
155
+ _this.waveAppearance = 'swap';
156
+ break;
157
+
158
+ case false:
159
+ _this.waveAppearance = 'expand';
160
+ break;
161
+ }
162
+ }
163
+ }, {
164
+ fireImmediately: true
165
+ });
166
+
167
+ if (!_this.appSize) {
168
+ (0, _mobx.reaction)(function () {
169
+ return _this.containerSize;
170
+ }, function (containerSize) {
171
+ if (!containerSize) return;
172
+ var width = containerSize.width;
173
+ var height = containerSize.height;
174
+
175
+ var size = function () {
176
+ if (width <= 500) return 'S';
177
+ if (width <= 1024) return 'M';
178
+ if (width <= 2048) return 'L';
179
+ return 'XL';
180
+ }();
181
+
182
+ var orientation = function () {
183
+ if (height > width) return 'portrait';
184
+ return 'landscape';
185
+ }();
186
+
187
+ (0, _setElementDataset["default"])(_this.container, {
188
+ size: size
189
+ });
190
+ (0, _setElementDataset["default"])(_this.container, {
191
+ orientation: orientation
192
+ });
193
+ }, {
194
+ fireImmediately: true
195
+ });
196
+ } else {
197
+ (0, _setElementDataset["default"])(_this.container, {
198
+ size: _this.appSize
199
+ });
200
+ } // 监听播放情况:抛出触发时机
201
+
202
+
203
+ (0, _mobx.reaction)(function () {
204
+ return _this.ended;
205
+ }, function (ended) {
206
+ if (ended) {
207
+ _this.emit('paused', true);
208
+ }
209
+ });
78
210
  (0, _mobx.reaction)(function () {
79
211
  return _this.playing;
80
212
  }, function (playing) {
81
- _this.emit(playing ? 'playing' : 'paused');
213
+ if (!_this.ended) {
214
+ _this.emit(playing ? 'playing' : 'paused');
215
+ }
82
216
  });
83
217
  return _this;
84
218
  }
85
219
 
86
220
  _createClass(Controller, [{
87
- key: "isAudio",
221
+ key: "agentType",
88
222
  get: function get() {
89
- var _this$videoAgentScene, _this$videoAgentScene2;
223
+ var _this$videoAgentScene, _this$avatar;
90
224
 
91
- return !((_this$videoAgentScene = this.videoAgentScene) !== null && _this$videoAgentScene !== void 0 && (_this$videoAgentScene2 = _this$videoAgentScene.videoAgentMesh.videoUrl) !== null && _this$videoAgentScene2 !== void 0 && _this$videoAgentScene2.endsWith('.mp4'));
225
+ var type = (0, _getMediaInfo.getMediaType)((_this$videoAgentScene = this.videoAgentScene) === null || _this$videoAgentScene === void 0 ? void 0 : _this$videoAgentScene.videoAgentMesh.videoUrl);
226
+ if ((_this$avatar = this.avatar) !== null && _this$avatar !== void 0 && _this$avatar.force) return 'avatar';
227
+ if (type === 'video') return 'video';
228
+ return 'none';
92
229
  }
93
230
  }, {
94
231
  key: "openPopUp",
@@ -100,6 +237,24 @@ var Controller = /*#__PURE__*/function (_Subscribe) {
100
237
 
101
238
  this.popUp = popUp;
102
239
  }
240
+ }, {
241
+ key: "setLoading",
242
+ value: function setLoading(loading) {
243
+ this.loading = loading;
244
+ }
245
+ }, {
246
+ key: "setAvatar",
247
+ value: function setAvatar(avatar) {
248
+ this.avatar = avatar;
249
+ }
250
+ }, {
251
+ key: "setContainerSize",
252
+ value: function setContainerSize(width, height) {
253
+ this.containerSize = {
254
+ width: width,
255
+ height: height
256
+ };
257
+ }
103
258
  }, {
104
259
  key: "setVisible",
105
260
  value: function setVisible(v) {
@@ -110,6 +265,16 @@ var Controller = /*#__PURE__*/function (_Subscribe) {
110
265
  value: function setPlaying(playing) {
111
266
  this.playing = playing;
112
267
  }
268
+ }, {
269
+ key: "setEnded",
270
+ value: function setEnded(ended) {
271
+ this.ended = ended;
272
+ }
273
+ }, {
274
+ key: "setAppearance",
275
+ value: function setAppearance(appearance) {
276
+ this.appearance = _objectSpread(_objectSpread({}, this.appearance), appearance);
277
+ }
113
278
  }, {
114
279
  key: "openDrawer",
115
280
  value: function openDrawer(drawerConfig) {
@@ -133,9 +298,9 @@ var Controller = /*#__PURE__*/function (_Subscribe) {
133
298
  }, {
134
299
  key: "currentTime",
135
300
  get: function get() {
136
- var _this$videoAgentScene3;
301
+ var _this$videoAgentScene2;
137
302
 
138
- return ((_this$videoAgentScene3 = this.videoAgentScene) === null || _this$videoAgentScene3 === void 0 ? void 0 : _this$videoAgentScene3.videoAgentMesh.currentTime) || 0;
303
+ return ((_this$videoAgentScene2 = this.videoAgentScene) === null || _this$videoAgentScene2 === void 0 ? void 0 : _this$videoAgentScene2.videoAgentMesh.currentTime) || 0;
139
304
  }
140
305
  }, {
141
306
  key: "currentKeyframes",
@@ -152,11 +317,11 @@ var Controller = /*#__PURE__*/function (_Subscribe) {
152
317
  });
153
318
  }
154
319
  }, {
155
- key: "videoInstance",
320
+ key: "mediaInstance",
156
321
  get: function get() {
157
- var _this$videoAgentScene4;
322
+ var _this$videoAgentScene3;
158
323
 
159
- return (_this$videoAgentScene4 = this.videoAgentScene) === null || _this$videoAgentScene4 === void 0 ? void 0 : _this$videoAgentScene4.videoAgentMesh.videoInstance;
324
+ return (_this$videoAgentScene3 = this.videoAgentScene) === null || _this$videoAgentScene3 === void 0 ? void 0 : _this$videoAgentScene3.videoAgentMesh.mediaInstance;
160
325
  }
161
326
  /**
162
327
  * 逐帧任务
@@ -165,30 +330,31 @@ var Controller = /*#__PURE__*/function (_Subscribe) {
165
330
  }, {
166
331
  key: "requestAnimationFrameLoop",
167
332
  value: function requestAnimationFrameLoop(callback) {
168
- var _this$videoInstance,
169
- _this$videoInstance4,
333
+ var _this$mediaInstance,
334
+ _this$mediaInstance4,
170
335
  _this3 = this;
171
336
 
172
- if ((_this$videoInstance = this.videoInstance) !== null && _this$videoInstance !== void 0 && _this$videoInstance.ended) {
337
+ if ((_this$mediaInstance = this.mediaInstance) !== null && _this$mediaInstance !== void 0 && _this$mediaInstance.ended) {
338
+ this.setEnded(true);
173
339
  this.setPlaying(false);
174
- this.videoInstance.pause();
340
+ this.mediaInstance.pause();
175
341
  return;
176
342
  }
177
343
 
178
344
  if (!this.playing) {
179
- var _this$videoInstance2;
345
+ var _this$mediaInstance2;
180
346
 
181
- if (!((_this$videoInstance2 = this.videoInstance) !== null && _this$videoInstance2 !== void 0 && _this$videoInstance2.paused)) {
182
- var _this$videoInstance3;
347
+ if (!((_this$mediaInstance2 = this.mediaInstance) !== null && _this$mediaInstance2 !== void 0 && _this$mediaInstance2.paused)) {
348
+ var _this$mediaInstance3;
183
349
 
184
- (_this$videoInstance3 = this.videoInstance) === null || _this$videoInstance3 === void 0 ? void 0 : _this$videoInstance3.pause();
350
+ (_this$mediaInstance3 = this.mediaInstance) === null || _this$mediaInstance3 === void 0 ? void 0 : _this$mediaInstance3.pause();
185
351
  }
186
352
 
187
353
  return;
188
354
  }
189
355
 
190
- if ((_this$videoInstance4 = this.videoInstance) !== null && _this$videoInstance4 !== void 0 && _this$videoInstance4.paused && this.playing) {
191
- this.videoInstance.play();
356
+ if ((_this$mediaInstance4 = this.mediaInstance) !== null && _this$mediaInstance4 !== void 0 && _this$mediaInstance4.paused && this.playing) {
357
+ this.mediaInstance.play();
192
358
  }
193
359
 
194
360
  var currentKeyframes = this.currentKeyframes;
@@ -230,8 +396,8 @@ var Controller = /*#__PURE__*/function (_Subscribe) {
230
396
 
231
397
  this.vreoUnit = undefined;
232
398
 
233
- if (this.videoInstance) {
234
- this.videoInstance.currentTime = 0;
399
+ if (this.mediaInstance) {
400
+ this.mediaInstance.currentTime = 0;
235
401
  }
236
402
 
237
403
  if (this.stopInterval) {
@@ -1,6 +1,6 @@
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); }
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); }
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -13,9 +13,9 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
13
13
 
14
14
  var _three = require("three");
15
15
 
16
- var _BetterTween = require("@realsee/dnalogel/shared-utils/animationFrame/BetterTween");
16
+ var _BetterTween = require("../../../shared-utils/animationFrame/BetterTween");
17
17
 
18
- var _CSS3DRenderPlugin = require("@realsee/dnalogel/plugins/CSS3DRenderPlugin");
18
+ var _CSS3DRenderPlugin = require("../../../fivePlugins/CSS3DRenderPlugin");
19
19
 
20
20
  var _VreoUnit = require("../../../typings/VreoUnit");
21
21
 
@@ -244,7 +244,8 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, myRef) {
244
244
  className: "SpatialScenePanel-item index_".concat(index)
245
245
  }, /*#__PURE__*/React.createElement("img", {
246
246
  className: "SpatialScenePanel-icon",
247
- src: state.icon
247
+ src: state.icon,
248
+ alt: "".concat(state.text)
248
249
  }), /*#__PURE__*/React.createElement("div", {
249
250
  className: "SpatialScenePanel-text"
250
251
  }, state.text), /*#__PURE__*/React.createElement("div", {
@@ -26,11 +26,11 @@ function useController() {
26
26
  function useFiveInstance() {
27
27
  var controller = useController();
28
28
 
29
- if (!controller.$five) {
29
+ if (!controller.five) {
30
30
  throw new Error('没有找到 "five" 实例');
31
31
  }
32
32
 
33
- return controller.$five;
33
+ return controller.five;
34
34
  }
35
35
 
36
36
  function useFiveProject2d() {
@@ -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
  }