@realsee/vreo 0.1.4 → 0.1.6-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/assets/search.js +1 -1
- package/docs/classes/Player.Player-1.html +3 -3
- package/docs/enums/Player.InfoPanelTypeEnum.html +1 -1
- package/docs/enums/Player.PanoEffectEnum.html +1 -1
- package/docs/enums/Player.PanoTagEnum.html +1 -1
- package/docs/enums/Player.VreoKeyframeEnum.html +13 -11
- package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
- package/docs/enums/fivePlugins.Rotation.html +1 -1
- package/docs/interfaces/Player.PlayerConfigs.html +1 -1
- package/docs/interfaces/Player.Vertex.html +1 -1
- package/docs/interfaces/Player.VreoKeyframe.html +1 -1
- package/docs/interfaces/Player.VreoUnit.html +1 -1
- package/docs/interfaces/Player.VreoVideo.html +1 -1
- package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -1
- package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +2 -2
- 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/react.VreoActionCallbacks.html +6 -6
- package/docs/modules/Player.html +14 -12
- package/docs/modules/fivePlugins.html +2 -2
- package/docs/modules/react.html +1 -1
- package/lib/Player/modules/keyframes/ModelVideo/index.js +2 -2
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +13 -1
- package/lib/fivePlugins/CameraMovementPlugin/index.js +5 -4
- package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts +1 -0
- package/lib/typings/VreoUnit.d.ts +9 -2
- package/lib/typings/VreoUnit.js +1 -0
- package/package.json +2 -2
- package/resources/Player/modules/keyframes/ModelVideo/index.tsx +2 -2
- package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +12 -2
- package/resources/fivePlugins/CameraMovementPlugin/index.ts +8 -3
- package/resources/fivePlugins/CameraMovementPlugin/typings.ts +1 -0
- package/resources/typings/VreoUnit.ts +9 -1
|
@@ -28,7 +28,19 @@ function UpdateVRPanorama() {
|
|
|
28
28
|
|
|
29
29
|
var _ref = keyframe.data,
|
|
30
30
|
panoIndex = _ref.panoIndex,
|
|
31
|
-
images = _ref.images
|
|
31
|
+
images = _ref.images,
|
|
32
|
+
work = _ref.work;
|
|
33
|
+
|
|
34
|
+
if (work) {
|
|
35
|
+
five.load(work);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
console.warn('not support.');
|
|
40
|
+
Object.keys(images).forEach(function (_key) {
|
|
41
|
+
var key = _key;
|
|
42
|
+
images[key] = images[key].replace(/https*:\/\//, '//');
|
|
43
|
+
});
|
|
32
44
|
var newWorkJSON = JSON.parse(JSON.stringify((_five$work = five.work) === null || _five$work === void 0 ? void 0 : _five$work.raw.work)); // // 原Work数据不能被修改
|
|
33
45
|
|
|
34
46
|
if (newWorkJSON.panorama && newWorkJSON.panorama.list && newWorkJSON.panorama.list[panoIndex]) {
|
|
@@ -204,18 +204,19 @@ var CameraMovementPlugin = function CameraMovementPlugin(five) {
|
|
|
204
204
|
|
|
205
205
|
if (opts.asyncStartCallback) {
|
|
206
206
|
opts.asyncStartCallback();
|
|
207
|
-
}
|
|
207
|
+
} // 先切换模型再出旋转效果
|
|
208
|
+
|
|
208
209
|
|
|
209
|
-
if (!(five.currentMode !==
|
|
210
|
+
if (!(args.mode && five.currentMode !== args.mode)) {
|
|
210
211
|
_context2.next = 5;
|
|
211
212
|
break;
|
|
212
213
|
}
|
|
213
214
|
|
|
214
215
|
_context2.next = 5;
|
|
215
|
-
return five.changeMode(
|
|
216
|
+
return five.changeMode(args.mode);
|
|
216
217
|
|
|
217
218
|
case 5:
|
|
218
|
-
if (!(args.panoIndex !== undefined && args.panoIndex !== five.panoIndex)) {
|
|
219
|
+
if (!(args.mode === _five.Five.Mode.Panorama && five.currentMode === _five.Five.Mode.Panorama && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex)) {
|
|
219
220
|
_context2.next = 11;
|
|
220
221
|
break;
|
|
221
222
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mode, Pose, WorkCubeImage } from '@realsee/five';
|
|
1
|
+
import { Mode, Pose, WorkCubeImage, Work } from '@realsee/five';
|
|
2
2
|
import { CameraMovementEffect, Rotation } from '../fivePlugins/CameraMovementPlugin/typings';
|
|
3
3
|
export declare enum VreoKeyframeEnum {
|
|
4
4
|
/** 运镜 */
|
|
@@ -38,7 +38,11 @@ export declare enum VreoKeyframeEnum {
|
|
|
38
38
|
/**
|
|
39
39
|
* 结束
|
|
40
40
|
*/
|
|
41
|
-
Exit = "Exit"
|
|
41
|
+
Exit = "Exit",
|
|
42
|
+
/**
|
|
43
|
+
* 自定义剧本帧
|
|
44
|
+
*/
|
|
45
|
+
Custom = "Custom"
|
|
42
46
|
}
|
|
43
47
|
/**
|
|
44
48
|
* 支持自定义剧本关键帧配置项
|
|
@@ -111,6 +115,7 @@ export declare type PrompterData = {
|
|
|
111
115
|
export declare type UpdateVRPanoramaData = {
|
|
112
116
|
panoIndex: number;
|
|
113
117
|
images: WorkCubeImage;
|
|
118
|
+
work?: Work;
|
|
114
119
|
};
|
|
115
120
|
/**
|
|
116
121
|
* 顶点
|
|
@@ -202,3 +207,5 @@ export declare type VideoEffectData = {
|
|
|
202
207
|
direction?: Vertex;
|
|
203
208
|
vector?: Pick<Pose, 'longitude' | 'latitude'>;
|
|
204
209
|
};
|
|
210
|
+
/** 自定义序列帧 */
|
|
211
|
+
export declare type CustomData = Record<string, any>;
|
package/lib/typings/VreoUnit.js
CHANGED
|
@@ -22,6 +22,7 @@ exports.VreoKeyframeEnum = VreoKeyframeEnum;
|
|
|
22
22
|
VreoKeyframeEnum["InfoPanel"] = "InfoPanel";
|
|
23
23
|
VreoKeyframeEnum["VideoEffect"] = "VideoEffect";
|
|
24
24
|
VreoKeyframeEnum["Exit"] = "Exit";
|
|
25
|
+
VreoKeyframeEnum["Custom"] = "Custom";
|
|
25
26
|
})(VreoKeyframeEnum || (exports.VreoKeyframeEnum = VreoKeyframeEnum = {}));
|
|
26
27
|
|
|
27
28
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realsee/vreo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6-alpha.3",
|
|
4
4
|
"description": "Vreo (VR Video 缩写) 是基于如视三维渲染引擎 Five 和 用户界面构建库 React 实现的如视 3D 空间剧本播放器。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"realsee",
|
|
@@ -35,7 +35,7 @@
|
|
|
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.
|
|
38
|
+
"@realsee/five": "^5.0.0-alpha.91",
|
|
39
39
|
"@types/offscreencanvas": "^2019.6.4",
|
|
40
40
|
"@types/react": "^17.0.37",
|
|
41
41
|
"@types/react-dom": "^17.0.11",
|
|
@@ -20,8 +20,8 @@ export function ModelVideo() {
|
|
|
20
20
|
ref.current.disable()
|
|
21
21
|
await ref.current.load(
|
|
22
22
|
{
|
|
23
|
-
video_src: videoSrc
|
|
24
|
-
video_poster_src: videoPosterSrc
|
|
23
|
+
video_src: videoSrc,
|
|
24
|
+
video_poster_src: videoPosterSrc,
|
|
25
25
|
points: [vertexs],
|
|
26
26
|
},
|
|
27
27
|
controller.configs?.videos?.modelTVVideo
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
|
-
import { parseWork } from '@realsee/five'
|
|
2
|
+
import { parseWork, WorkCubeImage } from '@realsee/five'
|
|
3
3
|
import { useController, useFiveInstance } from '../../../hooks'
|
|
4
4
|
import { UpdateVRPanoramaData, VreoKeyframe, VreoKeyframeEnum } from '../../../../typings/VreoUnit'
|
|
5
5
|
|
|
@@ -9,8 +9,18 @@ export function UpdateVRPanorama() {
|
|
|
9
9
|
|
|
10
10
|
React.useEffect(() => {
|
|
11
11
|
const callback = (keyframe: VreoKeyframe) => {
|
|
12
|
-
const { panoIndex, images } = keyframe.data as UpdateVRPanoramaData
|
|
12
|
+
const { panoIndex, images, work } = keyframe.data as UpdateVRPanoramaData
|
|
13
13
|
|
|
14
|
+
if (work) {
|
|
15
|
+
five.load(work)
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
console.warn('not support.')
|
|
20
|
+
Object.keys(images).forEach((_key) => {
|
|
21
|
+
const key = _key as keyof WorkCubeImage
|
|
22
|
+
images[key] = images[key].replace(/https*:\/\//, '//')
|
|
23
|
+
})
|
|
14
24
|
const newWorkJSON = JSON.parse(JSON.stringify(five.work?.raw.work))
|
|
15
25
|
|
|
16
26
|
// // 原Work数据不能被修改
|
|
@@ -139,11 +139,16 @@ export const CameraMovementPlugin: FivePlugin<CameraMovementPluginParameterType,
|
|
|
139
139
|
opts.asyncStartCallback()
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
// 先切换模型再出旋转效果
|
|
143
|
+
if (args.mode && five.currentMode !== args.mode) {
|
|
144
|
+
await five.changeMode(args.mode)
|
|
144
145
|
}
|
|
145
146
|
|
|
146
|
-
|
|
147
|
+
// 全景状态下,需要点位对齐
|
|
148
|
+
if (args.mode === Five.Mode.Panorama &&
|
|
149
|
+
five.currentMode === Five.Mode.Panorama &&
|
|
150
|
+
args.panoIndex !== undefined &&
|
|
151
|
+
args.panoIndex !== five.panoIndex) {
|
|
147
152
|
if (opts.preload) await five.preloadPano(args.panoIndex)
|
|
148
153
|
await new Promise((resolve, reject) => {
|
|
149
154
|
five.moveToPano(args.panoIndex, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mode, Pose, WorkCubeImage } from '@realsee/five'
|
|
1
|
+
import { Mode, Pose, WorkCubeImage, Work } from '@realsee/five'
|
|
2
2
|
import { CameraMovementEffect, Rotation } from '../fivePlugins/CameraMovementPlugin/typings'
|
|
3
3
|
|
|
4
4
|
export enum VreoKeyframeEnum {
|
|
@@ -40,6 +40,10 @@ export enum VreoKeyframeEnum {
|
|
|
40
40
|
* 结束
|
|
41
41
|
*/
|
|
42
42
|
Exit = 'Exit',
|
|
43
|
+
/**
|
|
44
|
+
* 自定义剧本帧
|
|
45
|
+
*/
|
|
46
|
+
Custom = 'Custom',
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
/**
|
|
@@ -121,6 +125,7 @@ export type PrompterData = {
|
|
|
121
125
|
export type UpdateVRPanoramaData = {
|
|
122
126
|
panoIndex: number
|
|
123
127
|
images: WorkCubeImage
|
|
128
|
+
work?: Work
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
/**
|
|
@@ -223,3 +228,6 @@ export type VideoEffectData = {
|
|
|
223
228
|
direction?: Vertex
|
|
224
229
|
vector?: Pick<Pose, 'longitude' | 'latitude'>
|
|
225
230
|
}
|
|
231
|
+
|
|
232
|
+
/** 自定义序列帧 */
|
|
233
|
+
export type CustomData = Record<string, any>
|