@realsee/vreo 2.4.7 → 2.5.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 (132) hide show
  1. package/README.md +1 -1
  2. package/docs/assets/navigation.js +1 -1
  3. package/docs/assets/search.js +1 -1
  4. package/docs/classes/Player.AudioLike.html +2 -2
  5. package/docs/classes/Player.Controller.html +52 -4
  6. package/docs/classes/Player.Player.html +43 -2
  7. package/docs/classes/Player.VideoAgentMesh.html +61 -4
  8. package/docs/classes/Player.VideoAgentScene.html +2 -2
  9. package/docs/demo/assets/{examples-5qw3pq5z.js → examples-DfiAz2fR.js} +1 -1
  10. package/docs/demo/assets/react-BnzBLum3.css +1 -0
  11. package/docs/demo/examples.html +1 -1
  12. package/docs/demo/index-react.html +2 -2
  13. package/docs/demo/index.html +1 -1
  14. package/docs/enums/Player.InfoPanelStyleEnum.html +2 -2
  15. package/docs/enums/Player.InfoPanelTypeEnum.html +2 -2
  16. package/docs/enums/Player.PanoEffectEnum.html +2 -2
  17. package/docs/enums/Player.PanoTagEnum.html +2 -2
  18. package/docs/enums/Player.PanoTagStyleEnum.html +3 -3
  19. package/docs/enums/Player.VreoKeyframeEnum.html +13 -13
  20. package/docs/enums/fivePlugins.CameraMovementEffect.html +2 -2
  21. package/docs/enums/fivePlugins.Rotation.html +2 -2
  22. package/docs/functions/custom.SpatialScenePanel.html +1 -1
  23. package/docs/functions/react.useVreoAction.html +8 -1
  24. package/docs/functions/react.useVreoEventCallback.html +10 -1
  25. package/docs/functions/react.useVreoPausedState.html +8 -1
  26. package/docs/index.html +1 -1
  27. package/docs/interfaces/Player.Appearance.html +2 -0
  28. package/docs/interfaces/Player.CustomVreoKeyframeProps.html +2 -2
  29. package/docs/interfaces/Player.PlayerConfigs.html +6 -6
  30. package/docs/interfaces/Player.Vertex.html +2 -2
  31. package/docs/interfaces/Player.VideoAgentMeshOptions.html +5 -4
  32. package/docs/interfaces/Player.VreoKeyframe.html +2 -2
  33. package/docs/interfaces/Player.VreoUnit.html +2 -2
  34. package/docs/interfaces/Player.VreoVideo.html +2 -2
  35. package/docs/interfaces/fivePlugins.CSS3DRenderPluginExportType.html +7 -5
  36. package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +2 -2
  37. package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +3 -3
  38. package/docs/interfaces/fivePlugins.CameraMovementPluginParameterType.html +1 -1
  39. package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +2 -2
  40. package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +2 -2
  41. package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +2 -2
  42. package/docs/interfaces/fivePlugins.Vector3Position.html +2 -2
  43. package/docs/interfaces/react.VreoActionCallbacks.html +7 -7
  44. package/docs/interfaces/react.VreoProviderProps.html +5 -2
  45. package/docs/modules/Player.html +1 -1
  46. package/docs/modules/fivePlugins.html +1 -1
  47. package/docs/types/Player.AppSize.html +1 -0
  48. package/docs/types/Player.AudioLikeEvent.html +2 -2
  49. package/docs/types/Player.CameraMovementData.html +1 -1
  50. package/docs/types/Player.CustomData.html +1 -1
  51. package/docs/types/Player.InfoPanelData.html +2 -2
  52. package/docs/types/Player.ModelVideoData.html +5 -5
  53. package/docs/types/Player.PanoEffectData.html +2 -2
  54. package/docs/types/Player.PanoTagData.html +2 -2
  55. package/docs/types/Player.PanoTextLabelData.html +2 -2
  56. package/docs/types/Player.PrompterData.html +2 -2
  57. package/docs/types/Player.QuadrangleVertexs.html +1 -1
  58. package/docs/types/Player.Quaternion.html +2 -2
  59. package/docs/types/Player.UpdateVRPanoramaData.html +2 -2
  60. package/docs/types/Player.Vertexs.html +1 -1
  61. package/docs/types/Player.VideoEffectData.html +2 -2
  62. package/docs/types/Player.VreoKeyframeEvent.html +1 -1
  63. package/docs/types/Player.VreoKeyframeMap.html +2 -2
  64. package/docs/types/Player.VreoSubscribe.html +1 -1
  65. package/docs/types/Player.WaveAppearance.html +1 -0
  66. package/docs/types/fivePlugins.CSS3DRenderPluginParameterType.html +1 -0
  67. package/docs/types/fivePlugins.MoveArgs.html +1 -1
  68. package/docs/types/fivePlugins.MoveOpts.html +1 -1
  69. package/docs/types/fivePlugins.RotateArgs.html +1 -1
  70. package/docs/types/fivePlugins.RotateOpts.html +1 -1
  71. package/docs/variables/fivePlugins.CSS3DRenderPlugin.html +2 -2
  72. package/docs/variables/fivePlugins.CameraMovementPlugin.html +1 -1
  73. package/docs/variables/fivePlugins.ModelTVVideoPlugin.html +1 -1
  74. package/docs/variables/react.VreoProvider.html +9 -1
  75. package/lib/PlayController/createHTMLAudioElement.js +5 -12
  76. package/lib/PlayController/index.js +27 -34
  77. package/lib/Player/App.js +25 -34
  78. package/lib/Player/Controller.d.ts +106 -2
  79. package/lib/Player/Controller.js +190 -78
  80. package/lib/Player/custom/SpatialScenePanel/index.js +20 -31
  81. package/lib/Player/hooks.js +6 -15
  82. package/lib/Player/index.d.ts +103 -0
  83. package/lib/Player/index.js +153 -45
  84. package/lib/Player/modules/Drawer/index.js +8 -17
  85. package/lib/Player/modules/PopUp/index.js +8 -17
  86. package/lib/Player/modules/ResizeObserver/index.js +10 -17
  87. package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +108 -7
  88. package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +157 -52
  89. package/lib/Player/modules/VideoAgent/VideoAgentScene.js +16 -25
  90. package/lib/Player/modules/VideoAgent/index.js +8 -17
  91. package/lib/Player/modules/Wave/index.js +24 -33
  92. package/lib/Player/modules/keyframes/BgMusic/index.js +13 -22
  93. package/lib/Player/modules/keyframes/CameraMovement/index.js +17 -26
  94. package/lib/Player/modules/keyframes/InfoPanel/index.js +13 -21
  95. package/lib/Player/modules/keyframes/ModelVideo/index.js +17 -26
  96. package/lib/Player/modules/keyframes/PanoEffect/index.js +21 -30
  97. package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +6 -14
  98. package/lib/Player/modules/keyframes/PanoTag/index.js +10 -18
  99. package/lib/Player/modules/keyframes/PanoTextLabel/index.js +19 -28
  100. package/lib/Player/modules/keyframes/Prompter/index.js +13 -22
  101. package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +16 -24
  102. package/lib/Player/modules/keyframes/VideoEffect/index.js +18 -28
  103. package/lib/Player/typings.js +1 -5
  104. package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +3 -9
  105. package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +1 -7
  106. package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +1 -7
  107. package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +6 -12
  108. package/lib/fivePlugins/CSS3DRenderPlugin/index.js +27 -37
  109. package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +3 -9
  110. package/lib/fivePlugins/CameraMovementPlugin/index.js +15 -22
  111. package/lib/fivePlugins/CameraMovementPlugin/typings.js +6 -10
  112. package/lib/fivePlugins/ModelTVVideoPlugin/index.js +9 -18
  113. package/lib/index.js +1 -12
  114. package/lib/react/index.d.ts +111 -0
  115. package/lib/react/index.js +148 -24
  116. package/lib/shared-utils/Audio.js +27 -37
  117. package/lib/shared-utils/AudioLike.js +22 -29
  118. package/lib/shared-utils/Preloader.js +1 -7
  119. package/lib/shared-utils/addResizeListener.js +4 -11
  120. package/lib/shared-utils/animationFrame/BetterTween.js +23 -33
  121. package/lib/shared-utils/animationFrame/index.js +4 -13
  122. package/lib/shared-utils/animationFrame/tween.js +9 -17
  123. package/lib/shared-utils/createTransMatrix.js +5 -14
  124. package/lib/shared-utils/getFileExpandedName.js +1 -7
  125. package/lib/shared-utils/getMediaInfo.js +8 -19
  126. package/lib/shared-utils/setElementDataset.js +1 -7
  127. package/lib/typings/VreoUnit.js +15 -17
  128. package/package.json +58 -5
  129. package/stylesheets/custom/SpatialScenePanel.css +7 -7
  130. package/stylesheets/default.css +1 -1
  131. package/docs/demo/assets/react-dPVEotm3.css +0 -1
  132. /package/docs/demo/assets/{react-BLZb_LNZ.js → react-C4h9qndP.js} +0 -0
