@realsee/vreo 0.1.6 → 0.2.0-alpha.11

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 (99) hide show
  1. package/README.md +103 -16
  2. package/docs/assets/custom.css +4 -4
  3. package/docs/assets/search.js +1 -1
  4. package/docs/classes/Player.Controller.html +54 -0
  5. package/docs/classes/Player.Player-1.html +11 -11
  6. package/docs/classes/Player.VideoAgentMesh.html +142 -0
  7. package/docs/classes/Player.VideoAgentScene.html +1 -0
  8. package/docs/enums/Player.InfoPanelStyleEnum.html +1 -0
  9. package/docs/enums/Player.InfoPanelTypeEnum.html +1 -1
  10. package/docs/enums/Player.PanoEffectEnum.html +2 -2
  11. package/docs/enums/Player.PanoTagEnum.html +1 -1
  12. package/docs/enums/Player.VreoKeyframeEnum.html +14 -12
  13. package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
  14. package/docs/enums/fivePlugins.Rotation.html +1 -1
  15. package/docs/index.html +52 -19
  16. package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -0
  17. package/docs/interfaces/Player.PlayerConfigs.html +4 -2
  18. package/docs/interfaces/Player.Vertex.html +1 -1
  19. package/docs/interfaces/Player.VideoAgentMeshOptions.html +1 -0
  20. package/docs/interfaces/Player.VreoKeyframe.html +1 -1
  21. package/docs/interfaces/Player.VreoUnit.html +1 -1
  22. package/docs/interfaces/Player.VreoVideo.html +1 -1
  23. package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -1
  24. package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +3 -3
  25. package/docs/interfaces/fivePlugins.CameraMovementPluginParameterType.html +1 -1
  26. package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -1
  27. package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -1
  28. package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -1
  29. package/docs/interfaces/react.VreoActionCallbacks.html +15 -7
  30. package/docs/interfaces/react.VreoProviderProps.html +1 -0
  31. package/docs/modules/Player.html +17 -15
  32. package/docs/modules/custom.html +3 -0
  33. package/docs/modules/fivePlugins.html +2 -2
  34. package/docs/modules/react.html +1 -1
  35. package/docs/modules.html +1 -1
  36. package/lib/PlayController/createHTMLAudioElement.d.ts +1 -0
  37. package/lib/PlayController/createHTMLAudioElement.js +47 -0
  38. package/lib/PlayController/index.d.ts +38 -0
  39. package/lib/PlayController/index.js +300 -0
  40. package/lib/Player/App.js +8 -3
  41. package/lib/Player/Controller.d.ts +2 -0
  42. package/lib/Player/Controller.js +14 -0
  43. package/lib/Player/custom/SpatialScenePanel/index.d.ts +22 -0
  44. package/lib/Player/custom/SpatialScenePanel/index.js +279 -0
  45. package/lib/Player/index.d.ts +1 -1
  46. package/lib/Player/index.js +98 -11
  47. package/lib/Player/modules/Drawer/index.js +1 -1
  48. package/lib/Player/modules/PopUp/index.d.ts +2 -0
  49. package/lib/Player/modules/PopUp/index.js +43 -0
  50. package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +1 -0
  51. package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +6 -2
  52. package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +4 -1
  53. package/lib/Player/modules/VideoAgent/VideoAgentScene.js +21 -6
  54. package/lib/Player/modules/VideoAgent/index.d.ts +2 -0
  55. package/lib/Player/modules/VideoAgent/index.js +1 -1
  56. package/lib/Player/modules/keyframes/BgMusic/index.d.ts +2 -0
  57. package/lib/Player/modules/keyframes/BgMusic/index.js +76 -0
  58. package/lib/Player/modules/keyframes/CameraMovement/index.js +41 -5
  59. package/lib/Player/modules/keyframes/InfoPanel/index.js +105 -23
  60. package/lib/Player/modules/keyframes/ModelVideo/index.js +47 -10
  61. package/lib/Player/modules/keyframes/PanoTextLabel/index.js +4 -12
  62. package/lib/Player/modules/keyframes/Prompter/index.js +4 -18
  63. package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +71 -12
  64. package/lib/Player/typings.d.ts +19 -1
  65. package/lib/fivePlugins/CameraMovementPlugin/index.js +104 -90
  66. package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts +1 -0
  67. package/lib/react/index.d.ts +10 -2
  68. package/lib/react/index.js +1 -1
  69. package/lib/shared-utils/createTransMatrix.d.ts +1 -0
  70. package/lib/shared-utils/createTransMatrix.js +43 -0
  71. package/lib/typings/VreoUnit.d.ts +47 -7
  72. package/lib/typings/VreoUnit.js +15 -6
  73. package/package.json +6 -6
  74. package/resources/PlayController/createHTMLAudioElement.ts +53 -0
  75. package/resources/PlayController/index.ts +167 -0
  76. package/resources/Player/App.tsx +6 -1
  77. package/resources/Player/Controller.ts +12 -0
  78. package/resources/Player/custom/SpatialScenePanel/index.tsx +264 -0
  79. package/resources/Player/index.tsx +56 -2
  80. package/resources/Player/modules/Drawer/index.tsx +1 -1
  81. package/resources/Player/modules/PopUp/index.tsx +26 -0
  82. package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +5 -4
  83. package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +11 -2
  84. package/resources/Player/modules/VideoAgent/index.tsx +3 -2
  85. package/resources/Player/modules/keyframes/BgMusic/index.tsx +66 -0
  86. package/resources/Player/modules/keyframes/CameraMovement/index.tsx +7 -3
  87. package/resources/Player/modules/keyframes/InfoPanel/index.tsx +109 -11
  88. package/resources/Player/modules/keyframes/ModelVideo/index.tsx +38 -5
  89. package/resources/Player/modules/keyframes/PanoTextLabel/index.tsx +2 -2
  90. package/resources/Player/modules/keyframes/Prompter/index.tsx +5 -15
  91. package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +75 -12
  92. package/resources/Player/typings.ts +21 -1
  93. package/resources/fivePlugins/CameraMovementPlugin/index.ts +59 -48
  94. package/resources/fivePlugins/CameraMovementPlugin/typings.ts +2 -1
  95. package/resources/react/index.tsx +12 -3
  96. package/resources/shared-utils/createTransMatrix.ts +12 -0
  97. package/resources/typings/VreoUnit.ts +56 -7
  98. package/stylesheets/custom/SpatialScenePanel.css +309 -0
  99. package/stylesheets/default.css +127 -9
