@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.
- package/README.md +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Player.AudioLike.html +2 -2
- package/docs/classes/Player.Controller.html +52 -4
- package/docs/classes/Player.Player.html +43 -2
- package/docs/classes/Player.VideoAgentMesh.html +61 -4
- package/docs/classes/Player.VideoAgentScene.html +2 -2
- package/docs/demo/assets/{examples-5qw3pq5z.js → examples-DfiAz2fR.js} +1 -1
- package/docs/demo/assets/react-BnzBLum3.css +1 -0
- package/docs/demo/examples.html +1 -1
- package/docs/demo/index-react.html +2 -2
- package/docs/demo/index.html +1 -1
- package/docs/enums/Player.InfoPanelStyleEnum.html +2 -2
- package/docs/enums/Player.InfoPanelTypeEnum.html +2 -2
- package/docs/enums/Player.PanoEffectEnum.html +2 -2
- package/docs/enums/Player.PanoTagEnum.html +2 -2
- package/docs/enums/Player.PanoTagStyleEnum.html +3 -3
- package/docs/enums/Player.VreoKeyframeEnum.html +13 -13
- package/docs/enums/fivePlugins.CameraMovementEffect.html +2 -2
- package/docs/enums/fivePlugins.Rotation.html +2 -2
- package/docs/functions/custom.SpatialScenePanel.html +1 -1
- package/docs/functions/react.useVreoAction.html +8 -1
- package/docs/functions/react.useVreoEventCallback.html +10 -1
- package/docs/functions/react.useVreoPausedState.html +8 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/Player.Appearance.html +2 -0
- package/docs/interfaces/Player.CustomVreoKeyframeProps.html +2 -2
- package/docs/interfaces/Player.PlayerConfigs.html +6 -6
- package/docs/interfaces/Player.Vertex.html +2 -2
- package/docs/interfaces/Player.VideoAgentMeshOptions.html +5 -4
- package/docs/interfaces/Player.VreoKeyframe.html +2 -2
- package/docs/interfaces/Player.VreoUnit.html +2 -2
- package/docs/interfaces/Player.VreoVideo.html +2 -2
- package/docs/interfaces/fivePlugins.CSS3DRenderPluginExportType.html +7 -5
- package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +2 -2
- package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +3 -3
- package/docs/interfaces/fivePlugins.CameraMovementPluginParameterType.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +2 -2
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +2 -2
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +2 -2
- package/docs/interfaces/fivePlugins.Vector3Position.html +2 -2
- package/docs/interfaces/react.VreoActionCallbacks.html +7 -7
- package/docs/interfaces/react.VreoProviderProps.html +5 -2
- package/docs/modules/Player.html +1 -1
- package/docs/modules/fivePlugins.html +1 -1
- package/docs/types/Player.AppSize.html +1 -0
- package/docs/types/Player.AudioLikeEvent.html +2 -2
- package/docs/types/Player.CameraMovementData.html +1 -1
- package/docs/types/Player.CustomData.html +1 -1
- package/docs/types/Player.InfoPanelData.html +2 -2
- package/docs/types/Player.ModelVideoData.html +5 -5
- package/docs/types/Player.PanoEffectData.html +2 -2
- package/docs/types/Player.PanoTagData.html +2 -2
- package/docs/types/Player.PanoTextLabelData.html +2 -2
- package/docs/types/Player.PrompterData.html +2 -2
- package/docs/types/Player.QuadrangleVertexs.html +1 -1
- package/docs/types/Player.Quaternion.html +2 -2
- package/docs/types/Player.UpdateVRPanoramaData.html +2 -2
- package/docs/types/Player.Vertexs.html +1 -1
- package/docs/types/Player.VideoEffectData.html +2 -2
- package/docs/types/Player.VreoKeyframeEvent.html +1 -1
- package/docs/types/Player.VreoKeyframeMap.html +2 -2
- package/docs/types/Player.VreoSubscribe.html +1 -1
- package/docs/types/Player.WaveAppearance.html +1 -0
- package/docs/types/fivePlugins.CSS3DRenderPluginParameterType.html +1 -0
- package/docs/types/fivePlugins.MoveArgs.html +1 -1
- package/docs/types/fivePlugins.MoveOpts.html +1 -1
- package/docs/types/fivePlugins.RotateArgs.html +1 -1
- package/docs/types/fivePlugins.RotateOpts.html +1 -1
- package/docs/variables/fivePlugins.CSS3DRenderPlugin.html +2 -2
- package/docs/variables/fivePlugins.CameraMovementPlugin.html +1 -1
- package/docs/variables/fivePlugins.ModelTVVideoPlugin.html +1 -1
- package/docs/variables/react.VreoProvider.html +9 -1
- package/lib/PlayController/createHTMLAudioElement.js +5 -12
- package/lib/PlayController/index.js +27 -34
- package/lib/Player/App.js +25 -34
- package/lib/Player/Controller.d.ts +106 -2
- package/lib/Player/Controller.js +190 -78
- package/lib/Player/custom/SpatialScenePanel/index.js +20 -31
- package/lib/Player/hooks.js +6 -15
- package/lib/Player/index.d.ts +103 -0
- package/lib/Player/index.js +153 -45
- package/lib/Player/modules/Drawer/index.js +8 -17
- package/lib/Player/modules/PopUp/index.js +8 -17
- package/lib/Player/modules/ResizeObserver/index.js +10 -17
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +108 -7
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +157 -52
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +16 -25
- package/lib/Player/modules/VideoAgent/index.js +8 -17
- package/lib/Player/modules/Wave/index.js +24 -33
- package/lib/Player/modules/keyframes/BgMusic/index.js +13 -22
- package/lib/Player/modules/keyframes/CameraMovement/index.js +17 -26
- package/lib/Player/modules/keyframes/InfoPanel/index.js +13 -21
- package/lib/Player/modules/keyframes/ModelVideo/index.js +17 -26
- package/lib/Player/modules/keyframes/PanoEffect/index.js +21 -30
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +6 -14
- package/lib/Player/modules/keyframes/PanoTag/index.js +10 -18
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +19 -28
- package/lib/Player/modules/keyframes/Prompter/index.js +13 -22
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +16 -24
- package/lib/Player/modules/keyframes/VideoEffect/index.js +18 -28
- package/lib/Player/typings.js +1 -5
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +3 -9
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +1 -7
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +1 -7
- package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +6 -12
- package/lib/fivePlugins/CSS3DRenderPlugin/index.js +27 -37
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +3 -9
- package/lib/fivePlugins/CameraMovementPlugin/index.js +15 -22
- package/lib/fivePlugins/CameraMovementPlugin/typings.js +6 -10
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +9 -18
- package/lib/index.js +1 -12
- package/lib/react/index.d.ts +111 -0
- package/lib/react/index.js +148 -24
- package/lib/shared-utils/Audio.js +27 -37
- package/lib/shared-utils/AudioLike.js +22 -29
- package/lib/shared-utils/Preloader.js +1 -7
- package/lib/shared-utils/addResizeListener.js +4 -11
- package/lib/shared-utils/animationFrame/BetterTween.js +23 -33
- package/lib/shared-utils/animationFrame/index.js +4 -13
- package/lib/shared-utils/animationFrame/tween.js +9 -17
- package/lib/shared-utils/createTransMatrix.js +5 -14
- package/lib/shared-utils/getFileExpandedName.js +1 -7
- package/lib/shared-utils/getMediaInfo.js +8 -19
- package/lib/shared-utils/setElementDataset.js +1 -7
- package/lib/typings/VreoUnit.js +15 -17
- package/package.json +58 -5
- package/stylesheets/custom/SpatialScenePanel.css +7 -7
- package/stylesheets/default.css +1 -1
- package/docs/demo/assets/react-dPVEotm3.css +0 -1
- /package/docs/demo/assets/{react-BLZb_LNZ.js → react-C4h9qndP.js} +0 -0
|
@@ -1,47 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
var _five = require("@realsee/five");
|
|
16
|
-
var _animationFrame = require("./animationFrame");
|
|
17
|
-
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 _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
+
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); }; }
|
|
18
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
|
+
import { Subscribe } from '@realsee/five';
|
|
11
|
+
import { requestAnimationFrameInterval } from "./animationFrame/index.js";
|
|
19
12
|
/**
|
|
20
13
|
* 模拟 `<Audio>` 事件。
|
|
21
14
|
*/
|
|
22
15
|
/**
|
|
23
16
|
* 模拟 `<Audio>` 功能:没有音频,但执行逻辑跟 `<Audio>` 相似。
|
|
24
17
|
*/
|
|
25
|
-
var AudioLike =
|
|
26
|
-
(
|
|
18
|
+
export var AudioLike = /*#__PURE__*/function (_Subscribe) {
|
|
19
|
+
_inherits(AudioLike, _Subscribe);
|
|
27
20
|
var _super = _createSuper(AudioLike);
|
|
28
21
|
function AudioLike() {
|
|
29
22
|
var _this;
|
|
30
23
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
31
24
|
duration = _ref.duration;
|
|
32
|
-
(
|
|
25
|
+
_classCallCheck(this, AudioLike);
|
|
33
26
|
_this = _super.call(this);
|
|
34
|
-
(
|
|
35
|
-
(
|
|
36
|
-
(
|
|
37
|
-
(
|
|
38
|
-
(
|
|
27
|
+
_defineProperty(_assertThisInitialized(_this), "$timestamp", null);
|
|
28
|
+
_defineProperty(_assertThisInitialized(_this), "$currentTime", 0);
|
|
29
|
+
_defineProperty(_assertThisInitialized(_this), "$duration", 0);
|
|
30
|
+
_defineProperty(_assertThisInitialized(_this), "muted", false);
|
|
31
|
+
_defineProperty(_assertThisInitialized(_this), "src", '');
|
|
39
32
|
if (duration) {
|
|
40
33
|
_this.$duration = duration;
|
|
41
34
|
}
|
|
42
35
|
return _this;
|
|
43
36
|
}
|
|
44
|
-
(
|
|
37
|
+
_createClass(AudioLike, [{
|
|
45
38
|
key: "setAttribute",
|
|
46
39
|
value: function setAttribute(name, value) {
|
|
47
40
|
// nothing todo
|
|
@@ -56,7 +49,7 @@ var AudioLike = exports.AudioLike = /*#__PURE__*/function (_Subscribe) {
|
|
|
56
49
|
if (this.$timestamp === null) {
|
|
57
50
|
this.$timestamp = performance.now();
|
|
58
51
|
}
|
|
59
|
-
this.stopInterval =
|
|
52
|
+
this.stopInterval = requestAnimationFrameInterval(function () {
|
|
60
53
|
return _this2.requestAnimationFrameLoop();
|
|
61
54
|
});
|
|
62
55
|
this.emit('play');
|
|
@@ -125,5 +118,5 @@ var AudioLike = exports.AudioLike = /*#__PURE__*/function (_Subscribe) {
|
|
|
125
118
|
}
|
|
126
119
|
}]);
|
|
127
120
|
return AudioLike;
|
|
128
|
-
}(
|
|
129
|
-
|
|
121
|
+
}(Subscribe);
|
|
122
|
+
export default AudioLike;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Preloader = void 0;
|
|
7
1
|
/**
|
|
8
2
|
* 预载器
|
|
9
3
|
*/
|
|
10
|
-
var Preloader =
|
|
4
|
+
export var Preloader = {
|
|
11
5
|
blob: function blob(url) {
|
|
12
6
|
var noop = function noop() {
|
|
13
7
|
return null;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.addResizeListener = addResizeListener;
|
|
7
|
-
exports.hasResizeListener = hasResizeListener;
|
|
8
1
|
var resizeObserverCache = new Map();
|
|
9
|
-
function addResizeListener(element, resizeHandler) {
|
|
2
|
+
export function addResizeListener(element, resizeHandler) {
|
|
10
3
|
var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
11
4
|
if (!element) return function () {};
|
|
12
5
|
if (immediate) resizeHandler(element.clientWidth, element.clientHeight);
|
|
@@ -19,7 +12,7 @@ function addResizeListener(element, resizeHandler) {
|
|
|
19
12
|
return function () {
|
|
20
13
|
if (element) resizeObserver.unobserve(element);
|
|
21
14
|
if (resizeObserverCache.get(element) === 1) {
|
|
22
|
-
resizeObserverCache
|
|
15
|
+
resizeObserverCache.delete(element);
|
|
23
16
|
}
|
|
24
17
|
};
|
|
25
18
|
} else {
|
|
@@ -35,12 +28,12 @@ function addResizeListener(element, resizeHandler) {
|
|
|
35
28
|
return function () {
|
|
36
29
|
element.removeChild(iframe);
|
|
37
30
|
if (resizeObserverCache.get(element) === 1) {
|
|
38
|
-
resizeObserverCache
|
|
31
|
+
resizeObserverCache.delete(element);
|
|
39
32
|
}
|
|
40
33
|
};
|
|
41
34
|
}
|
|
42
35
|
}
|
|
43
|
-
function hasResizeListener(element) {
|
|
36
|
+
export function hasResizeListener(element) {
|
|
44
37
|
if (!element) return false;
|
|
45
38
|
return resizeObserverCache.get(element) || 0 > 0;
|
|
46
39
|
}
|
|
@@ -1,47 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.tweenProgress = tweenProgress;
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
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 TWEEN = _interopRequireWildcard(require("@tweenjs/tween.js"));
|
|
18
|
-
var _ = require(".");
|
|
19
|
-
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); }
|
|
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 _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
+
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
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
import * as TWEEN from '@tweenjs/tween.js';
|
|
11
|
+
import { requestAnimationFrameInterval } from "./index.js";
|
|
12
|
+
export var BetterTween = /*#__PURE__*/function (_TWEEN$Tween) {
|
|
13
|
+
_inherits(BetterTween, _TWEEN$Tween);
|
|
24
14
|
var _super = _createSuper(BetterTween);
|
|
25
15
|
function BetterTween() {
|
|
26
16
|
var _this;
|
|
27
|
-
(
|
|
17
|
+
_classCallCheck(this, BetterTween);
|
|
28
18
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
29
19
|
args[_key] = arguments[_key];
|
|
30
20
|
}
|
|
31
21
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
32
|
-
(
|
|
33
|
-
(
|
|
22
|
+
_defineProperty(_assertThisInitialized(_this), "disposeMethods", []);
|
|
23
|
+
_defineProperty(_assertThisInitialized(_this), "onDispose", function (callback) {
|
|
34
24
|
_this.disposeMethods.push(callback);
|
|
35
|
-
return (
|
|
25
|
+
return _assertThisInitialized(_this);
|
|
36
26
|
});
|
|
37
|
-
(
|
|
27
|
+
_defineProperty(_assertThisInitialized(_this), "play", function () {
|
|
38
28
|
_this.start();
|
|
39
|
-
_this.animationFrameDisposer =
|
|
29
|
+
_this.animationFrameDisposer = requestAnimationFrameInterval(function () {
|
|
40
30
|
return _this.update();
|
|
41
31
|
});
|
|
42
|
-
return (
|
|
32
|
+
return _assertThisInitialized(_this);
|
|
43
33
|
});
|
|
44
|
-
(
|
|
34
|
+
_defineProperty(_assertThisInitialized(_this), "dispose", function () {
|
|
45
35
|
var _this$animationFrameD, _this2;
|
|
46
36
|
_this.stop();
|
|
47
37
|
(_this$animationFrameD = (_this2 = _this).animationFrameDisposer) === null || _this$animationFrameD === void 0 ? void 0 : _this$animationFrameD.call(_this2);
|
|
@@ -49,13 +39,13 @@ var BetterTween = exports.BetterTween = /*#__PURE__*/function (_TWEEN$Tween) {
|
|
|
49
39
|
return fn();
|
|
50
40
|
});
|
|
51
41
|
_this.disposeMethods = [];
|
|
52
|
-
TWEEN.remove((
|
|
42
|
+
TWEEN.remove(_assertThisInitialized(_this));
|
|
53
43
|
});
|
|
54
44
|
return _this;
|
|
55
45
|
}
|
|
56
|
-
return (
|
|
46
|
+
return _createClass(BetterTween);
|
|
57
47
|
}(TWEEN.Tween);
|
|
58
|
-
function tweenProgress(duration) {
|
|
48
|
+
export function tweenProgress(duration) {
|
|
59
49
|
var easing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TWEEN.Easing.Linear.None;
|
|
60
50
|
var tween = new BetterTween({
|
|
61
51
|
progress: 0
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
exports.getFrameTime = getFrameTime;
|
|
8
|
-
exports.nextFrame = nextFrame;
|
|
9
|
-
exports.requestAnimationFrameInterval = requestAnimationFrameInterval;
|
|
10
1
|
var _requestAnimationFrame = window.requestAnimationFrame || function (fn) {
|
|
11
2
|
return setTimeout(function () {
|
|
12
3
|
return fn(performance.now());
|
|
13
4
|
}, 16);
|
|
14
5
|
};
|
|
15
6
|
var _cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;
|
|
16
|
-
|
|
17
|
-
function nextFrame(fn) {
|
|
7
|
+
export default _requestAnimationFrame;
|
|
8
|
+
export function nextFrame(fn) {
|
|
18
9
|
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
19
10
|
if (delay <= 0) _requestAnimationFrame(fn);else _requestAnimationFrame(function () {
|
|
20
11
|
return nextFrame(fn, delay - 1);
|
|
@@ -27,7 +18,7 @@ function nextFrame(fn) {
|
|
|
27
18
|
* @param frame 每秒运行多少次
|
|
28
19
|
* @returns 返回一个函数,调用可以停止 AnimationFrameLoop
|
|
29
20
|
*/
|
|
30
|
-
function requestAnimationFrameInterval(callback) {
|
|
21
|
+
export function requestAnimationFrameInterval(callback) {
|
|
31
22
|
var frame = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
|
|
32
23
|
var index = -1;
|
|
33
24
|
var oldTime = 0;
|
|
@@ -51,7 +42,7 @@ function requestAnimationFrameInterval(callback) {
|
|
|
51
42
|
* 获取两个 AnimationFrame 间隔的时间
|
|
52
43
|
* @returns 返回一个 Promise,resolve 的结果是两个 AnimationFrame 间隔的时间
|
|
53
44
|
*/
|
|
54
|
-
function getFrameTime() {
|
|
45
|
+
export function getFrameTime() {
|
|
55
46
|
var start = Date.now();
|
|
56
47
|
return new Promise(function (resolve) {
|
|
57
48
|
_requestAnimationFrame(function () {
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.clear = void 0;
|
|
7
|
-
exports["default"] = tween;
|
|
8
|
-
exports.tweenProgress = tweenProgress;
|
|
9
|
-
var _tween = require("@tweenjs/tween.js");
|
|
10
|
-
var _index = require("./index");
|
|
1
|
+
import { Tween, Easing } from '@tweenjs/tween.js';
|
|
2
|
+
import { nextFrame, requestAnimationFrameInterval } from "./index.js";
|
|
11
3
|
var disposeMethods = [];
|
|
12
|
-
var clear =
|
|
4
|
+
export var clear = function clear() {
|
|
13
5
|
disposeMethods.forEach(function (dispose) {
|
|
14
6
|
return dispose();
|
|
15
7
|
});
|
|
@@ -26,14 +18,14 @@ var clear = exports.clear = function clear() {
|
|
|
26
18
|
* @param duration 经历时间(s)
|
|
27
19
|
* @param easing 过程动画,默认是 Easing.Linear.None
|
|
28
20
|
*/
|
|
29
|
-
function tween(from, to, duration) {
|
|
30
|
-
var easing = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] :
|
|
31
|
-
var tween = new
|
|
21
|
+
export default function tween(from, to, duration) {
|
|
22
|
+
var easing = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Easing.Linear.None;
|
|
23
|
+
var tween = new Tween(from).to(to, duration).easing(easing);
|
|
32
24
|
// 这里注意一下,因为 requestAnimationFrameInterval 给的时间是从 0 开始的,tween 动画也从 0 开始
|
|
33
|
-
|
|
25
|
+
nextFrame(function () {
|
|
34
26
|
return tween.start(0);
|
|
35
27
|
});
|
|
36
|
-
var cancelAnimationFrame =
|
|
28
|
+
var cancelAnimationFrame = requestAnimationFrameInterval(function (time) {
|
|
37
29
|
if (tween.update(time) === false) cancelAnimationFrame();
|
|
38
30
|
});
|
|
39
31
|
var destroyMethods = [];
|
|
@@ -57,7 +49,7 @@ function tween(from, to, duration) {
|
|
|
57
49
|
};
|
|
58
50
|
return tween;
|
|
59
51
|
}
|
|
60
|
-
function tweenProgress(duration, easing) {
|
|
52
|
+
export function tweenProgress(duration, easing) {
|
|
61
53
|
return tween({
|
|
62
54
|
progress: 0
|
|
63
55
|
}, {
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.createTransMatrix = createTransMatrix;
|
|
9
|
-
var _construct2 = _interopRequireDefault(require("@babel/runtime/helpers/construct"));
|
|
10
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
12
|
-
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); }
|
|
13
|
-
function createTransMatrix(arr1) {
|
|
1
|
+
import _construct from "@babel/runtime/helpers/esm/construct";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
export function createTransMatrix(arr1) {
|
|
14
5
|
var matrix4 = new THREE.Matrix4();
|
|
15
6
|
matrix4.fromArray(arr1);
|
|
16
7
|
return function (arr2) {
|
|
17
|
-
var vector3 = (
|
|
8
|
+
var vector3 = _construct(THREE.Vector3, _toConsumableArray(arr2));
|
|
18
9
|
vector3.applyMatrix4(matrix4);
|
|
19
10
|
return vector3.toArray();
|
|
20
11
|
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = getFileExpandedName;
|
|
7
|
-
function getFileExpandedName(filePath) {
|
|
1
|
+
export default function getFileExpandedName(filePath) {
|
|
8
2
|
if (!filePath) return '';
|
|
9
3
|
var index = filePath.lastIndexOf('.');
|
|
10
4
|
var ext = filePath.substring(index + 1);
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = getMediaInfo;
|
|
8
|
-
exports.getFileName = getFileName;
|
|
9
|
-
exports.getMediaType = getMediaType;
|
|
10
|
-
exports.getMediaTypeByExpandedName = getMediaTypeByExpandedName;
|
|
11
|
-
exports.getMediaTypeByUrl = getMediaTypeByUrl;
|
|
12
|
-
var _getFileExpandedName = _interopRequireDefault(require("./getFileExpandedName"));
|
|
13
|
-
function getMediaInfo(fileUrl) {
|
|
1
|
+
import getFileExpandedName from "./getFileExpandedName.js";
|
|
2
|
+
export default function getMediaInfo(fileUrl) {
|
|
14
3
|
var type = getMediaType(fileUrl);
|
|
15
4
|
if (!type) return Promise.resolve({
|
|
16
5
|
error: '未知的文件类型: ' + fileUrl
|
|
@@ -37,24 +26,24 @@ function getMediaInfo(fileUrl) {
|
|
|
37
26
|
};
|
|
38
27
|
});
|
|
39
28
|
}
|
|
40
|
-
function getMediaType(url) {
|
|
41
|
-
var fileExpandedName = (
|
|
29
|
+
export function getMediaType(url) {
|
|
30
|
+
var fileExpandedName = getFileExpandedName(url);
|
|
42
31
|
var type = getMediaTypeByExpandedName(fileExpandedName);
|
|
43
32
|
return type;
|
|
44
33
|
}
|
|
45
|
-
function getMediaTypeByExpandedName(fileExpandedName) {
|
|
34
|
+
export function getMediaTypeByExpandedName(fileExpandedName) {
|
|
46
35
|
if (!fileExpandedName) return 'unknown';
|
|
47
36
|
if (/jpg|jpeg|png$/.test(fileExpandedName)) return 'image';
|
|
48
37
|
if (/mp3|wav$/.test(fileExpandedName)) return 'audio';
|
|
49
38
|
if (/avi|wmv|mpeg|mp4|m4v|mov|asf|flv|f4v|rmvb|rm|3gp|vob$/.test(fileExpandedName)) return 'video';
|
|
50
39
|
return 'unknown';
|
|
51
40
|
}
|
|
52
|
-
function getMediaTypeByUrl(fileUrl) {
|
|
41
|
+
export function getMediaTypeByUrl(fileUrl) {
|
|
53
42
|
if (!fileUrl) return;
|
|
54
|
-
var fileExpandedName = (
|
|
43
|
+
var fileExpandedName = getFileExpandedName(fileUrl);
|
|
55
44
|
return getMediaTypeByExpandedName(fileExpandedName);
|
|
56
45
|
}
|
|
57
|
-
function getFileName(fileUrl) {
|
|
46
|
+
export function getFileName(fileUrl) {
|
|
58
47
|
if (!fileUrl) return '';
|
|
59
48
|
var index1 = fileUrl.lastIndexOf('/');
|
|
60
49
|
var index2 = fileUrl.lastIndexOf('\\');
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = setElementDataset;
|
|
7
|
-
function setElementDataset(element, dataset) {
|
|
1
|
+
export default function setElementDataset(element, dataset) {
|
|
8
2
|
if (element) {
|
|
9
3
|
Object.keys(dataset).forEach(function (key) {
|
|
10
4
|
var value = dataset[key].toString();
|
package/lib/typings/VreoUnit.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export var VreoKeyframeEnum;
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.VreoKeyframeEnum = exports.PanoTagStyleEnum = exports.PanoTagEnum = exports.PanoEffectEnum = exports.InfoPanelTypeEnum = exports.InfoPanelStyleEnum = void 0;
|
|
7
|
-
var VreoKeyframeEnum;
|
|
8
3
|
/**
|
|
9
4
|
* 支持自定义剧本关键帧配置项
|
|
10
5
|
*/
|
|
@@ -21,7 +16,7 @@ var VreoKeyframeEnum;
|
|
|
21
16
|
VreoKeyframeEnum["BgMusic"] = "BgMusic";
|
|
22
17
|
VreoKeyframeEnum["Exit"] = "Exit";
|
|
23
18
|
VreoKeyframeEnum["Custom"] = "Custom";
|
|
24
|
-
})(VreoKeyframeEnum || (
|
|
19
|
+
})(VreoKeyframeEnum || (VreoKeyframeEnum = {}));
|
|
25
20
|
/**
|
|
26
21
|
* 剧本关键帧
|
|
27
22
|
*/
|
|
@@ -64,45 +59,48 @@ var VreoKeyframeEnum;
|
|
|
64
59
|
/**
|
|
65
60
|
* 全景标签枚举
|
|
66
61
|
*/
|
|
67
|
-
var PanoTagEnum;
|
|
62
|
+
export var PanoTagEnum;
|
|
63
|
+
|
|
68
64
|
/**
|
|
69
65
|
* 标签样式种类
|
|
70
66
|
*/
|
|
71
67
|
(function (PanoTagEnum) {
|
|
72
68
|
PanoTagEnum["Text"] = "Text";
|
|
73
69
|
PanoTagEnum["Image"] = "Image";
|
|
74
|
-
})(PanoTagEnum || (
|
|
75
|
-
var PanoTagStyleEnum;
|
|
70
|
+
})(PanoTagEnum || (PanoTagEnum = {}));
|
|
71
|
+
export var PanoTagStyleEnum;
|
|
76
72
|
(function (PanoTagStyleEnum) {
|
|
77
73
|
PanoTagStyleEnum["Growth"] = "Growth";
|
|
78
74
|
PanoTagStyleEnum["Expand"] = "Expand";
|
|
79
|
-
})(PanoTagStyleEnum || (
|
|
75
|
+
})(PanoTagStyleEnum || (PanoTagStyleEnum = {}));
|
|
80
76
|
/**
|
|
81
77
|
* 全景特效枚举
|
|
82
78
|
*/
|
|
83
|
-
var PanoEffectEnum;
|
|
79
|
+
export var PanoEffectEnum;
|
|
80
|
+
|
|
84
81
|
/**
|
|
85
82
|
* 全景特效
|
|
86
83
|
*/
|
|
87
84
|
(function (PanoEffectEnum) {
|
|
88
85
|
PanoEffectEnum["Distance"] = "Distance";
|
|
89
|
-
})(PanoEffectEnum || (
|
|
86
|
+
})(PanoEffectEnum || (PanoEffectEnum = {}));
|
|
90
87
|
/**
|
|
91
88
|
* 信息面板类型枚举
|
|
92
89
|
*/
|
|
93
|
-
var InfoPanelTypeEnum;
|
|
90
|
+
export var InfoPanelTypeEnum;
|
|
94
91
|
(function (InfoPanelTypeEnum) {
|
|
95
92
|
InfoPanelTypeEnum["Image"] = "Image";
|
|
96
93
|
InfoPanelTypeEnum["Video"] = "Video";
|
|
97
|
-
})(InfoPanelTypeEnum || (
|
|
98
|
-
var InfoPanelStyleEnum;
|
|
94
|
+
})(InfoPanelTypeEnum || (InfoPanelTypeEnum = {}));
|
|
95
|
+
export var InfoPanelStyleEnum;
|
|
96
|
+
|
|
99
97
|
/**
|
|
100
98
|
* 信息面板
|
|
101
99
|
*/
|
|
102
100
|
(function (InfoPanelStyleEnum) {
|
|
103
101
|
InfoPanelStyleEnum["Drawer"] = "Drawer";
|
|
104
102
|
InfoPanelStyleEnum["PopUp"] = "PopUp";
|
|
105
|
-
})(InfoPanelStyleEnum || (
|
|
103
|
+
})(InfoPanelStyleEnum || (InfoPanelStyleEnum = {}));
|
|
106
104
|
/**
|
|
107
105
|
* 视频特效
|
|
108
106
|
*/
|
package/package.json
CHANGED
|
@@ -1,12 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realsee/vreo",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0-alpha.2",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "Vreo (VR Video 缩写) 是基于如视三维渲染引擎 Five 和 用户界面构建库 React 实现的如视 3D 空间剧本播放器。",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"realsee",
|
|
7
8
|
"vreo"
|
|
8
9
|
],
|
|
9
|
-
"
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./lib/index.d.ts",
|
|
13
|
+
"import": "./lib/index.js",
|
|
14
|
+
"default": "./lib/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./PlayController": {
|
|
17
|
+
"types": "./lib/PlayController/index.d.ts",
|
|
18
|
+
"import": "./lib/PlayController/index.js",
|
|
19
|
+
"default": "./lib/PlayController/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./Player": {
|
|
22
|
+
"types": "./lib/Player/index.d.ts",
|
|
23
|
+
"import": "./lib/Player/index.js",
|
|
24
|
+
"default": "./lib/Player/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./react": {
|
|
27
|
+
"types": "./lib/react/index.d.ts",
|
|
28
|
+
"import": "./lib/react/index.js",
|
|
29
|
+
"default": "./lib/react/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./plugins/CameraMovementPlugin": {
|
|
32
|
+
"types": "./lib/fivePlugins/CameraMovementPlugin/index.d.ts",
|
|
33
|
+
"import": "./lib/fivePlugins/CameraMovementPlugin/index.js",
|
|
34
|
+
"default": "./lib/fivePlugins/CameraMovementPlugin/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./plugins/CSS3DRenderPlugin": {
|
|
37
|
+
"types": "./lib/fivePlugins/CSS3DRenderPlugin/index.d.ts",
|
|
38
|
+
"import": "./lib/fivePlugins/CSS3DRenderPlugin/index.js",
|
|
39
|
+
"default": "./lib/fivePlugins/CSS3DRenderPlugin/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./plugins/ModelTVVideoPlugin": {
|
|
42
|
+
"types": "./lib/fivePlugins/ModelTVVideoPlugin/index.d.ts",
|
|
43
|
+
"import": "./lib/fivePlugins/ModelTVVideoPlugin/index.js",
|
|
44
|
+
"default": "./lib/fivePlugins/ModelTVVideoPlugin/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./utils/animationFrame": {
|
|
47
|
+
"types": "./lib/shared-utils/animationFrame/index.d.ts",
|
|
48
|
+
"import": "./lib/shared-utils/animationFrame/index.js",
|
|
49
|
+
"default": "./lib/shared-utils/animationFrame/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./typings": {
|
|
52
|
+
"types": "./lib/typings/index.d.ts",
|
|
53
|
+
"import": "./lib/typings/index.js",
|
|
54
|
+
"default": "./lib/typings/index.js"
|
|
55
|
+
},
|
|
56
|
+
"./stylesheets/default.css": "./stylesheets/default.css",
|
|
57
|
+
"./stylesheets/custom/SpatialScenePanel.css": "./stylesheets/custom/SpatialScenePanel.css",
|
|
58
|
+
"./stylesheets/*": "./stylesheets/*",
|
|
59
|
+
"./lib/*": "./lib/*",
|
|
60
|
+
"./package.json": "./package.json"
|
|
61
|
+
},
|
|
10
62
|
"author": "BEIKE REALSEE TECHNOLOGY (HK) LIMITED",
|
|
11
63
|
"license": "MIT",
|
|
12
64
|
"private": false,
|
|
@@ -28,17 +80,17 @@
|
|
|
28
80
|
"peerDependencies": {
|
|
29
81
|
"@realsee/dnalogel": "3.67.0",
|
|
30
82
|
"@realsee/five": "^6.4.0-alpha.1",
|
|
31
|
-
"three": "0.117.1",
|
|
32
83
|
"react": "^18.0.0",
|
|
33
|
-
"react-dom": "^18.0.0"
|
|
84
|
+
"react-dom": "^18.0.0",
|
|
85
|
+
"three": "0.117.1"
|
|
34
86
|
},
|
|
35
87
|
"devDependencies": {
|
|
36
88
|
"@babel/cli": "^7.16.0",
|
|
37
89
|
"@babel/core": "^7.16.0",
|
|
90
|
+
"@babel/plugin-transform-runtime": "7.24.3",
|
|
38
91
|
"@babel/preset-env": "^7.16.4",
|
|
39
92
|
"@babel/preset-react": "^7.16.0",
|
|
40
93
|
"@babel/preset-typescript": "^7.16.0",
|
|
41
|
-
"@babel/plugin-transform-runtime": "7.24.3",
|
|
42
94
|
"@realsee/dnalogel": "^3.67.2",
|
|
43
95
|
"@realsee/five": "^6.4.0-alpha.38",
|
|
44
96
|
"@tweenjs/tween.js": "18.6.4",
|
|
@@ -48,6 +100,7 @@
|
|
|
48
100
|
"@types/react-dom": "^18.3.7",
|
|
49
101
|
"@types/react-transition-group": "^4.4.4",
|
|
50
102
|
"@vitejs/plugin-react": "^4.3.3",
|
|
103
|
+
"babel-plugin-add-import-extension": "^1.6.0",
|
|
51
104
|
"cnpm": "^9.2.0",
|
|
52
105
|
"del": "^6.0.0",
|
|
53
106
|
"react": "^18.3.1",
|