@realsee/vreo 0.1.5 → 0.1.6-alpha.4

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.
@@ -247,7 +247,7 @@ var VideoAgentMesh = /*#__PURE__*/function (_THREE$Mesh) {
247
247
  switch (_context3.prev = _context3.next) {
248
248
  case 0:
249
249
  videoUrl = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : '';
250
- videoUrl = (videoUrl || '').replace(/https*:/, '');
250
+ videoUrl = videoUrl || '';
251
251
 
252
252
  if (videoUrl) {
253
253
  _context3.next = 10;
@@ -48,8 +48,8 @@ function ModelVideo() {
48
48
  ref.current.disable();
49
49
  _context.next = 6;
50
50
  return ref.current.load({
51
- video_src: videoSrc.replace(/https*:/, ''),
52
- video_poster_src: videoPosterSrc.replace(/https*:/, ''),
51
+ video_src: videoSrc,
52
+ video_poster_src: videoPosterSrc,
53
53
  points: [vertexs]
54
54
  }, (_controller$configs = controller.configs) === null || _controller$configs === void 0 ? void 0 : (_controller$configs$v = _controller$configs.videos) === null || _controller$configs$v === void 0 ? void 0 : _controller$configs$v.modelTVVideo);
55
55
 
@@ -28,7 +28,15 @@ 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.');
32
40
  var newWorkJSON = JSON.parse(JSON.stringify((_five$work = five.work) === null || _five$work === void 0 ? void 0 : _five$work.raw.work)); // // 原Work数据不能被修改
33
41
 
34
42
  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 !== _five.Five.Mode.Panorama)) {
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(_five.Five.Mode.Panorama);
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
  }
@@ -38,6 +38,7 @@ export declare type MoveOpts = {
38
38
  preload?: boolean;
39
39
  } & CameraMovementOptsCallback;
40
40
  export declare type RotateArgs = {
41
+ mode?: Mode;
41
42
  panoIndex: number;
42
43
  loop: boolean;
43
44
  rotateSpeed: number;
@@ -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
  /** 运镜 */
@@ -115,6 +115,7 @@ export declare type PrompterData = {
115
115
  export declare type UpdateVRPanoramaData = {
116
116
  panoIndex: number;
117
117
  images: WorkCubeImage;
118
+ work?: Work;
118
119
  };
119
120
  /**
120
121
  * 顶点
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/vreo",
3
- "version": "0.1.5",
3
+ "version": "0.1.6-alpha.4",
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.80",
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",
@@ -196,7 +196,7 @@ export class VideoAgentMesh extends THREE.Mesh {
196
196
  }
197
197
 
198
198
  async play(videoUrl = '') {
199
- videoUrl = (videoUrl || '').replace(/https*:/, '')
199
+ videoUrl = videoUrl || ''
200
200
  if (!videoUrl) {
201
201
  if (this.videoUrl) await this.videoInstance.play()
202
202
  else console.warn('警告:视频资源未初始化。')
@@ -20,8 +20,8 @@ export function ModelVideo() {
20
20
  ref.current.disable()
21
21
  await ref.current.load(
22
22
  {
23
- video_src: videoSrc.replace(/https*:/, ''),
24
- video_poster_src: videoPosterSrc.replace(/https*:/, ''),
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,14 @@ 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.')
14
20
  const newWorkJSON = JSON.parse(JSON.stringify(five.work?.raw.work))
15
21
 
16
22
  // // 原Work数据不能被修改
@@ -139,11 +139,16 @@ export const CameraMovementPlugin: FivePlugin<CameraMovementPluginParameterType,
139
139
  opts.asyncStartCallback()
140
140
  }
141
141
 
142
- if (five.currentMode !== Five.Mode.Panorama) {
143
- await five.changeMode(Five.Mode.Panorama)
142
+ // 先切换模型再出旋转效果
143
+ if (args.mode && five.currentMode !== args.mode) {
144
+ await five.changeMode(args.mode)
144
145
  }
145
146
 
146
- if (args.panoIndex !== undefined && args.panoIndex !== five.panoIndex) {
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, {
@@ -46,6 +46,7 @@ export type MoveOpts = {
46
46
  } & CameraMovementOptsCallback
47
47
 
48
48
  export type RotateArgs = {
49
+ mode?: Mode
49
50
  panoIndex: number
50
51
  loop: boolean
51
52
  rotateSpeed: number
@@ -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 {
@@ -125,6 +125,7 @@ export type PrompterData = {
125
125
  export type UpdateVRPanoramaData = {
126
126
  panoIndex: number
127
127
  images: WorkCubeImage
128
+ work?: Work
128
129
  }
129
130
 
130
131
  /**