@realsee/vreo 0.2.0-alpha.9 → 1.0.0-alpha.10
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/CHANGELOG.md +30 -0
- package/README.md +16 -5
- package/docs/assets/highlight.css +1 -1
- package/docs/assets/main.js +2 -2
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +28 -2
- package/docs/classes/Player.AudioLike.html +52 -0
- package/docs/classes/Player.Controller.html +13 -13
- package/docs/classes/Player.Player-1.html +11 -11
- package/docs/classes/Player.VideoAgentMesh.html +53 -53
- package/docs/classes/Player.VideoAgentScene.html +1 -1
- package/docs/demo/assets/AppReact.ea8cbdb3.js +1 -0
- package/docs/demo/assets/default.1dd2b2d4.js +3988 -0
- package/docs/demo/assets/default.bc4c715d.css +1 -0
- package/docs/demo/assets/dynamic.cd7d1da6.js +1 -0
- package/docs/demo/assets/examples.98aaf9e2.js +25 -0
- package/docs/demo/assets/examples.dac4a6fe.css +1 -0
- package/docs/demo/assets/index.9331038f.css +1 -0
- package/docs/demo/assets/index.a3d7bd8a.js +1 -0
- package/docs/demo/assets/main.f0c47cae.js +1 -0
- package/docs/demo/assets/react.2ee8565f.css +1 -0
- package/docs/demo/assets/react.5f3bcfc5.js +25 -0
- package/docs/demo/assets/znRoyv06SZQeqA7m.0057e8ae.js +1 -0
- package/docs/demo/examples.html +17 -0
- package/docs/demo/index-react-dynamic.html +20 -0
- package/docs/demo/index-react.html +20 -0
- package/docs/demo/index.html +19 -0
- package/docs/enums/Player.InfoPanelStyleEnum.html +1 -1
- 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 +7 -0
- package/docs/enums/Player.VreoKeyframeEnum.html +12 -12
- package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
- package/docs/enums/fivePlugins.Rotation.html +1 -1
- package/docs/index.html +13 -6
- package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -1
- package/docs/interfaces/Player.PlayerConfigs.html +4 -3
- package/docs/interfaces/Player.Vertex.html +2 -2
- package/docs/interfaces/Player.VideoAgentMeshOptions.html +8 -1
- 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 +4 -0
- package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -1
- package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/fivePlugins.CameraMovementPluginParameterType.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/fivePlugins.Vector3Position.html +3 -0
- package/docs/interfaces/react.VreoActionCallbacks.html +15 -7
- package/docs/interfaces/react.VreoProviderProps.html +1 -1
- package/docs/modules/Player.html +21 -15
- package/docs/modules/custom.html +1 -1
- package/docs/modules/fivePlugins.html +5 -2
- package/docs/modules/react.html +1 -1
- package/docs/modules.html +1 -1
- package/lib/PlayController/createHTMLAudioElement.js +6 -11
- package/lib/PlayController/index.js +19 -85
- package/lib/Player/App.js +7 -29
- package/lib/Player/Controller.d.ts +29 -8
- package/lib/Player/Controller.js +185 -87
- package/lib/Player/custom/SpatialScenePanel/index.js +47 -72
- package/lib/Player/hooks.js +2 -12
- package/lib/Player/index.d.ts +5 -3
- package/lib/Player/index.js +108 -122
- package/lib/Player/modules/Drawer/index.js +1 -18
- package/lib/Player/modules/PopUp/index.js +1 -11
- package/lib/Player/modules/ResizeObserver/index.d.ts +2 -0
- package/lib/Player/modules/ResizeObserver/index.js +29 -0
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +16 -2
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +124 -145
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +3 -6
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +25 -52
- package/lib/Player/modules/VideoAgent/index.js +46 -22
- package/lib/Player/modules/Wave/index.d.ts +5 -0
- package/lib/Player/modules/Wave/index.js +77 -0
- package/lib/Player/modules/keyframes/BgMusic/index.js +3 -16
- package/lib/Player/modules/keyframes/CameraMovement/index.js +4 -28
- package/lib/Player/modules/keyframes/InfoPanel/index.js +30 -35
- package/lib/Player/modules/keyframes/ModelVideo/index.js +40 -29
- package/lib/Player/modules/keyframes/PanoEffect/index.js +16 -44
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +1 -8
- package/lib/Player/modules/keyframes/PanoTag/index.d.ts +1 -2
- package/lib/Player/modules/keyframes/PanoTag/index.js +75 -132
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +3 -0
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +93 -66
- package/lib/Player/modules/keyframes/Prompter/index.js +18 -53
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +22 -25
- package/lib/Player/modules/keyframes/VideoEffect/index.js +13 -48
- package/lib/Player/typings.d.ts +12 -1
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts +2 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +10 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts +7 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +31 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts +3 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +10 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +56 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.js +234 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts +7 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +15 -0
- package/lib/fivePlugins/CameraMovementPlugin/index.js +36 -82
- package/lib/fivePlugins/CameraMovementPlugin/typings.js +0 -4
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +12 -61
- package/lib/index.js +0 -1
- package/lib/react/index.d.ts +8 -4
- package/lib/react/index.js +10 -37
- package/lib/shared-utils/AduioLike.d.ts +37 -0
- package/lib/shared-utils/AduioLike.js +132 -0
- package/lib/shared-utils/Preloader.js +0 -7
- package/lib/shared-utils/addResizeListener.d.ts +4 -0
- package/lib/shared-utils/addResizeListener.js +46 -0
- package/lib/shared-utils/animationFrame/BetterTween.js +7 -39
- package/lib/shared-utils/animationFrame/index.js +2 -10
- package/lib/shared-utils/animationFrame/tween.js +3 -16
- package/lib/shared-utils/createTransMatrix.d.ts +1 -0
- package/lib/shared-utils/createTransMatrix.js +28 -0
- package/lib/shared-utils/getFileExpandedName.d.ts +1 -0
- package/lib/shared-utils/getFileExpandedName.js +12 -0
- package/lib/shared-utils/getMediaInfo.d.ts +9 -0
- package/lib/shared-utils/getMediaInfo.js +66 -0
- package/lib/shared-utils/setElementDataset.d.ts +1 -0
- package/lib/shared-utils/setElementDataset.js +22 -0
- package/lib/typings/VreoUnit.d.ts +37 -2
- package/lib/typings/VreoUnit.js +10 -13
- package/package.json +10 -10
- package/resources/PlayController/index.ts +0 -13
- package/resources/Player/App.tsx +5 -4
- package/resources/Player/Controller.ts +274 -146
- package/resources/Player/custom/SpatialScenePanel/index.tsx +5 -5
- package/resources/Player/hooks.ts +3 -5
- package/resources/Player/index.tsx +190 -140
- package/resources/Player/modules/ResizeObserver/index.tsx +23 -0
- package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +87 -31
- package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +27 -24
- package/resources/Player/modules/VideoAgent/index.tsx +28 -12
- package/resources/Player/modules/Wave/index.tsx +64 -0
- package/resources/Player/modules/keyframes/InfoPanel/index.tsx +26 -11
- package/resources/Player/modules/keyframes/ModelVideo/index.tsx +36 -3
- package/resources/Player/modules/keyframes/PanoTag/index.tsx +52 -97
- package/resources/Player/modules/keyframes/PanoTextLabel/index.tsx +86 -34
- package/resources/Player/modules/keyframes/Prompter/index.tsx +6 -16
- package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +6 -2
- package/resources/Player/typings.ts +15 -1
- package/resources/fivePlugins/CSS3DRenderPlugin/centerPoint.ts +5 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/createResizeObserver.ts +17 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/evenNumber.ts +4 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/index.ts +254 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.ts +5 -0
- package/resources/fivePlugins/CameraMovementPlugin/index.ts +19 -12
- package/resources/react/index.tsx +7 -3
- package/resources/shared-utils/AduioLike.ts +109 -0
- package/resources/shared-utils/addResizeListener.ts +46 -0
- package/resources/shared-utils/createTransMatrix.ts +12 -0
- package/resources/shared-utils/getFileExpandedName.ts +6 -0
- package/resources/shared-utils/getMediaInfo.ts +52 -0
- package/resources/shared-utils/setElementDataset.ts +18 -0
- package/resources/typings/VreoUnit.ts +41 -3
- package/stylesheets/custom/SpatialScenePanel.css +2 -1
- package/stylesheets/default.css +350 -84
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createTransMatrix(arr1: number[]): (arr2: number[]) => number[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createTransMatrix = createTransMatrix;
|
|
8
|
+
var THREE = _interopRequireWildcard(require("three"));
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } 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); }
|
|
12
|
+
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; } }
|
|
13
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
15
|
+
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."); }
|
|
16
|
+
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); }
|
|
17
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
18
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
19
|
+
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; }
|
|
20
|
+
function createTransMatrix(arr1) {
|
|
21
|
+
var matrix4 = new THREE.Matrix4();
|
|
22
|
+
matrix4.fromArray(arr1);
|
|
23
|
+
return function (arr2) {
|
|
24
|
+
var vector3 = _construct(THREE.Vector3, _toConsumableArray(arr2));
|
|
25
|
+
vector3.applyMatrix4(matrix4);
|
|
26
|
+
return vector3.toArray();
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getFileExpandedName(filePath?: string | null): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = getFileExpandedName;
|
|
7
|
+
function getFileExpandedName(filePath) {
|
|
8
|
+
if (!filePath) return '';
|
|
9
|
+
var index = filePath.lastIndexOf('.');
|
|
10
|
+
var ext = filePath.substring(index + 1);
|
|
11
|
+
return ext.toLowerCase();
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default function getMediaInfo(fileUrl: string): Promise<{
|
|
2
|
+
duration?: number | undefined;
|
|
3
|
+
type?: 'video' | 'audio' | 'image' | 'unknown' | undefined;
|
|
4
|
+
error?: string | undefined;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function getMediaType(url?: string): "audio" | "video" | "image" | "unknown";
|
|
7
|
+
export declare function getMediaTypeByExpandedName(fileExpandedName?: string | null): "audio" | "video" | "image" | "unknown";
|
|
8
|
+
export declare function getMediaTypeByUrl(fileUrl?: string | null): "audio" | "video" | "image" | "unknown" | undefined;
|
|
9
|
+
export declare function getFileName(fileUrl?: string): string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = getMediaInfo;
|
|
7
|
+
exports.getFileName = getFileName;
|
|
8
|
+
exports.getMediaType = getMediaType;
|
|
9
|
+
exports.getMediaTypeByExpandedName = getMediaTypeByExpandedName;
|
|
10
|
+
exports.getMediaTypeByUrl = getMediaTypeByUrl;
|
|
11
|
+
var _getFileExpandedName = _interopRequireDefault(require("./getFileExpandedName"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
function getMediaInfo(fileUrl) {
|
|
14
|
+
var type = getMediaType(fileUrl);
|
|
15
|
+
if (!type) return Promise.resolve({
|
|
16
|
+
error: '未知的文件类型: ' + fileUrl
|
|
17
|
+
});
|
|
18
|
+
var mediaElement = function () {
|
|
19
|
+
if (type === 'video') return document.createElement('video');
|
|
20
|
+
if (type === 'audio') return document.createElement('audio');
|
|
21
|
+
}();
|
|
22
|
+
if (!mediaElement) return Promise.resolve({
|
|
23
|
+
error: 'Unknown media element'
|
|
24
|
+
});
|
|
25
|
+
mediaElement.src = fileUrl;
|
|
26
|
+
return new Promise(function (resolve) {
|
|
27
|
+
mediaElement.onerror = function () {
|
|
28
|
+
return resolve({
|
|
29
|
+
error: 'onerror'
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
mediaElement.onloadedmetadata = function () {
|
|
33
|
+
resolve({
|
|
34
|
+
duration: mediaElement.duration * 1000,
|
|
35
|
+
type: type
|
|
36
|
+
}); // s => ms
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getMediaType(url) {
|
|
42
|
+
var fileExpandedName = (0, _getFileExpandedName["default"])(url);
|
|
43
|
+
var type = getMediaTypeByExpandedName(fileExpandedName);
|
|
44
|
+
return type;
|
|
45
|
+
}
|
|
46
|
+
function getMediaTypeByExpandedName(fileExpandedName) {
|
|
47
|
+
if (!fileExpandedName) return 'unknown';
|
|
48
|
+
if (/jpg|jpeg|png$/.test(fileExpandedName)) return 'image';
|
|
49
|
+
if (/mp3|wav$/.test(fileExpandedName)) return 'audio';
|
|
50
|
+
if (/avi|wmv|mpeg|mp4|m4v|mov|asf|flv|f4v|rmvb|rm|3gp|vob$/.test(fileExpandedName)) return 'video';
|
|
51
|
+
return 'unknown';
|
|
52
|
+
}
|
|
53
|
+
function getMediaTypeByUrl(fileUrl) {
|
|
54
|
+
if (!fileUrl) return;
|
|
55
|
+
var fileExpandedName = (0, _getFileExpandedName["default"])(fileUrl);
|
|
56
|
+
return getMediaTypeByExpandedName(fileExpandedName);
|
|
57
|
+
}
|
|
58
|
+
function getFileName(fileUrl) {
|
|
59
|
+
if (!fileUrl) return '';
|
|
60
|
+
var index1 = fileUrl.lastIndexOf('/');
|
|
61
|
+
var index2 = fileUrl.lastIndexOf('\\');
|
|
62
|
+
var index3 = fileUrl.lastIndexOf('\\\\');
|
|
63
|
+
var index = Math.max(index1, index2, index3);
|
|
64
|
+
var ext = fileUrl.substring(index + 1);
|
|
65
|
+
return ext;
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function setElementDataset(element: any, dataset: Record<string, string | number>): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = setElementDataset;
|
|
7
|
+
function setElementDataset(element, dataset) {
|
|
8
|
+
if (element) {
|
|
9
|
+
Object.keys(dataset).forEach(function (key) {
|
|
10
|
+
var value = dataset[key].toString();
|
|
11
|
+
if (element instanceof Element) {
|
|
12
|
+
element.setAttribute("data-".concat(key), value);
|
|
13
|
+
} else if (element instanceof Document) {
|
|
14
|
+
element.documentElement.setAttribute("data-".concat(key), value);
|
|
15
|
+
} else if (element instanceof HTMLElement) {
|
|
16
|
+
element.dataset[key] = value;
|
|
17
|
+
} else {
|
|
18
|
+
element.setAttribute("data-".concat(key), value);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -76,6 +76,10 @@ export interface VreoVideo {
|
|
|
76
76
|
start: number;
|
|
77
77
|
end: number;
|
|
78
78
|
url: string;
|
|
79
|
+
avatar?: {
|
|
80
|
+
url?: string;
|
|
81
|
+
force?: true;
|
|
82
|
+
};
|
|
79
83
|
}
|
|
80
84
|
/**
|
|
81
85
|
* 剧本结构
|
|
@@ -98,6 +102,7 @@ export declare type VreoKeyframeEvent = {
|
|
|
98
102
|
paused: (ended?: boolean) => void;
|
|
99
103
|
playing: () => void;
|
|
100
104
|
unknownKeyframeType: (keyframe: Record<string, any>) => void;
|
|
105
|
+
ended: () => void;
|
|
101
106
|
};
|
|
102
107
|
/**
|
|
103
108
|
* 相机运动
|
|
@@ -147,9 +152,13 @@ export interface Vertex {
|
|
|
147
152
|
z: number;
|
|
148
153
|
}
|
|
149
154
|
/**
|
|
150
|
-
*
|
|
155
|
+
* 矩形顶点
|
|
151
156
|
*/
|
|
152
157
|
export declare type QuadrangleVertexs = [Vertex, Vertex, Vertex, Vertex];
|
|
158
|
+
/**
|
|
159
|
+
* 顶点数组
|
|
160
|
+
*/
|
|
161
|
+
export declare type Vertexs = Vertex[];
|
|
153
162
|
/**
|
|
154
163
|
* 视频广告
|
|
155
164
|
*/
|
|
@@ -165,7 +174,17 @@ export declare type ModelVideoData = {
|
|
|
165
174
|
/**
|
|
166
175
|
* 视频映射在模型中的顶点
|
|
167
176
|
*/
|
|
168
|
-
vertexs: QuadrangleVertexs;
|
|
177
|
+
vertexs: QuadrangleVertexs | Vertexs;
|
|
178
|
+
matrixWorld?: number[];
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* 四元数
|
|
182
|
+
*/
|
|
183
|
+
export declare type Quaternion = {
|
|
184
|
+
x: number;
|
|
185
|
+
y: number;
|
|
186
|
+
z: number;
|
|
187
|
+
w: number;
|
|
169
188
|
};
|
|
170
189
|
/**
|
|
171
190
|
* 全景文本标签
|
|
@@ -173,6 +192,8 @@ export declare type ModelVideoData = {
|
|
|
173
192
|
export declare type PanoTextLabelData = {
|
|
174
193
|
text: string;
|
|
175
194
|
vertex: Vertex;
|
|
195
|
+
normal?: Vertex;
|
|
196
|
+
quaternion?: Quaternion;
|
|
176
197
|
fontSize?: number;
|
|
177
198
|
};
|
|
178
199
|
/**
|
|
@@ -182,8 +203,22 @@ export declare enum PanoTagEnum {
|
|
|
182
203
|
Text = "Text",
|
|
183
204
|
Image = "Image"
|
|
184
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* 标签样式种类
|
|
208
|
+
*/
|
|
209
|
+
export declare enum PanoTagStyleEnum {
|
|
210
|
+
/**
|
|
211
|
+
* 生长动画:默认值
|
|
212
|
+
*/
|
|
213
|
+
Growth = "Growth",
|
|
214
|
+
/**
|
|
215
|
+
* 展开动画
|
|
216
|
+
*/
|
|
217
|
+
Expand = "Expand"
|
|
218
|
+
}
|
|
185
219
|
export declare type PanoTagData = {
|
|
186
220
|
type: PanoTagEnum;
|
|
221
|
+
style: PanoTagStyleEnum;
|
|
187
222
|
text: string;
|
|
188
223
|
vertex: Vertex;
|
|
189
224
|
imgUrl?: string;
|
package/lib/typings/VreoUnit.js
CHANGED
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.VreoKeyframeEnum = exports.PanoTagEnum = exports.PanoEffectEnum = exports.InfoPanelTypeEnum = exports.InfoPanelStyleEnum = void 0;
|
|
6
|
+
exports.VreoKeyframeEnum = exports.PanoTagStyleEnum = exports.PanoTagEnum = exports.PanoEffectEnum = exports.InfoPanelTypeEnum = exports.InfoPanelStyleEnum = void 0;
|
|
7
7
|
var VreoKeyframeEnum;
|
|
8
8
|
/**
|
|
9
9
|
* 支持自定义剧本关键帧配置项
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
11
|
exports.VreoKeyframeEnum = VreoKeyframeEnum;
|
|
13
|
-
|
|
14
12
|
(function (VreoKeyframeEnum) {
|
|
15
13
|
VreoKeyframeEnum["CameraMovement"] = "CameraMovement";
|
|
16
14
|
VreoKeyframeEnum["PanoTag"] = "PanoTag";
|
|
@@ -25,18 +23,24 @@ exports.VreoKeyframeEnum = VreoKeyframeEnum;
|
|
|
25
23
|
VreoKeyframeEnum["Exit"] = "Exit";
|
|
26
24
|
VreoKeyframeEnum["Custom"] = "Custom";
|
|
27
25
|
})(VreoKeyframeEnum || (exports.VreoKeyframeEnum = VreoKeyframeEnum = {}));
|
|
28
|
-
|
|
29
26
|
/**
|
|
30
27
|
* 全景标签枚举
|
|
31
28
|
*/
|
|
32
29
|
var PanoTagEnum;
|
|
30
|
+
/**
|
|
31
|
+
* 标签样式种类
|
|
32
|
+
*/
|
|
33
33
|
exports.PanoTagEnum = PanoTagEnum;
|
|
34
|
-
|
|
35
34
|
(function (PanoTagEnum) {
|
|
36
35
|
PanoTagEnum["Text"] = "Text";
|
|
37
36
|
PanoTagEnum["Image"] = "Image";
|
|
38
37
|
})(PanoTagEnum || (exports.PanoTagEnum = PanoTagEnum = {}));
|
|
39
|
-
|
|
38
|
+
var PanoTagStyleEnum;
|
|
39
|
+
exports.PanoTagStyleEnum = PanoTagStyleEnum;
|
|
40
|
+
(function (PanoTagStyleEnum) {
|
|
41
|
+
PanoTagStyleEnum["Growth"] = "Growth";
|
|
42
|
+
PanoTagStyleEnum["Expand"] = "Expand";
|
|
43
|
+
})(PanoTagStyleEnum || (exports.PanoTagStyleEnum = PanoTagStyleEnum = {}));
|
|
40
44
|
/**
|
|
41
45
|
* 全景特效枚举
|
|
42
46
|
*/
|
|
@@ -44,31 +48,24 @@ var PanoEffectEnum;
|
|
|
44
48
|
/**
|
|
45
49
|
* 全景特效
|
|
46
50
|
*/
|
|
47
|
-
|
|
48
51
|
exports.PanoEffectEnum = PanoEffectEnum;
|
|
49
|
-
|
|
50
52
|
(function (PanoEffectEnum) {
|
|
51
53
|
PanoEffectEnum["Distance"] = "Distance";
|
|
52
54
|
})(PanoEffectEnum || (exports.PanoEffectEnum = PanoEffectEnum = {}));
|
|
53
|
-
|
|
54
55
|
/**
|
|
55
56
|
* 信息面板类型枚举
|
|
56
57
|
*/
|
|
57
58
|
var InfoPanelTypeEnum;
|
|
58
59
|
exports.InfoPanelTypeEnum = InfoPanelTypeEnum;
|
|
59
|
-
|
|
60
60
|
(function (InfoPanelTypeEnum) {
|
|
61
61
|
InfoPanelTypeEnum["Image"] = "Image";
|
|
62
62
|
InfoPanelTypeEnum["Video"] = "Video";
|
|
63
63
|
})(InfoPanelTypeEnum || (exports.InfoPanelTypeEnum = InfoPanelTypeEnum = {}));
|
|
64
|
-
|
|
65
64
|
var InfoPanelStyleEnum;
|
|
66
65
|
/**
|
|
67
66
|
* 信息面板
|
|
68
67
|
*/
|
|
69
|
-
|
|
70
68
|
exports.InfoPanelStyleEnum = InfoPanelStyleEnum;
|
|
71
|
-
|
|
72
69
|
(function (InfoPanelStyleEnum) {
|
|
73
70
|
InfoPanelStyleEnum["Drawer"] = "Drawer";
|
|
74
71
|
InfoPanelStyleEnum["PopUp"] = "PopUp";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realsee/vreo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.10",
|
|
4
4
|
"description": "Vreo (VR Video 缩写) 是基于如视三维渲染引擎 Five 和 用户界面构建库 React 实现的如视 3D 空间剧本播放器。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"realsee",
|
|
@@ -15,19 +15,20 @@
|
|
|
15
15
|
"resources",
|
|
16
16
|
"docs",
|
|
17
17
|
"stylesheets",
|
|
18
|
-
"LICENSE"
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"CHANGELOG.md"
|
|
19
20
|
],
|
|
20
21
|
"scripts": {
|
|
21
22
|
"dev": "vite --port=3088 --host 0.0.0.0",
|
|
22
23
|
"build": "tsc && vite build",
|
|
23
24
|
"preview": "vite preview",
|
|
24
|
-
"docs": "npx typedoc",
|
|
25
|
+
"docs": "npx typedoc && yarn run build",
|
|
25
26
|
"packages": "node ./dev-tools/build-packages.js"
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
28
29
|
"@realsee/five": "^5.0.0-alpha.103",
|
|
29
|
-
"react": "^
|
|
30
|
-
"react-dom": "^
|
|
30
|
+
"react": "^17.0.0",
|
|
31
|
+
"react-dom": "^17.0.0"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@babel/cli": "^7.16.0",
|
|
@@ -35,8 +36,8 @@
|
|
|
35
36
|
"@babel/preset-env": "^7.16.4",
|
|
36
37
|
"@babel/preset-react": "^7.16.0",
|
|
37
38
|
"@babel/preset-typescript": "^7.16.0",
|
|
38
|
-
"@realsee/dnalogel": "^
|
|
39
|
-
"@realsee/five": "
|
|
39
|
+
"@realsee/dnalogel": "^2.1.0-alpha.18",
|
|
40
|
+
"@realsee/five": "5.0.0-alpha.149",
|
|
40
41
|
"@types/offscreencanvas": "^2019.6.4",
|
|
41
42
|
"@types/react": "^17.0.37",
|
|
42
43
|
"@types/react-dom": "^17.0.11",
|
|
@@ -47,14 +48,13 @@
|
|
|
47
48
|
"react-dom": "^16.0.0",
|
|
48
49
|
"three": "^0.117.1",
|
|
49
50
|
"typedoc": "^0.22.10",
|
|
50
|
-
"typescript": "
|
|
51
|
+
"typescript": "4.7.4",
|
|
51
52
|
"vite": "^2.6.14"
|
|
52
53
|
},
|
|
53
54
|
"dependencies": {
|
|
54
55
|
"@tweenjs/tween.js": "18.6.4",
|
|
55
56
|
"classnames": "^2.3.1",
|
|
56
57
|
"mobx": "^6.3.7",
|
|
57
|
-
"mobx-react": "^7.2.1"
|
|
58
|
-
"react-transition-group": "^4.4.2"
|
|
58
|
+
"mobx-react": "^7.2.1"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -152,16 +152,3 @@ export class PlayController extends Subscribe<VreoKeyframeEvent> {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
|
|
156
|
-
console.log(`
|
|
157
|
-
|
|
158
|
-
┏━━━┓━━━━━━━━━┏┓━━━━━━━━━━━━━
|
|
159
|
-
┃┏━┓┃━━━━━━━━━┃┃━━━━━━━━━━━━━
|
|
160
|
-
┃┗━┛┃┏━━┓┏━━┓━┃┃━┏━━┓┏━━┓┏━━┓
|
|
161
|
-
┃┏┓┏┛┃┏┓┃┗━┓┃━┃┃━┃━━┫┃┏┓┃┃┏┓┃
|
|
162
|
-
┃┃┃┗┓┃┃━┫┃┗┛┗┓┃┗┓┣━━┃┃┃━┫┃┃━┫
|
|
163
|
-
┗┛┗━┛┗━━┛┗━━━┛┗━┛┗━━┛┗━━┛┗━━┛
|
|
164
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
165
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
166
|
-
|
|
167
|
-
`)
|
package/resources/Player/App.tsx
CHANGED
|
@@ -2,8 +2,9 @@ import * as React from 'react'
|
|
|
2
2
|
import classNames from 'classnames'
|
|
3
3
|
import { observer } from 'mobx-react'
|
|
4
4
|
import { Controller } from './Controller'
|
|
5
|
-
import { useController
|
|
5
|
+
import { useController } from './hooks'
|
|
6
6
|
import { CameraMovement } from './modules/keyframes/CameraMovement'
|
|
7
|
+
import { ResizeObserver } from './modules/ResizeObserver'
|
|
7
8
|
import { InfoPanel } from './modules/keyframes/InfoPanel'
|
|
8
9
|
import { ModelVideo } from './modules/keyframes/ModelVideo'
|
|
9
10
|
import { PanoEffect } from './modules/keyframes/PanoEffect'
|
|
@@ -14,6 +15,7 @@ import { UpdateVRPanorama } from './modules/keyframes/UpdateVRPanorama'
|
|
|
14
15
|
import { VideoEffect } from './modules/keyframes/VideoEffect'
|
|
15
16
|
import { VideoAgent } from './modules/VideoAgent'
|
|
16
17
|
import { BgMusic } from './modules/keyframes/BgMusic'
|
|
18
|
+
import { Wave } from './modules/Wave'
|
|
17
19
|
|
|
18
20
|
const AppView = observer(({ controller }: { controller: Controller }) => {
|
|
19
21
|
|
|
@@ -24,11 +26,9 @@ const AppView = observer(({ controller }: { controller: Controller }) => {
|
|
|
24
26
|
})}
|
|
25
27
|
>
|
|
26
28
|
<div className="vreo-panel-inner">
|
|
29
|
+
{controller.waveAppearance && <Wave appearance={controller.waveAppearance}/>}
|
|
27
30
|
<VideoAgent
|
|
28
31
|
onClick={() => {
|
|
29
|
-
if (controller.isAudio) {
|
|
30
|
-
return
|
|
31
|
-
}
|
|
32
32
|
if (controller.playing) {
|
|
33
33
|
controller.setPlaying(false)
|
|
34
34
|
} else {
|
|
@@ -49,6 +49,7 @@ export function App() {
|
|
|
49
49
|
return (
|
|
50
50
|
<>
|
|
51
51
|
<>
|
|
52
|
+
<ResizeObserver />
|
|
52
53
|
<CameraMovement />
|
|
53
54
|
<ModelVideo />
|
|
54
55
|
<UpdateVRPanorama />
|