@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.
- package/lib/PlayController/createHTMLAudioElement.js +10 -14
- package/lib/PlayController/index.js +63 -73
- package/lib/Player/App.js +2 -2
- package/lib/Player/Controller.d.ts +7 -1
- package/lib/Player/Controller.js +112 -75
- package/lib/Player/PlaybackLifecycle.d.ts +25 -0
- package/lib/Player/PlaybackLifecycle.js +117 -0
- package/lib/Player/custom/SpatialScenePanel/index.js +34 -11
- package/lib/Player/index.d.ts +7 -2
- package/lib/Player/index.js +198 -126
- package/lib/Player/modules/Drawer/index.js +1 -2
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +13 -1
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +209 -204
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +1 -0
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +6 -2
- package/lib/Player/modules/VideoAgent/index.js +10 -2
- package/lib/Player/modules/keyframes/BgMusic/index.js +50 -74
- package/lib/Player/modules/keyframes/CameraMovement/index.js +43 -45
- package/lib/Player/modules/keyframes/InfoPanel/index.js +45 -35
- package/lib/Player/modules/keyframes/ModelVideo/index.js +95 -57
- package/lib/Player/modules/keyframes/PanoTag/index.js +4 -2
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +3 -3
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +3 -3
- package/lib/Player/modules/keyframes/VideoEffect/index.js +93 -79
- package/lib/Player/playback-types.d.ts +21 -0
- package/lib/Player/playback-types.js +1 -0
- package/lib/Player/typings.d.ts +3 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.js +6 -6
- package/lib/fivePlugins/CameraMovementPlugin/index.js +173 -180
- package/lib/fivePlugins/CameraMovementPlugin/typings.js +6 -6
- package/lib/fivePlugins/ModelTVVideoPlugin/index.d.ts +3 -0
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +182 -75
- package/lib/index.d.ts +1 -0
- package/lib/react/index.js +1 -1
- package/lib/shared-utils/Audio.js +55 -57
- package/lib/shared-utils/AudioLike.js +12 -14
- package/lib/shared-utils/animationFrame/BetterTween.js +13 -15
- package/lib/shared-utils/animationFrame/tween.js +1 -3
- package/lib/shared-utils/getMediaInfo.js +0 -1
- package/lib/typings/VreoUnit.js +134 -27
- package/package.json +6 -4
- package/docs/.nojekyll +0 -1
- package/docs/assets/custom.css +0 -78
- package/docs/assets/hierarchy.js +0 -1
- package/docs/assets/highlight.css +0 -127
- package/docs/assets/icons.js +0 -18
- package/docs/assets/icons.svg +0 -1
- package/docs/assets/main.js +0 -60
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1640
- package/docs/classes/Player.AudioLike.html +0 -15
- package/docs/classes/Player.Controller.html +0 -87
- package/docs/classes/Player.Player.html +0 -54
- package/docs/classes/Player.VideoAgentMesh.html +0 -72
- package/docs/classes/Player.VideoAgentScene.html +0 -9
- package/docs/demo/assets/AppReact-CkuqZtcS.js +0 -1
- package/docs/demo/assets/default-BQGCQRLt.css +0 -1
- package/docs/demo/assets/default-CVvVdmSW.js +0 -5540
- package/docs/demo/assets/dynamic-CO5wq52h.js +0 -1
- package/docs/demo/assets/examples-BCLzFApO.css +0 -1
- package/docs/demo/assets/examples-DfiAz2fR.js +0 -25
- package/docs/demo/assets/index-CBBSwaYT.js +0 -1
- package/docs/demo/assets/index-CmEXi2sK.css +0 -1
- package/docs/demo/assets/main-BF1tvUg-.js +0 -25
- package/docs/demo/assets/react-BnzBLum3.css +0 -1
- package/docs/demo/assets/react-C4h9qndP.js +0 -25
- package/docs/demo/examples.html +0 -16
- package/docs/demo/index-react-dynamic.html +0 -18
- package/docs/demo/index-react.html +0 -19
- package/docs/demo/index.html +0 -19
- package/docs/enums/Player.InfoPanelStyleEnum.html +0 -3
- package/docs/enums/Player.InfoPanelTypeEnum.html +0 -4
- package/docs/enums/Player.PanoEffectEnum.html +0 -4
- package/docs/enums/Player.PanoTagEnum.html +0 -4
- package/docs/enums/Player.PanoTagStyleEnum.html +0 -6
- package/docs/enums/Player.VreoKeyframeEnum.html +0 -25
- package/docs/enums/fivePlugins.CameraMovementEffect.html +0 -3
- package/docs/enums/fivePlugins.Rotation.html +0 -4
- package/docs/functions/custom.SpatialScenePanel.html +0 -2
- package/docs/functions/react.useVreoAction.html +0 -8
- package/docs/functions/react.useVreoEventCallback.html +0 -10
- package/docs/functions/react.useVreoPausedState.html +0 -8
- package/docs/hierarchy.html +0 -1
- package/docs/index.html +0 -160
- package/docs/interfaces/Player.Appearance.html +0 -2
- package/docs/interfaces/Player.CustomVreoKeyframeProps.html +0 -3
- package/docs/interfaces/Player.PlayerConfigs.html +0 -20
- package/docs/interfaces/Player.Vertex.html +0 -5
- package/docs/interfaces/Player.VideoAgentMeshOptions.html +0 -9
- package/docs/interfaces/Player.VreoKeyframe.html +0 -8
- package/docs/interfaces/Player.VreoUnit.html +0 -9
- package/docs/interfaces/Player.VreoVideo.html +0 -7
- package/docs/interfaces/fivePlugins.CSS3DRenderPluginExportType.html +0 -8
- package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +0 -3
- package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +0 -5
- package/docs/interfaces/fivePlugins.CameraMovementPluginParameterType.html +0 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +0 -5
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +0 -4
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +0 -2
- package/docs/interfaces/fivePlugins.Vector3Position.html +0 -5
- package/docs/interfaces/react.VreoActionCallbacks.html +0 -18
- package/docs/interfaces/react.VreoProviderProps.html +0 -6
- package/docs/modules/Player.html +0 -1
- package/docs/modules/custom.html +0 -1
- package/docs/modules/fivePlugins.html +0 -1
- package/docs/modules/react.html +0 -1
- package/docs/modules.html +0 -1
- package/docs/types/Player.AppSize.html +0 -1
- package/docs/types/Player.AudioLikeEvent.html +0 -6
- package/docs/types/Player.CameraMovementData.html +0 -2
- package/docs/types/Player.CustomData.html +0 -2
- package/docs/types/Player.InfoPanelData.html +0 -7
- package/docs/types/Player.ModelVideoData.html +0 -9
- package/docs/types/Player.PanoEffectData.html +0 -4
- package/docs/types/Player.PanoTagData.html +0 -6
- package/docs/types/Player.PanoTextLabelData.html +0 -7
- package/docs/types/Player.PrompterData.html +0 -3
- package/docs/types/Player.QuadrangleVertexs.html +0 -2
- package/docs/types/Player.Quaternion.html +0 -6
- package/docs/types/Player.UpdateVRPanoramaData.html +0 -7
- package/docs/types/Player.Vertexs.html +0 -2
- package/docs/types/Player.VideoEffectData.html +0 -7
- package/docs/types/Player.VreoKeyframeEvent.html +0 -2
- package/docs/types/Player.VreoKeyframeMap.html +0 -6
- package/docs/types/Player.VreoSubscribe.html +0 -1
- package/docs/types/Player.WaveAppearance.html +0 -1
- package/docs/types/fivePlugins.CSS3DRenderPluginParameterType.html +0 -1
- package/docs/types/fivePlugins.MoveArgs.html +0 -1
- package/docs/types/fivePlugins.MoveOpts.html +0 -1
- package/docs/types/fivePlugins.RotateArgs.html +0 -1
- package/docs/types/fivePlugins.RotateOpts.html +0 -1
- package/docs/variables/fivePlugins.CSS3DRenderPlugin.html +0 -3
- package/docs/variables/fivePlugins.CameraMovementPlugin.html +0 -2
- package/docs/variables/fivePlugins.ModelTVVideoPlugin.html +0 -1
- package/docs/variables/react.VreoProvider.html +0 -9
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
|
-
|
|
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(
|
|
32
|
-
var _ref = _asyncToGenerator(
|
|
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
|
|
36
|
-
while (1) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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(
|
|
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
|
-
|
|
126
|
+
_onFiveRenderFrame,
|
|
129
127
|
_args2 = arguments;
|
|
130
|
-
return
|
|
131
|
-
while (1) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
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>;
|