@@ -54,112 +54,125 @@ function progressNumber(from, to, pst) {
54
54
 
55
55
 
56
56
  var CameraMovementPlugin = function CameraMovementPlugin(five) {
57
- var move = /*#__PURE__*/function () {
58
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(args, duration) {
59
- var opts,
60
- _args = arguments;
61
- return regeneratorRuntime.wrap(function _callee$(_context) {
62
- while (1) {
63
- switch (_context.prev = _context.next) {
64
- case 0:
65
- opts = _args.length > 2 && _args[2] !== undefined ? _args[2] : {
66
- preload: true
67
- };
57
+ var move = function move(args, duration) {
58
+ var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
59
+ preload: true
60
+ };
61
+ return new Promise( /*#__PURE__*/function () {
62
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resolve, reject) {
63
+ var panoIndex, movePanoOptions;
64
+ return regeneratorRuntime.wrap(function _callee$(_context) {
65
+ while (1) {
66
+ switch (_context.prev = _context.next) {
67
+ case 0:
68
+ if (opts.asyncStartCallback) {
69
+ opts.asyncStartCallback();
70
+ }
68
71
 
69
- if (opts.asyncStartCallback) {
70
- opts.asyncStartCallback();
71
- }
72
+ if (!(five.panoIndex === undefined)) {
73
+ _context.next = 3;
74
+ break;
75
+ }
72
76
 
73
- if (!(args.mode && args.mode !== five.currentMode)) {
74
- _context.next = 5;
75
- break;
76
- }
77
+ return _context.abrupt("return", reject(false));
77
78
 
78
- _context.next = 5;
79
- return new Promise(function (resolve) {
80
- if (!args.mode) return;
81
- five.once('modeChange', function (mode) {
82
- five.once('initAnimationEnded', function () {
83
- if (mode === args.mode) {
84
- resolve(true);
85
- }
79
+ case 3:
80
+ if (!(args.mode && args.mode !== five.currentMode)) {
81
+ _context.next = 6;
82
+ break;
83
+ }
84
+
85
+ _context.next = 6;
86
+ return new Promise(function (resolve) {
87
+ if (!args.mode) return;
88
+ five.once('modeChange', function (mode) {
89
+ five.once('initAnimationEnded', function () {
90
+ if (mode === args.mode) {
91
+ resolve(true);
92
+ }
93
+ });
94
+ });
95
+ five.changeMode(args.mode, {
96
+ fov: args.fov || undefined,
97
+ latitude: args.latitude || undefined,
98
+ longitude: args.longitude || undefined,
99
+ panoIndex: args.panoIndex || undefined
86
100
  });
87
101
  });
88
- five.changeMode(args.mode, {
89
- fov: args.fov || undefined,
90
- latitude: args.latitude || undefined,
91
- longitude: args.longitude || undefined,
92
- panoIndex: args.panoIndex || undefined
93
- });
94
- });
95
102
 
96
- case 5:
97
- if (!(args.mode === _five.Five.Mode.Floorplan)) {
98
- _context.next = 7;
99
- break;
100
- }
103
+ case 6:
104
+ if (!(args.mode === _five.Five.Mode.Floorplan)) {
105
+ _context.next = 8;
106
+ break;
107
+ }
101
108
 
102
- return _context.abrupt("return", true);
109
+ return _context.abrupt("return", resolve(true));
103
110
 
104
- case 7:
105
- if (!(opts.preload && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex)) {
106
- _context.next = 10;
107
- break;
108
- }
111
+ case 8:
112
+ if (!(opts.preload && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex)) {
113
+ _context.next = 11;
114
+ break;
115
+ }
109
116
 
110
- _context.next = 10;
111
- return five.preloadPano(args.panoIndex);
117
+ _context.next = 11;
118
+ return five.preloadPano(args.panoIndex);
112
119
 
113
- case 10:
114
- if (opts.asyncEndCallback) {
115
- opts.asyncEndCallback();
116
- }
120
+ case 11:
121
+ if (opts.asyncEndCallback) {
122
+ opts.asyncEndCallback();
123
+ }
117
124
 
118
- if (!(args.panoIndex === undefined && args.fov === undefined && args.latitude === undefined && args.longitude === undefined)) {
119
- _context.next = 13;
120
- break;
121
- }
125
+ if (!(args.panoIndex === undefined && args.fov === undefined && args.latitude === undefined && args.longitude === undefined)) {
126
+ _context.next = 14;
127
+ break;
128
+ }
122
129
 
123
- return _context.abrupt("return", true);
130
+ return _context.abrupt("return", resolve(true));
124
131
 
125
- case 13:
126
- _context.next = 15;
127
- return new Promise(function (resolve, reject) {
128
- var panoIndex = args.panoIndex !== undefined ? args.panoIndex : five.panoIndex;
129
-
130
- if (panoIndex !== undefined) {
131
- five.moveToPano(panoIndex, Object.assign({
132
- duration: duration,
133
- // 移动耗时
134
- moveEndCallback: function moveEndCallback() {
135
- return resolve(true);
136
- },
137
- // 移动结束
138
- moveCancelCallback: function moveCancelCallback() {
139
- return reject(false);
140
- } // 移动开始
141
-
142
- }, args));
143
- } else {
144
- reject(false);
132
+ case 14:
133
+ panoIndex = args.panoIndex !== undefined ? args.panoIndex : five.panoIndex;
134
+
135
+ if (!(panoIndex !== undefined)) {
136
+ _context.next = 21;
137
+ break;
145
138
  }
146
- });
147
139
 
148
- case 15:
149
- return _context.abrupt("return", _context.sent);
140
+ movePanoOptions = Object.assign(args, {
141
+ duration: duration,
142
+ // 移动耗时
143
+ moveEndCallback: function moveEndCallback() {
144
+ return resolve(true);
145
+ },
146
+ // 移动结束
147
+ moveCancelCallback: function moveCancelCallback() {
148
+ resolve(true);
149
+ } // 移动开始
150
+ // effect: args.transEffect || 'fade',
150
151
 
151
- case 16:
152
- case "end":
153
- return _context.stop();
152
+ });
153
+ _context.next = 19;
154
+ return five.moveToPano(panoIndex, movePanoOptions);
155
+
156
+ case 19:
157
+ _context.next = 22;
158
+ break;
159
+
160
+ case 21:
161
+ reject(false);
162
+
163
+ case 22:
164
+ case "end":
165
+ return _context.stop();
166
+ }
154
167
  }
155
- }
156
- }, _callee);
157
- }));
168
+ }, _callee);
169
+ }));
158
170
 
159
- return function move(_x, _x2) {
160
- return _ref.apply(this, arguments);
161
- };
162
- }();
171
+ return function (_x, _x2) {
172
+ return _ref.apply(this, arguments);
173
+ };
174
+ }());
175
+ };
163
176
 
164
177
  var getAnimeParams = function getAnimeParams(args) {
165
178
  var currentFiveState = five.state; // latitude
@@ -239,8 +252,9 @@ var CameraMovementPlugin = function CameraMovementPlugin(five) {
239
252
  // 移动结束
240
253
  moveCancelCallback: function moveCancelCallback() {
241
254
  return reject(false);
242
- } // 移动开始
243
-
255
+ },
256
+ // 移动开始
257
+ effect: 'fade'
244
258
  });
245
259
  });
