@realsee/vreo 2.5.0 → 2.6.0

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 (49) hide show
  1. package/lib/PlayController/createHTMLAudioElement.js +5 -12
  2. package/lib/PlayController/index.js +27 -34
  3. package/lib/Player/App.js +25 -34
  4. package/lib/Player/Controller.js +66 -74
  5. package/lib/Player/custom/SpatialScenePanel/index.js +20 -31
  6. package/lib/Player/hooks.js +6 -15
  7. package/lib/Player/index.js +36 -44
  8. package/lib/Player/modules/Drawer/index.js +8 -17
  9. package/lib/Player/modules/PopUp/index.js +8 -17
  10. package/lib/Player/modules/ResizeObserver/index.js +10 -17
  11. package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +33 -41
  12. package/lib/Player/modules/VideoAgent/VideoAgentScene.js +16 -25
  13. package/lib/Player/modules/VideoAgent/index.js +8 -17
  14. package/lib/Player/modules/Wave/index.js +24 -33
  15. package/lib/Player/modules/keyframes/BgMusic/index.js +13 -22
  16. package/lib/Player/modules/keyframes/CameraMovement/index.js +17 -26
  17. package/lib/Player/modules/keyframes/InfoPanel/index.js +13 -21
  18. package/lib/Player/modules/keyframes/ModelVideo/index.js +17 -26
  19. package/lib/Player/modules/keyframes/PanoEffect/index.js +21 -30
  20. package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +6 -14
  21. package/lib/Player/modules/keyframes/PanoTag/index.js +10 -18
  22. package/lib/Player/modules/keyframes/PanoTextLabel/index.js +19 -28
  23. package/lib/Player/modules/keyframes/Prompter/index.js +13 -22
  24. package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +16 -24
  25. package/lib/Player/modules/keyframes/VideoEffect/index.js +17 -27
  26. package/lib/Player/typings.js +1 -5
  27. package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +3 -9
  28. package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +1 -7
  29. package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +1 -7
  30. package/lib/fivePlugins/CSS3DRenderPlugin/index.js +27 -37
  31. package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +3 -9
  32. package/lib/fivePlugins/CameraMovementPlugin/index.js +15 -22
  33. package/lib/fivePlugins/CameraMovementPlugin/typings.js +6 -10
  34. package/lib/fivePlugins/ModelTVVideoPlugin/index.js +9 -18
  35. package/lib/index.js +1 -12
  36. package/lib/react/index.js +12 -24
  37. package/lib/shared-utils/Audio.js +27 -37
  38. package/lib/shared-utils/AudioLike.js +22 -29
  39. package/lib/shared-utils/Preloader.js +1 -7
  40. package/lib/shared-utils/addResizeListener.js +4 -11
  41. package/lib/shared-utils/animationFrame/BetterTween.js +23 -33
  42. package/lib/shared-utils/animationFrame/index.js +4 -13
  43. package/lib/shared-utils/animationFrame/tween.js +9 -17
  44. package/lib/shared-utils/createTransMatrix.js +5 -14
  45. package/lib/shared-utils/getFileExpandedName.js +1 -7
  46. package/lib/shared-utils/getMediaInfo.js +8 -19
  47. package/lib/shared-utils/setElementDataset.js +1 -7
  48. package/lib/typings/VreoUnit.js +15 -17
  49. package/package.json +58 -5
@@ -1,20 +1,11 @@
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.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 = (0, _construct2["default"])(THREE.Vector3, (0, _toConsumableArray2["default"])(arr2));
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
- "use strict";
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
- "use strict";
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 = (0, _getFileExpandedName["default"])(url);
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 = (0, _getFileExpandedName["default"])(fileUrl);
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
- "use strict";
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();
@@ -1,10 +1,5 @@
1
- "use strict";
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 || (exports.VreoKeyframeEnum = 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 || (exports.PanoTagEnum = 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 || (exports.PanoTagStyleEnum = 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 || (exports.PanoEffectEnum = 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 || (exports.InfoPanelTypeEnum = 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 || (exports.InfoPanelStyleEnum = 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.5.0",
3
+ "version": "2.6.0",
4
+ "type": "module",
4
5
  "description": "Vreo (VR Video 缩写) 是基于如视三维渲染引擎 Five 和 用户界面构建库 React 实现的如视 3D 空间剧本播放器。",
5
6
  "keywords": [
6
7
  "realsee",
7
8
  "vreo"
8
9
  ],
9
- "main": "lib/index.js",
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",