@@ -1,36 +1,29 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.PlayController = void 0;
8
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
13
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
15
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
16
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
- var _five = require("@realsee/five");
18
- var _animationFrame = require("../shared-utils/animationFrame");
19
- var _createHTMLAudioElement = require("./createHTMLAudioElement");
20
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2["default"])(t); if (r) { var s = (0, _getPrototypeOf2["default"])(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2["default"])(this, e); }; }
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
5
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
8
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
10
+ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
21
11
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
+ import { Subscribe } from '@realsee/five';
13
+ import { requestAnimationFrameInterval } from "../shared-utils/animationFrame/index.js";
14
+ import { createHTMLAudioElement } from "./createHTMLAudioElement.js";
22
15
  var closures = {};
23
- var PlayController = exports.PlayController = /*#__PURE__*/function (_Subscribe) {
24
- (0, _inherits2["default"])(PlayController, _Subscribe);
16
+ export var PlayController = /*#__PURE__*/function (_Subscribe) {
17
+ _inherits(PlayController, _Subscribe);
25
18
  var _super = _createSuper(PlayController);
26
19
  function PlayController() {
27
20
  var _this;
28
21
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
29
- (0, _classCallCheck2["default"])(this, PlayController);
22
+ _classCallCheck(this, PlayController);
30
23
  _this = _super.call(this);
31
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "config", {});
24
+ _defineProperty(_assertThisInitialized(_this), "config", {});
32
25
  if (!config.audio) {
33
- config.audio = (0, _createHTMLAudioElement.createHTMLAudioElement)();
26
+ config.audio = createHTMLAudioElement();
34
27
  }
35
28
  _this.config = Object.assign(_this.config, config);
36
29
  closures.onPlaying = function () {
@@ -45,7 +38,7 @@ var PlayController = exports.PlayController = /*#__PURE__*/function (_Subscribe)
45
38
  _this.audioInstance.addEventListener('play', closures.onPlaying);
46
39
  _this.audioInstance.addEventListener('pause', closures.onPaused);
47
40
  _this.audioInstance.addEventListener('ended', closures.onEnded);
48
- _this.stopInterval = (0, _animationFrame.requestAnimationFrameInterval)(function () {
41
+ _this.stopInterval = requestAnimationFrameInterval(function () {
49
42
  if (_this.audioInstance.paused) {
50
43
  return;
51
44
  }
@@ -72,7 +65,7 @@ var PlayController = exports.PlayController = /*#__PURE__*/function (_Subscribe)
72
65
  /**
73
66
  * 载入数据
74
67
  */
75
- (0, _createClass2["default"])(PlayController, [{
68
+ _createClass(PlayController, [{
76
69
  key: "paused",
77
70
  get: function get() {
78
71
  return this.audioInstance.paused;
@@ -112,9 +105,9 @@ var PlayController = exports.PlayController = /*#__PURE__*/function (_Subscribe)
112
105
  }, {
113
106
  key: "load",
114
107
  value: (function () {
115
- var _load = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(vreoUnit) {
108
+ var _load = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(vreoUnit) {
116
109
  var _this3 = this;
117
- return _regenerator["default"].wrap(function _callee$(_context) {
110
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
118
111
  while (1) {
119
112
  switch (_context.prev = _context.next) {
120
113
  case 0:
@@ -160,8 +153,8 @@ var PlayController = exports.PlayController = /*#__PURE__*/function (_Subscribe)
160
153
  }, {
161
154
  key: "play",
162
155
  value: (function () {
163
- var _play = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
164
- return _regenerator["default"].wrap(function _callee2$(_context2) {
156
+ var _play = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
157
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
165
158
  while (1) {
166
159
  switch (_context2.prev = _context2.next) {
167
160
  case 0:
@@ -185,8 +178,8 @@ var PlayController = exports.PlayController = /*#__PURE__*/function (_Subscribe)
185
178
  }, {
186
179
  key: "pause",
187
180
  value: (function () {
188
- var _pause = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
189
- return _regenerator["default"].wrap(function _callee3$(_context3) {
181
+ var _pause = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
182
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
190
183
  while (1) {
191
184
  switch (_context3.prev = _context3.next) {
192
185
  case 0:
@@ -230,4 +223,4 @@ var PlayController = exports.PlayController = /*#__PURE__*/function (_Subscribe)
230
223
  }
231
224
  }]);
232
225
  return PlayController;
233
- }(_five.Subscribe);
226
+ }(Subscribe);
package/lib/Player/App.js CHANGED
@@ -1,43 +1,34 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.App = App;
9
- var React = _interopRequireWildcard(require("react"));
10
- var _classnames = _interopRequireDefault(require("classnames"));
11
- var _mobxReact = require("mobx-react");
12
- var _hooks = require("./hooks");
13
- var _CameraMovement = require("./modules/keyframes/CameraMovement");
14
- var _ResizeObserver = require("./modules/ResizeObserver");
15
- var _InfoPanel = require("./modules/keyframes/InfoPanel");
16
- var _ModelVideo = require("./modules/keyframes/ModelVideo");
17
- var _PanoEffect = require("./modules/keyframes/PanoEffect");
18
- var _PanoTag = require("./modules/keyframes/PanoTag");
19
- var _PanoTextLabel = require("./modules/keyframes/PanoTextLabel");
20
- var _Prompter = require("./modules/keyframes/Prompter");
21
- var _UpdateVRPanorama = require("./modules/keyframes/UpdateVRPanorama");
22
- var _VideoEffect = require("./modules/keyframes/VideoEffect");
23
- var _VideoAgent = require("./modules/VideoAgent");
24
- var _BgMusic = require("./modules/keyframes/BgMusic");
25
- var _Wave = require("./modules/Wave");
26
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) { "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); } return f; })(e, t); }
27
- var AppView = (0, _mobxReact.observer)(function (_ref) {
1
+ import * as React from 'react';
2
+ import classNames from 'classnames';
3
+ import { observer } from 'mobx-react';
4
+ import { useController } from "./hooks.js";
5
+ import { CameraMovement } from "./modules/keyframes/CameraMovement/index.js";
6
+ import { ResizeObserver } from "./modules/ResizeObserver/index.js";
7
+ import { InfoPanel } from "./modules/keyframes/InfoPanel/index.js";
8
+ import { ModelVideo } from "./modules/keyframes/ModelVideo/index.js";
9
+ import { PanoEffect } from "./modules/keyframes/PanoEffect/index.js";
10
+ import { PanoTag } from "./modules/keyframes/PanoTag/index.js";
11
+ import { PanoTextLabel } from "./modules/keyframes/PanoTextLabel/index.js";
12
+ import { Prompter } from "./modules/keyframes/Prompter/index.js";
13
+ import { UpdateVRPanorama } from "./modules/keyframes/UpdateVRPanorama/index.js";
14
+ import { VideoEffect } from "./modules/keyframes/VideoEffect/index.js";
15
+ import { VideoAgent } from "./modules/VideoAgent/index.js";
16
+ import { BgMusic } from "./modules/keyframes/BgMusic/index.js";
17
+ import { Wave } from "./modules/Wave/index.js";
18
+ var AppView = observer(function (_ref) {
28
19
  var _controller$configs, _controller$waveAppea, _controller$configs3, _controller$configs4;
29
20
  var controller = _ref.controller;
30
21
  return /*#__PURE__*/React.createElement("div", {
31
- className: (0, _classnames["default"])('vreo-panel', {
22
+ className: classNames('vreo-panel', {
32
23
  'vreo-panel--hidden': !controller.visible
33
24
  })
34
25
  }, /*#__PURE__*/React.createElement("div", {
35
26
  className: "vreo-panel-inner"
36
- }, /*#__PURE__*/React.createElement(_Wave.Wave, {
27
+ }, /*#__PURE__*/React.createElement(Wave, {
37
28
  onClick: (_controller$configs = controller.configs) === null || _controller$configs === void 0 ? void 0 : _controller$configs.onWaveClick,
38
29
  appearance: (_controller$waveAppea = controller.waveAppearance) !== null && _controller$waveAppea !== void 0 ? _controller$waveAppea : 'single',
39
30
  staticPrefix: controller.configs.waveStaticPrefix
40
- }), /*#__PURE__*/React.createElement(_VideoAgent.VideoAgent, {
31
+ }), /*#__PURE__*/React.createElement(VideoAgent, {
41
32
  onClick: function onClick() {
42
33
  var _controller$configs2;
43
34
  if ((_controller$configs2 = controller.configs) !== null && _controller$configs2 !== void 0 && _controller$configs2.onAvatarClick) {
@@ -51,11 +42,11 @@ var AppView = (0, _mobxReact.observer)(function (_ref) {
51
42
  }
52
43
  },
53
44
  options: ((_controller$configs3 = controller.configs) === null || _controller$configs3 === void 0 ? void 0 : _controller$configs3.videoAgentMeshOptions) || {}
54
- }), /*#__PURE__*/React.createElement(_Prompter.Prompter, null), (_controller$configs4 = controller.configs) === null || _controller$configs4 === void 0 ? void 0 : _controller$configs4.customPanelChildren));
45
+ }), /*#__PURE__*/React.createElement(Prompter, null), (_controller$configs4 = controller.configs) === null || _controller$configs4 === void 0 ? void 0 : _controller$configs4.customPanelChildren));
55
46
  });
56
- function App() {
57
- var controller = (0, _hooks.useController)();
58
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_ResizeObserver.ResizeObserver, null), /*#__PURE__*/React.createElement(_CameraMovement.CameraMovement, null), /*#__PURE__*/React.createElement(_ModelVideo.ModelVideo, null), /*#__PURE__*/React.createElement(_UpdateVRPanorama.UpdateVRPanorama, null), /*#__PURE__*/React.createElement(_VideoEffect.VideoEffect, null), /*#__PURE__*/React.createElement(_PanoTag.PanoTag, null), /*#__PURE__*/React.createElement(_PanoTextLabel.PanoTextLabel, null), /*#__PURE__*/React.createElement(_InfoPanel.InfoPanel, null), /*#__PURE__*/React.createElement(_PanoEffect.PanoEffect, null), /*#__PURE__*/React.createElement(_BgMusic.BgMusic, null)), /*#__PURE__*/React.createElement(AppView, {
47
+ export function App() {
48
+ var controller = useController();
49
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ResizeObserver, null), /*#__PURE__*/React.createElement(CameraMovement, null), /*#__PURE__*/React.createElement(ModelVideo, null), /*#__PURE__*/React.createElement(UpdateVRPanorama, null), /*#__PURE__*/React.createElement(VideoEffect, null), /*#__PURE__*/React.createElement(PanoTag, null), /*#__PURE__*/React.createElement(PanoTextLabel, null), /*#__PURE__*/React.createElement(InfoPanel, null), /*#__PURE__*/React.createElement(PanoEffect, null), /*#__PURE__*/React.createElement(BgMusic, null)), /*#__PURE__*/React.createElement(AppView, {
59
50
  controller: controller
60
51
  }));
61
52
  }
@@ -4,7 +4,28 @@ import { VreoKeyframe, VreoKeyframeEnum, VreoKeyframeEvent, VreoUnit, VreoVideo
4
4
  import { VideoAgentScene } from './modules/VideoAgent/VideoAgentScene';
5
5
  import { Appearance, PlayerConfigs, WaveAppearance } from './typings';
6
6
  /**
7
- * 逻辑控制器:内部状态。
7
+ * Vreo 播放器逻辑控制器
8
+ *
9
+ * 负责管理播放器的内部状态、事件处理、UI 控制和剧本执行。
10
+ * 提供播放控制、外观设置、弹窗管理、抽屉控制等功能。
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const controller = new Controller({
15
+ * five: fiveInstance,
16
+ * container: document.getElementById('container'),
17
+ * configs: playerConfigs
18
+ * })
19
+ *
20
+ * // 设置播放状态
21
+ * controller.setPlaying(true)
22
+ *
23
+ * // 打开弹窗
24
+ * controller.openPopUp('弹窗内容')
25
+ *
26
+ * // 打开抽屉
27
+ * controller.openDrawer({ content: '抽屉内容', height: 300 })
28
+ * ```
8
29
  */
9
30
  export declare class Controller extends Subscribe<VreoKeyframeEvent> {
10
31
  five: Five;
@@ -25,39 +46,122 @@ export declare class Controller extends Subscribe<VreoKeyframeEvent> {
25
46
  appearance: Appearance;
26
47
  avatar: VreoVideo['avatar'];
27
48
  visible: boolean;
49
+ /**
50
+ * 获取当前播放媒体的类型
51
+ * @returns 'video' | 'avatar' | 'none' - 媒体类型
52
+ */
28
53
  get agentType(): "video" | "none" | "avatar";
29
54
  popUp: string | JSX.Element | null;
55
+ /**
56
+ * 打开或关闭弹窗
57
+ * @param popUp - 弹窗内容,可以是字符串、JSX元素或false(关闭弹窗)
58
+ */
30
59
  openPopUp(popUp: string | JSX.Element | false): void;
60
+ /**
61
+ * 设置加载状态
62
+ * @param loading - 加载状态:true(加载中)、false(加载完成)、null(加载失败)
63
+ */
31
64
  setLoading(loading: boolean | null): void;
32
65
  drawerConfig: {
33
66
  content: string | JSX.Element;
34
67
  height?: number | string;
35
68
  } | null;
69
+ /**
70
+ * 设置虚拟形象配置
71
+ * @param avatar - 虚拟形象配置对象
72
+ */
36
73
  setAvatar(avatar: VreoVideo['avatar']): void;
74
+ /**
75
+ * 设置容器尺寸
76
+ * @param width - 容器宽度
77
+ * @param height - 容器高度
78
+ */
37
79
  setContainerSize(width: number, height: number): void;
80
+ /**
81
+ * 设置播放器可见性
82
+ * @param v - 是否可见
83
+ */
38
84
  setVisible(v: boolean): void;
85
+ /**
86
+ * 设置播放状态
87
+ * @param playing - 是否正在播放
88
+ */
39
89
  setPlaying(playing: boolean): void;
90
+ /**
91
+ * 设置结束状态
92
+ * @param ended - 是否已结束
93
+ */
40
94
  setEnded(ended: boolean): void;
95
+ /**
96
+ * 设置播放器外观
97
+ * @param appearance - 外观配置对象
98
+ */
41
99
  setAppearance(appearance: Appearance): void;
100
+ /**
101
+ * 打开或关闭抽屉
102
+ * @param drawerConfig - 抽屉配置对象,false表示关闭抽屉
103
+ */
42
104
  openDrawer(drawerConfig?: false | {
43
105
  content: string | JSX.Element;
44
106
  height?: number | string;
45
107
  }): void;
108
+ /**
109
+ * 创建 Controller 实例
110
+ * @param params - 构造参数对象
111
+ * @param params.five - Five 渲染引擎实例
112
+ * @param params.container - DOM 容器元素
113
+ * @param params.configs - 播放器配置
114
+ */
46
115
  constructor({ five, container, configs }: {
47
116
  five: Five;
48
117
  container: Element;
49
118
  configs: PlayerConfigs;
50
119
  });
120
+ /**
121
+ * 获取播放器是否准备就绪
122
+ * @returns 是否有可用的视频代理场景
123
+ */
51
124
  get ready(): boolean;
125
+ /**
126
+ * 获取当前播放时间(毫秒)
127
+ * @returns 当前播放时间戳
128
+ */
52
129
  get currentTime(): number;
130
+ /**
131
+ * 获取当前时间点应该触发的关键帧
132
+ * @returns 当前应该执行的关键帧数组
133
+ */
53
134
  get currentKeyframes(): VreoKeyframe[];
135
+ /**
136
+ * 获取当前媒体实例(音频或视频元素)
137
+ * @returns HTML媒体元素实例
138
+ */
54
139
  get mediaInstance(): HTMLVideoElement | HTMLAudioElement | import("../shared-utils/AudioLike").AudioLike | undefined;
55
140
  /**
56
- * 逐帧任务
141
+ * 逐帧任务循环处理
142
+ *
143
+ * 在每个动画帧中检查播放状态、处理关键帧触发等
144
+ * @param callback - 关键帧触发时的回调函数
57
145
  */
58
146
  requestAnimationFrameLoop(callback: (type: VreoKeyframeEnum, keyframe: VreoKeyframe, currentTime: number) => void): void;
147
+ /**
148
+ * 开始运行播放器逻辑循环
149
+ *
150
+ * 启动帧循环,持续监听并处理关键帧事件
151
+ * @param callback - 关键帧触发时的回调函数
152
+ */
59
153
  run(callback: (type: VreoKeyframeEnum, keyframe: VreoKeyframe) => void): void;
154
+ /**
155
+ * 清理播放器状态
156
+ *
157
+ * 停止播放、重置关键帧状态、清理数据和定时器
158
+ */
60
159
  clear(): void;
160
+ /**
161
+ * 销毁控制器实例
162
+ *
163
+ * 清理所有状态和资源,释放内存
164
+ */
61
165
  dispose(): void;
62
166
  }
63
167
  declare const ControllerContext: React.Context<Controller | null>;