246
260
 
@@ -33,6 +33,7 @@ export interface CameraMovementOptsCallback {
33
33
  export declare type MoveArgs = {
34
34
  mode: Mode;
35
35
  panoIndex: number;
36
+ transEffect?: "fly" | "fade" | "instant";
36
37
  } & Pose;
37
38
  export declare type MoveOpts = {
38
39
  preload?: boolean;
@@ -1,14 +1,22 @@
1
1
  import * as React from 'react';
2
+ import { PlayerConfigs } from '../Player/typings';
2
3
  import { VreoKeyframeEvent, VreoUnit } from '../typings/VreoUnit';
3
- export declare const VreoProvider: React.FC;
4
+ export interface VreoProviderProps {
5
+ configs?: Partial<PlayerConfigs>;
6
+ }
7
+ export declare const VreoProvider: React.FC<VreoProviderProps>;
4
8
  /**
5
9
  * VreoPlayer 命令集合。
6
10
  */
7
11
  export interface VreoActionCallbacks {
8
12
  /**
9
13
  * 载入剧本数据。
14
+ * @param vreoUnit 剧本数据
15
+ * @param currentTime 开始时间戳
16
+ * @param preload 是否开启预载
17
+ * @param force 是否强制载入
10
18
  */
11
- load: (vreoUnit: VreoUnit, currentTime?: number) => Promise<boolean>;
19
+ load: (vreoUnit: VreoUnit, currentTime?: number, preload?: boolean, force?: boolean) => Promise<boolean>;
12
20
  /**
13
21
  * 播放。
14
22
  */
@@ -44,7 +44,7 @@ var VreoProvider = function VreoProvider(props) {
44
44
 
45
45
  var playerRef = React.useRef(null);
46
46
  React.useEffect(function () {
47
- playerRef.current = new _Player.Player(five);
47
+ playerRef.current = new _Player.Player(five, props.configs || {});
48
48
  setPlayer(playerRef.current);
49
49
  return function () {
50
50
  var _playerRef$current;
@@ -0,0 +1 @@
1
+ export declare function createTransMatrix(arr1: number[]): (arr2: number[]) => number[];
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createTransMatrix = createTransMatrix;
9
+
10
+ var THREE = _interopRequireWildcard(require("three"));
11
+
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+
16
+ function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
17
+
18
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
19
+
20
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
21
+
22
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
23
+
24
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
25
+
26
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
27
+
28
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
29
+
30
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
31
+
32
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
33
+
34
+ function createTransMatrix(arr1) {
35
+ var matrix4 = new THREE.Matrix4();
36
+ matrix4.fromArray(arr1);
37
+ return function (arr2) {
38
+ var vector3 = _construct(THREE.Vector3, _toConsumableArray(arr2));
39
+
40
+ vector3.applyMatrix4(matrix4);
41
+ return vector3.toArray();
42
+ };
43
+ }
@@ -1,4 +1,4 @@
1
- import { Mode, Pose, WorkCubeImage } from '@realsee/five';
1
+ import { Mode, Pose } from '@realsee/five';
2
2
  import { CameraMovementEffect, Rotation } from '../fivePlugins/CameraMovementPlugin/typings';
3
3
  export declare enum VreoKeyframeEnum {
4
4
  /** 运镜 */
@@ -35,6 +35,10 @@ export declare enum VreoKeyframeEnum {
35
35
  * 视频特效
36
36
  */
37
37
  VideoEffect = "VideoEffect",
38
+ /**
39
+ * 背景音乐
40
+ */
41
+ BgMusic = "BgMusic",
38
42
  /**
39
43
  * 结束
40
44
  */
@@ -57,6 +61,7 @@ export declare type VreoKeyframeConfigMap = {
57
61
  * 剧本关键帧
58
62
  */
59
63
  export interface VreoKeyframe {
64
+ uuid?: string;
60
65
  type: VreoKeyframeEnum;
61
66
  start: number;
62
67
  end: number;
@@ -89,14 +94,17 @@ export interface VreoUnit {
89
94
  export declare type VreoKeyframeEvent = {
90
95
  [key in VreoKeyframeEnum]: (keyframe: VreoKeyframe) => void;
91
96
  } & {
92
- paused: () => void;
97
+ loaded: (vreoUnit: VreoUnit) => void;
98
+ paused: (ended?: boolean) => void;
93
99
  playing: () => void;
100
+ unknownKeyframeType: (keyframe: Record<string, any>) => void;
94
101
  };
95
102
  /**
96
103
  * 相机运动
97
104
  */
98
105
  export declare type CameraMovementData = {
99
- effect: CameraMovementEffect;
106
+ effect?: CameraMovementEffect;
107
+ transEffect?: "fly" | "fade" | "instant";
100
108
  mode: Mode;
101
109
  panoIndex: number;
102
110
  loop?: boolean;
@@ -113,8 +121,22 @@ export declare type PrompterData = {
113
121
  * VR 全景切换
114
122
  */
115
123
  export declare type UpdateVRPanoramaData = {
116
- panoIndex: number;
117
- images: WorkCubeImage;
124
+ _signature: string;
125
+ allow_hosts: string[];
126
+ certificate: string;
127
+ expire_at: string;
128
+ dynamic_scene?: {
129
+ images: {
130
+ index: number;
131
+ right: string;
132
+ left: string;
133
+ up: string;
134
+ down: string;
135
+ front: string;
136
+ back: string;
137
+ };
138
+ };
139
+ [key: string]: any;
118
140
  };
119
141
  /**
120
142
  * 顶点
@@ -125,9 +147,13 @@ export interface Vertex {
125
147
  z: number;
126
148
  }
127
149
  /**
128
- * 四个顶点元组
150
+ * 矩形顶点
129
151
  */
130
152
  export declare type QuadrangleVertexs = [Vertex, Vertex, Vertex, Vertex];
153
+ /**
154
+ * 顶点数组
155
+ */
156
+ export declare type Vertexs = Vertex[];
131
157
  /**
132
158
  * 视频广告
133
159
  */
@@ -143,7 +169,8 @@ export declare type ModelVideoData = {
143
169
  /**
144
170
  * 视频映射在模型中的顶点
145
171
  */
146
- vertexs: QuadrangleVertexs;
172
+ vertexs: QuadrangleVertexs | Vertexs;
173
+ matrixWorld?: number[];
147
174
  };
148
175
  /**
149
176
  * 全景文本标签
@@ -189,12 +216,19 @@ export declare enum InfoPanelTypeEnum {
189
216
  Image = "Image",
190
217
  Video = "Video"
191
218
  }
219
+ export declare enum InfoPanelStyleEnum {
220
+ Drawer = "Drawer",
221
+ PopUp = "PopUp"
222
+ }
192
223
  /**
193
224
  * 信息面板
194
225
  */
195
226
  export declare type InfoPanelData = {
196
227
  type: InfoPanelTypeEnum;
228
+ style?: InfoPanelStyleEnum;
197
229
  url: string;
230
+ title?: string;
231
+ subTitle?: string;
198
232
  };
199
233
  /**
200
234
  * 视频特效
@@ -206,5 +240,11 @@ export declare type VideoEffectData = {
206
240
  direction?: Vertex;
207
241
  vector?: Pick<Pose, 'longitude' | 'latitude'>;
208
242
  };
243
+ /**
244
+ * 背景音乐
245
+ */
246
+ export declare type BgMusicData = {
247
+ url: string;
248
+ };
209
249
  /** 自定义序列帧 */
210
250
  export declare type CustomData = Record<string, any>;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.VreoKeyframeEnum = exports.PanoTagEnum = exports.PanoEffectEnum = exports.InfoPanelTypeEnum = void 0;
6
+ exports.VreoKeyframeEnum = exports.PanoTagEnum = exports.PanoEffectEnum = exports.InfoPanelTypeEnum = exports.InfoPanelStyleEnum = void 0;
7
7
  var VreoKeyframeEnum;
8
8
  /**
9
9
  * 支持自定义剧本关键帧配置项
@@ -21,6 +21,7 @@ exports.VreoKeyframeEnum = VreoKeyframeEnum;
21
21
  VreoKeyframeEnum["PanoEffect"] = "PanoEffect";
22
22
  VreoKeyframeEnum["InfoPanel"] = "InfoPanel";
23
23
  VreoKeyframeEnum["VideoEffect"] = "VideoEffect";
24
+ VreoKeyframeEnum["BgMusic"] = "BgMusic";
24
25
  VreoKeyframeEnum["Exit"] = "Exit";
25
26
  VreoKeyframeEnum["Custom"] = "Custom";
26
27
  })(VreoKeyframeEnum || (exports.VreoKeyframeEnum = VreoKeyframeEnum = {}));
@@ -54,13 +55,21 @@ exports.PanoEffectEnum = PanoEffectEnum;
54
55
  * 信息面板类型枚举
55
56
  */
56
57
  var InfoPanelTypeEnum;
57
- /**
58
- * 信息面板
59
- */
60
-
61
58
  exports.InfoPanelTypeEnum = InfoPanelTypeEnum;
62
59
 
63
60
  (function (InfoPanelTypeEnum) {
64
61
  InfoPanelTypeEnum["Image"] = "Image";
65
62
  InfoPanelTypeEnum["Video"] = "Video";
66
- })(InfoPanelTypeEnum || (exports.InfoPanelTypeEnum = InfoPanelTypeEnum = {}));
63
+ })(InfoPanelTypeEnum || (exports.InfoPanelTypeEnum = InfoPanelTypeEnum = {}));
64
+
65
+ var InfoPanelStyleEnum;
66
+ /**
67
+ * 信息面板
68
+ */
69
+
70
+ exports.InfoPanelStyleEnum = InfoPanelStyleEnum;
71
+
72
+ (function (InfoPanelStyleEnum) {
73
+ InfoPanelStyleEnum["Drawer"] = "Drawer";
74
+ InfoPanelStyleEnum["PopUp"] = "PopUp";
75
+ })(InfoPanelStyleEnum || (exports.InfoPanelStyleEnum = InfoPanelStyleEnum = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/vreo",
3
- "version": "0.1.6",
3
+ "version": "0.2.0-alpha.11",
4
4
  "description": "Vreo (VR Video 缩写) 是基于如视三维渲染引擎 Five 和 用户界面构建库 React 实现的如视 3D 空间剧本播放器。",
5
5
  "keywords": [
6
6
  "realsee",
@@ -18,14 +18,14 @@
18
18
  "LICENSE"
19
19
  ],
20
20
  "scripts": {
21
- "dev": "vite --port=3088",
21
+ "dev": "vite --port=3088 --host 0.0.0.0",
22
22
  "build": "tsc && vite build",
23
23
  "preview": "vite preview",
24
24
  "docs": "npx typedoc",
25
25
  "packages": "node ./dev-tools/build-packages.js"
26
26
  },
27
27
  "peerDependencies": {
28
- "@realsee/five": "^5.0.0-alpha.53",
28
+ "@realsee/five": "^5.0.0-alpha.103",
29
29
  "react": "^16.0.0",
30
30
  "react-dom": "^16.0.0"
31
31
  },
@@ -35,7 +35,8 @@
35
35
  "@babel/preset-env": "^7.16.4",
36
36
  "@babel/preset-react": "^7.16.0",
37
37
  "@babel/preset-typescript": "^7.16.0",
38
- "@realsee/five": "^5.0.0-alpha.80",
38
+ "@realsee/dnalogel": "^0.1.7-alpha.10",
39
+ "@realsee/five": "^5.0.0-alpha.103",
39
40
  "@types/offscreencanvas": "^2019.6.4",
40
41
  "@types/react": "^17.0.37",
41
42
  "@types/react-dom": "^17.0.11",
@@ -53,7 +54,6 @@
53
54
  "@tweenjs/tween.js": "18.6.4",
54
55
  "classnames": "^2.3.1",
55
56
  "mobx": "^6.3.7",
56
- "mobx-react": "^7.2.1",
57
- "react-transition-group": "^4.4.2"
57
+ "mobx-react": "^7.2.1"
58
58
  }
59
59
  }
@@ -0,0 +1,53 @@
1
+
2
+ const BLANK_AUDIO = ''
3
+ + 'data:audio/mpeg;base64,'
4
+ + '//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVV'
5
+ + 'VVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////'
6
+ + '////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAg'
7
+ + 'AAABobxtI73AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
8
+ + 'AAAAAAAAAAAAAA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VVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=';
34
+
35
+
36
+ export function createHTMLAudioElement(): HTMLAudioElement {
37
+ const ndAudio = document.querySelector('#vreo-playController-audio')
38
+ if (ndAudio) {
39
+ return ndAudio as HTMLAudioElement
40
+ }
41
+
42
+ const audio = document.createElement('audio')
43
+ audio.style.display = 'none'
44
+ audio.setAttribute('id', 'vreo-playController-audio')
45
+ audio.controls = false
46
+ document.body.appendChild(audio)
47
+ audio.src = BLANK_AUDIO
48
+
49
+ // 触发一次播放
50
+ Promise.resolve(async () => await audio.play())
51
+
52
+ return audio
53
+ }