@realsee/vreo 2.6.4-alpha.1 → 2.6.4-alpha.3

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 (136) hide show
  1. package/lib/PlayController/createHTMLAudioElement.js +10 -14
  2. package/lib/PlayController/index.js +63 -73
  3. package/lib/Player/App.js +2 -2
  4. package/lib/Player/Controller.d.ts +7 -1
  5. package/lib/Player/Controller.js +112 -75
  6. package/lib/Player/PlaybackLifecycle.d.ts +25 -0
  7. package/lib/Player/PlaybackLifecycle.js +117 -0
  8. package/lib/Player/custom/SpatialScenePanel/index.js +34 -11
  9. package/lib/Player/index.d.ts +7 -2
  10. package/lib/Player/index.js +198 -126
  11. package/lib/Player/modules/Drawer/index.js +1 -2
  12. package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +13 -1
  13. package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +209 -204
  14. package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +1 -0
  15. package/lib/Player/modules/VideoAgent/VideoAgentScene.js +6 -2
  16. package/lib/Player/modules/VideoAgent/index.js +10 -2
  17. package/lib/Player/modules/keyframes/BgMusic/index.js +50 -74
  18. package/lib/Player/modules/keyframes/CameraMovement/index.js +43 -45
  19. package/lib/Player/modules/keyframes/InfoPanel/index.js +45 -35
  20. package/lib/Player/modules/keyframes/ModelVideo/index.js +95 -57
  21. package/lib/Player/modules/keyframes/PanoTag/index.js +4 -2
  22. package/lib/Player/modules/keyframes/PanoTextLabel/index.js +3 -3
  23. package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +3 -3
  24. package/lib/Player/modules/keyframes/VideoEffect/index.js +93 -79
  25. package/lib/Player/playback-types.d.ts +21 -0
  26. package/lib/Player/playback-types.js +1 -0
  27. package/lib/Player/typings.d.ts +3 -0
  28. package/lib/fivePlugins/CSS3DRenderPlugin/index.js +6 -6
  29. package/lib/fivePlugins/CameraMovementPlugin/index.js +173 -180
  30. package/lib/fivePlugins/CameraMovementPlugin/typings.js +6 -6
  31. package/lib/fivePlugins/ModelTVVideoPlugin/index.d.ts +3 -0
  32. package/lib/fivePlugins/ModelTVVideoPlugin/index.js +182 -75
  33. package/lib/index.d.ts +1 -0
  34. package/lib/react/index.js +1 -1
  35. package/lib/shared-utils/Audio.js +55 -57
  36. package/lib/shared-utils/AudioLike.js +12 -14
  37. package/lib/shared-utils/animationFrame/BetterTween.js +13 -15
  38. package/lib/shared-utils/animationFrame/tween.js +1 -3
  39. package/lib/shared-utils/getMediaInfo.js +0 -1
  40. package/lib/typings/VreoUnit.js +134 -27
  41. package/package.json +6 -4
  42. package/docs/.nojekyll +0 -1
  43. package/docs/assets/custom.css +0 -78
  44. package/docs/assets/hierarchy.js +0 -1
  45. package/docs/assets/highlight.css +0 -127
  46. package/docs/assets/icons.js +0 -18
  47. package/docs/assets/icons.svg +0 -1
  48. package/docs/assets/main.js +0 -60
  49. package/docs/assets/navigation.js +0 -1
  50. package/docs/assets/search.js +0 -1
  51. package/docs/assets/style.css +0 -1640
  52. package/docs/classes/Player.AudioLike.html +0 -15
  53. package/docs/classes/Player.Controller.html +0 -87
  54. package/docs/classes/Player.Player.html +0 -54
  55. package/docs/classes/Player.VideoAgentMesh.html +0 -72
  56. package/docs/classes/Player.VideoAgentScene.html +0 -9
  57. package/docs/demo/assets/AppReact-CkuqZtcS.js +0 -1
  58. package/docs/demo/assets/default-BQGCQRLt.css +0 -1
  59. package/docs/demo/assets/default-CVvVdmSW.js +0 -5540
  60. package/docs/demo/assets/dynamic-CO5wq52h.js +0 -1
  61. package/docs/demo/assets/examples-BCLzFApO.css +0 -1
  62. package/docs/demo/assets/examples-DfiAz2fR.js +0 -25
  63. package/docs/demo/assets/index-CBBSwaYT.js +0 -1
  64. package/docs/demo/assets/index-CmEXi2sK.css +0 -1
  65. package/docs/demo/assets/main-BF1tvUg-.js +0 -25
  66. package/docs/demo/assets/react-BnzBLum3.css +0 -1
  67. package/docs/demo/assets/react-C4h9qndP.js +0 -25
  68. package/docs/demo/examples.html +0 -16
  69. package/docs/demo/index-react-dynamic.html +0 -18
  70. package/docs/demo/index-react.html +0 -19
  71. package/docs/demo/index.html +0 -19
  72. package/docs/enums/Player.InfoPanelStyleEnum.html +0 -3
  73. package/docs/enums/Player.InfoPanelTypeEnum.html +0 -4
  74. package/docs/enums/Player.PanoEffectEnum.html +0 -4
  75. package/docs/enums/Player.PanoTagEnum.html +0 -4
  76. package/docs/enums/Player.PanoTagStyleEnum.html +0 -6
  77. package/docs/enums/Player.VreoKeyframeEnum.html +0 -25
  78. package/docs/enums/fivePlugins.CameraMovementEffect.html +0 -3
  79. package/docs/enums/fivePlugins.Rotation.html +0 -4
  80. package/docs/functions/custom.SpatialScenePanel.html +0 -2
  81. package/docs/functions/react.useVreoAction.html +0 -8
  82. package/docs/functions/react.useVreoEventCallback.html +0 -10
  83. package/docs/functions/react.useVreoPausedState.html +0 -8
  84. package/docs/hierarchy.html +0 -1
  85. package/docs/index.html +0 -160
  86. package/docs/interfaces/Player.Appearance.html +0 -2
  87. package/docs/interfaces/Player.CustomVreoKeyframeProps.html +0 -3
  88. package/docs/interfaces/Player.PlayerConfigs.html +0 -20
  89. package/docs/interfaces/Player.Vertex.html +0 -5
  90. package/docs/interfaces/Player.VideoAgentMeshOptions.html +0 -9
  91. package/docs/interfaces/Player.VreoKeyframe.html +0 -8
  92. package/docs/interfaces/Player.VreoUnit.html +0 -9
  93. package/docs/interfaces/Player.VreoVideo.html +0 -7
  94. package/docs/interfaces/fivePlugins.CSS3DRenderPluginExportType.html +0 -8
  95. package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +0 -3
  96. package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +0 -5
  97. package/docs/interfaces/fivePlugins.CameraMovementPluginParameterType.html +0 -1
  98. package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +0 -5
  99. package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +0 -4
  100. package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +0 -2
  101. package/docs/interfaces/fivePlugins.Vector3Position.html +0 -5
  102. package/docs/interfaces/react.VreoActionCallbacks.html +0 -18
  103. package/docs/interfaces/react.VreoProviderProps.html +0 -6
  104. package/docs/modules/Player.html +0 -1
  105. package/docs/modules/custom.html +0 -1
  106. package/docs/modules/fivePlugins.html +0 -1
  107. package/docs/modules/react.html +0 -1
  108. package/docs/modules.html +0 -1
  109. package/docs/types/Player.AppSize.html +0 -1
  110. package/docs/types/Player.AudioLikeEvent.html +0 -6
  111. package/docs/types/Player.CameraMovementData.html +0 -2
  112. package/docs/types/Player.CustomData.html +0 -2
  113. package/docs/types/Player.InfoPanelData.html +0 -7
  114. package/docs/types/Player.ModelVideoData.html +0 -9
  115. package/docs/types/Player.PanoEffectData.html +0 -4
  116. package/docs/types/Player.PanoTagData.html +0 -6
  117. package/docs/types/Player.PanoTextLabelData.html +0 -7
  118. package/docs/types/Player.PrompterData.html +0 -3
  119. package/docs/types/Player.QuadrangleVertexs.html +0 -2
  120. package/docs/types/Player.Quaternion.html +0 -6
  121. package/docs/types/Player.UpdateVRPanoramaData.html +0 -7
  122. package/docs/types/Player.Vertexs.html +0 -2
  123. package/docs/types/Player.VideoEffectData.html +0 -7
  124. package/docs/types/Player.VreoKeyframeEvent.html +0 -2
  125. package/docs/types/Player.VreoKeyframeMap.html +0 -6
  126. package/docs/types/Player.VreoSubscribe.html +0 -1
  127. package/docs/types/Player.WaveAppearance.html +0 -1
  128. package/docs/types/fivePlugins.CSS3DRenderPluginParameterType.html +0 -1
  129. package/docs/types/fivePlugins.MoveArgs.html +0 -1
  130. package/docs/types/fivePlugins.MoveOpts.html +0 -1
  131. package/docs/types/fivePlugins.RotateArgs.html +0 -1
  132. package/docs/types/fivePlugins.RotateOpts.html +0 -1
  133. package/docs/variables/fivePlugins.CSS3DRenderPlugin.html +0 -3
  134. package/docs/variables/fivePlugins.CameraMovementPlugin.html +0 -2
  135. package/docs/variables/fivePlugins.ModelTVVideoPlugin.html +0 -1
  136. package/docs/variables/react.VreoProvider.html +0 -9
@@ -1,5 +1,6 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
3
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
3
4
  import { Five } from '@realsee/five';
4
5
  import { Rotation } from "./typings.js";
5
6
  var PI = Math.PI;
@@ -28,86 +29,83 @@ export var CameraMovementPlugin = function CameraMovementPlugin(five) {
28
29
  var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
29
30
  preload: true
30
31
  };
31
- return new Promise( /*#__PURE__*/function () {
32
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(resolve, reject) {
32
+ return new Promise(/*#__PURE__*/function () {
33
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(resolve, reject) {
33
34
  var _opts$asyncEndCallbac;
34
35
  var panoIndex, start, movePanoOptions;
35
- return _regeneratorRuntime.wrap(function _callee$(_context) {
36
- while (1) {
37
- switch (_context.prev = _context.next) {
38
- case 0:
39
- moving = true;
40
- if (opts.asyncStartCallback) {
41
- opts.asyncStartCallback();
42
- }
43
- if (!(five.panoIndex === undefined)) {
44
- _context.next = 4;
45
- break;
46
- }
47
- return _context.abrupt("return", reject(false));
48
- case 4:
49
- if (!(args.mode && args.mode !== five.currentMode)) {
50
- _context.next = 8;
51
- break;
52
- }
53
- _context.next = 7;
54
- return five.changeMode(args.mode, args, duration);
55
- case 7:
56
- return _context.abrupt("return", resolve(true));
57
- case 8:
58
- if (!(args.mode === Five.Mode.Floorplan)) {
59
- _context.next = 10;
60
- break;
61
- }
62
- return _context.abrupt("return", resolve(true));
63
- case 10:
64
- if (!(opts.preload && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex)) {
65
- _context.next = 13;
66
- break;
67
- }
68
- _context.next = 13;
69
- return five.preloadPano(args.panoIndex);
70
- case 13:
71
- (_opts$asyncEndCallbac = opts.asyncEndCallback) === null || _opts$asyncEndCallbac === void 0 ? void 0 : _opts$asyncEndCallbac.call(opts);
72
- if (!(args.panoIndex === undefined && args.fov === undefined && args.latitude === undefined && args.longitude === undefined)) {
73
- _context.next = 16;
74
- break;
75
- }
76
- return _context.abrupt("return", resolve(true));
77
- case 16:
78
- panoIndex = args.panoIndex !== undefined ? args.panoIndex : five.panoIndex;
79
- if (!(panoIndex !== undefined)) {
80
- _context.next = 26;
81
- break;
82
- }
83
- start = performance.now();
84
- _context.next = 21;
85
- return five.ready();
86
- case 21:
87
- movePanoOptions = Object.assign({}, args, {
88
- duration: duration - (performance.now() - start),
89
- // 移动耗时
90
- moveEndCallback: function moveEndCallback() {
91
- return resolve(true);
92
- },
93
- // 移动结束
94
- moveCancelCallback: function moveCancelCallback() {
95
- resolve(true);
96
- },
97
- // 移动开始
98
- effect: args.transEffect || 'fly'
99
- });
100
- _context.next = 24;
101
- return five.moveToPano(panoIndex, movePanoOptions);
102
- case 24:
103
- _context.next = 27;
36
+ return _regenerator().w(function (_context) {
37
+ while (1) switch (_context.n) {
38
+ case 0:
39
+ moving = true;
40
+ if (opts.asyncStartCallback) {
41
+ opts.asyncStartCallback();
42
+ }
43
+ if (!(five.panoIndex === undefined)) {
44
+ _context.n = 1;
104
45
  break;
105
- case 26:
106
- reject(false);
107
- case 27:
108
- case "end":
109
- return _context.stop();
110
- }
46
+ }
47
+ return _context.a(2, reject(false));
48
+ case 1:
49
+ if (!(args.mode && args.mode !== five.currentMode)) {
50
+ _context.n = 3;
51
+ break;
52
+ }
53
+ _context.n = 2;
54
+ return five.changeMode(args.mode, args, duration);
55
+ case 2:
56
+ return _context.a(2, resolve(true));
57
+ case 3:
58
+ if (!(args.mode === Five.Mode.Floorplan)) {
59
+ _context.n = 4;
60
+ break;
61
+ }
62
+ return _context.a(2, resolve(true));
63
+ case 4:
64
+ if (!(opts.preload && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex)) {
65
+ _context.n = 5;
66
+ break;
67
+ }
68
+ _context.n = 5;
69
+ return five.preloadPano(args.panoIndex);
70
+ case 5:
71
+ (_opts$asyncEndCallbac = opts.asyncEndCallback) === null || _opts$asyncEndCallbac === void 0 || _opts$asyncEndCallbac.call(opts);
72
+ if (!(args.panoIndex === undefined && args.fov === undefined && args.latitude === undefined && args.longitude === undefined)) {
73
+ _context.n = 6;
74
+ break;
75
+ }
76
+ return _context.a(2, resolve(true));
77
+ case 6:
78
+ panoIndex = args.panoIndex !== undefined ? args.panoIndex : five.panoIndex;
79
+ if (!(panoIndex !== undefined)) {
80
+ _context.n = 9;
81
+ break;
82
+ }
83
+ start = performance.now();
84
+ _context.n = 7;
85
+ return five.ready();
86
+ case 7:
87
+ movePanoOptions = Object.assign({}, args, {
88
+ duration: duration - (performance.now() - start),
89
+ // 移动耗时
90
+ moveEndCallback: function moveEndCallback() {
91
+ return resolve(true);
92
+ },
93
+ // 移动结束
94
+ moveCancelCallback: function moveCancelCallback() {
95
+ resolve(true);
96
+ },
97
+ // 移动开始
98
+ effect: args.transEffect || 'fly'
99
+ });
100
+ _context.n = 8;
101
+ return five.moveToPano(panoIndex, movePanoOptions);
102
+ case 8:
103
+ _context.n = 10;
104
+ break;
105
+ case 9:
106
+ reject(false);
107
+ case 10:
108
+ return _context.a(2);
111
109
  }
112
110
  }, _callee);
113
111
  }));
@@ -117,7 +115,7 @@ export var CameraMovementPlugin = function CameraMovementPlugin(five) {
117
115
  }());
118
116
  };
119
117
  var rotate = /*#__PURE__*/function () {
120
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(args, duration) {
118
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(args, duration) {
121
119
  var _opts$asyncStartCallb, _opts$asyncEndCallbac2;
122
120
  var opts,
123
121
  from,
@@ -125,112 +123,107 @@ export var CameraMovementPlugin = function CameraMovementPlugin(five) {
125
123
  timeEnd,
126
124
  start,
127
125
  animeDuration,
128
- onFiveRenderFrame,
126
+ _onFiveRenderFrame,
129
127
  _args2 = arguments;
130
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
131
- while (1) {
132
- switch (_context2.prev = _context2.next) {
133
- case 0:
134
- opts = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
135
- moving = false;
136
- (_opts$asyncStartCallb = opts.asyncStartCallback) === null || _opts$asyncStartCallb === void 0 ? void 0 : _opts$asyncStartCallb.call(opts);
128
+ return _regenerator().w(function (_context2) {
129
+ while (1) switch (_context2.n) {
130
+ case 0:
131
+ opts = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
132
+ moving = false;
133
+ (_opts$asyncStartCallb = opts.asyncStartCallback) === null || _opts$asyncStartCallb === void 0 || _opts$asyncStartCallb.call(opts);
137
134
 
138
- // 先切换模型再出旋转效果
139
- if (!(args.mode && five.currentMode !== args.mode)) {
140
- _context2.next = 6;
141
- break;
142
- }
143
- _context2.next = 6;
144
- return five.changeMode(args.mode, args.mode === Five.Mode.Panorama ? {
145
- latitude: 0
146
- } : undefined);
147
- case 6:
148
- if (!(args.mode === Five.Mode.Panorama && five.currentMode === Five.Mode.Panorama && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex)) {
149
- _context2.next = 12;
150
- break;
151
- }
152
- if (!opts.preload) {
153
- _context2.next = 10;
154
- break;
155
- }
156
- _context2.next = 10;
157
- return five.preloadPano(args.panoIndex);
158
- case 10:
159
- _context2.next = 12;
160
- return new Promise(function (resolve, reject) {
161
- five.moveToPano(args.panoIndex, {
162
- moveEndCallback: function moveEndCallback() {
163
- return resolve(true);
164
- },
165
- // 移动结束
166
- moveCancelCallback: function moveCancelCallback() {
167
- return reject(false);
168
- },
169
- // 移动开始
170
- effect: 'fade'
171
- });
135
+ // 先切换模型再出旋转效果
136
+ if (!(args.mode && five.currentMode !== args.mode)) {
137
+ _context2.n = 1;
138
+ break;
139
+ }
140
+ _context2.n = 1;
141
+ return five.changeMode(args.mode, args.mode === Five.Mode.Panorama ? {
142
+ latitude: 0
143
+ } : undefined);
144
+ case 1:
145
+ if (!(args.mode === Five.Mode.Panorama && five.currentMode === Five.Mode.Panorama && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex)) {
146
+ _context2.n = 3;
147
+ break;
148
+ }
149
+ if (!opts.preload) {
150
+ _context2.n = 2;
151
+ break;
152
+ }
153
+ _context2.n = 2;
154
+ return five.preloadPano(args.panoIndex);
155
+ case 2:
156
+ _context2.n = 3;
157
+ return new Promise(function (resolve, reject) {
158
+ five.moveToPano(args.panoIndex, {
159
+ moveEndCallback: function moveEndCallback() {
160
+ return resolve(true);
161
+ },
162
+ // 移动结束
163
+ moveCancelCallback: function moveCancelCallback() {
164
+ return reject(false);
165
+ },
166
+ // 移动开始
167
+ effect: 'fade'
172
168
  });
173
- case 12:
174
- _context2.next = 14;
175
- return five.ready();
176
- case 14:
177
- (_opts$asyncEndCallbac2 = opts.asyncEndCallback) === null || _opts$asyncEndCallbac2 === void 0 ? void 0 : _opts$asyncEndCallbac2.call(opts);
169
+ });
170
+ case 3:
171
+ _context2.n = 4;
172
+ return five.ready();
173
+ case 4:
174
+ (_opts$asyncEndCallbac2 = opts.asyncEndCallback) === null || _opts$asyncEndCallbac2 === void 0 || _opts$asyncEndCallbac2.call(opts);
178
175
 
179
- // 计算to
180
- from = five.getCurrentState();
181
- to = function () {
182
- return args;
183
- }();
184
- timeEnd = false; // 开始时间
185
- start = performance.now();
186
- animeDuration = duration;
187
- if (args.rotation === Rotation.Loop) {
188
- animeDuration = args.rotateSpeed ? Math.ceil(Math.abs(to.longitude - from.longitude) / args.rotateSpeed * 1000) : duration;
189
- animeDuration = Math.min(duration, animeDuration);
176
+ // 计算to
177
+ from = five.getCurrentState();
178
+ to = function () {
179
+ return args;
180
+ }();
181
+ timeEnd = false; // 开始时间
182
+ start = performance.now();
183
+ animeDuration = duration;
184
+ if (args.rotation === Rotation.Loop) {
185
+ animeDuration = args.rotateSpeed ? Math.ceil(Math.abs(to.longitude - from.longitude) / args.rotateSpeed * 1000) : duration;
186
+ animeDuration = Math.min(duration, animeDuration);
187
+ }
188
+ _onFiveRenderFrame = function onFiveRenderFrame() {
189
+ if (timeEnd || moving) {
190
+ five.off('renderFrame', _onFiveRenderFrame);
191
+ return;
190
192
  }
191
- onFiveRenderFrame = function onFiveRenderFrame() {
192
- if (timeEnd || moving) {
193
- five.off('renderFrame', onFiveRenderFrame);
194
- return;
195
- }
196
- var targetState = {};
197
- if (args.rotation !== Rotation.Loop) {
198
- var progress = (performance.now() - start) / duration;
199
- targetState = {
200
- fov: progressNumber(from.fov, to.fov, progress),
201
- latitude: progressNumber(from.latitude, to.latitude, progress),
202
- longitude: progressLongitude(from.longitude, to.longitude, args.rotation, progress)
203
- };
204
- } else {
205
- var _progress = (performance.now() - start) / animeDuration; // 可能大于1
206
- var times = Math.floor(_progress);
207
- var progress2 = _progress - times; // 一定小于1
208
- var isNegative = times % 2 === 1; // 是否为反向旋转, 0: 正, 1: 反, 2: 正, 3: 反 以此类推
209
- var resultProgress = isNegative ? 1 - progress2 : progress2;
210
- targetState = {
211
- fov: progressNumber(from.fov, to.fov, resultProgress),
212
- latitude: progressNumber(from.latitude, to.latitude, resultProgress),
213
- longitude: progressNumber(from.longitude, to.longitude, resultProgress)
214
- };
215
- }
216
- five.setState(targetState, true);
217
- };
218
- five.on('renderFrame', onFiveRenderFrame);
219
- _context2.next = 25;
220
- return new Promise(function (resolve) {
221
- setTimeout(function () {
222
- timeEnd = true;
223
- five.off('renderFrame', onFiveRenderFrame);
224
- // 总时间到了之后强制结束,同时也是 Loop 模式的结束方式
225
- resolve(true);
226
- }, duration);
227
- });
228
- case 25:
229
- return _context2.abrupt("return", _context2.sent);
230
- case 26:
231
- case "end":
232
- return _context2.stop();
233
- }
193
+ var targetState = {};
194
+ if (args.rotation !== Rotation.Loop) {
195
+ var progress = (performance.now() - start) / duration;
196
+ targetState = {
197
+ fov: progressNumber(from.fov, to.fov, progress),
198
+ latitude: progressNumber(from.latitude, to.latitude, progress),
199
+ longitude: progressLongitude(from.longitude, to.longitude, args.rotation, progress)
200
+ };
201
+ } else {
202
+ var _progress = (performance.now() - start) / animeDuration; // 可能大于1
203
+ var times = Math.floor(_progress);
204
+ var progress2 = _progress - times; // 一定小于1
205
+ var isNegative = times % 2 === 1; // 是否为反向旋转, 0: 正, 1: 反, 2: 正, 3: 反 以此类推
206
+ var resultProgress = isNegative ? 1 - progress2 : progress2;
207
+ targetState = {
208
+ fov: progressNumber(from.fov, to.fov, resultProgress),
209
+ latitude: progressNumber(from.latitude, to.latitude, resultProgress),
210
+ longitude: progressNumber(from.longitude, to.longitude, resultProgress)
211
+ };
212
+ }
213
+ five.setState(targetState, true);
214
+ };
215
+ five.on('renderFrame', _onFiveRenderFrame);
216
+ _context2.n = 5;
217
+ return new Promise(function (resolve) {
218
+ setTimeout(function () {
219
+ timeEnd = true;
220
+ five.off('renderFrame', _onFiveRenderFrame);
221
+ // 总时间到了之后强制结束,同时也是 Loop 模式的结束方式
222
+ resolve(true);
223
+ }, duration);
224
+ });
225
+ case 5:
226
+ return _context2.a(2, _context2.v);
234
227
  }
235
228
  }, _callee2);
236
229
  }));
@@ -2,14 +2,14 @@
2
2
 
3
3
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
4
4
 
5
- export var CameraMovementEffect;
6
- (function (CameraMovementEffect) {
5
+ export var CameraMovementEffect = /*#__PURE__*/function (CameraMovementEffect) {
7
6
  CameraMovementEffect["Move"] = "Move";
8
7
  CameraMovementEffect["Rotate"] = "Rotate";
9
- })(CameraMovementEffect || (CameraMovementEffect = {}));
10
- export var Rotation;
11
- (function (Rotation) {
8
+ return CameraMovementEffect;
9
+ }({});
10
+ export var Rotation = /*#__PURE__*/function (Rotation) {
12
11
  Rotation["Clockwise"] = "Clockwise";
13
12
  Rotation["Anticlockwise"] = "Anticlockwise";
14
13
  Rotation["Loop"] = "Loop";
15
- })(Rotation || (Rotation = {}));
14
+ return Rotation;
15
+ }({});
@@ -1,4 +1,5 @@
1
1
  import type { FivePlugin } from '@realsee/five';
2
+ import type { PlaybackManager } from '../../Player/playback-types';
2
3
  export interface ModelTVVideoPluginData {
3
4
  enable?: boolean;
4
5
  video_src: string;
@@ -11,10 +12,12 @@ export interface ModelTVVideoPluginData {
11
12
  }
12
13
  export interface ModelTVVideoPluginParameterType {
13
14
  videoElement?: HTMLVideoElement;
15
+ mediaManager?: PlaybackManager;
14
16
  }
15
17
  export interface ModelTVVideoPluginExportType {
16
18
  enable: () => void;
17
19
  disable: () => void;
20
+ dispose: () => void;
18
21
  load: (data: ModelTVVideoPluginData, videoElement?: HTMLVideoElement) => Promise<void>;
19
22
  }
20
23
  export declare const ModelTVVideoPlugin: FivePlugin<ModelTVVideoPluginParameterType, ModelTVVideoPluginExportType>;