@realsee/vreo 0.1.2 → 0.1.6-alpha.1

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 (53) hide show
  1. package/docs/assets/search.js +1 -1
  2. package/docs/classes/Player.Player-1.html +6 -6
  3. package/docs/enums/Player.InfoPanelTypeEnum.html +1 -1
  4. package/docs/enums/Player.PanoEffectEnum.html +1 -1
  5. package/docs/enums/Player.PanoTagEnum.html +1 -1
  6. package/docs/enums/Player.VreoKeyframeEnum.html +13 -11
  7. package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
  8. package/docs/enums/fivePlugins.Rotation.html +1 -1
  9. package/docs/interfaces/Player.PlayerConfigs.html +1 -1
  10. package/docs/interfaces/Player.Vertex.html +1 -1
  11. package/docs/interfaces/Player.VreoKeyframe.html +1 -1
  12. package/docs/interfaces/Player.VreoUnit.html +1 -1
  13. package/docs/interfaces/Player.VreoVideo.html +1 -1
  14. package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -1
  15. package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +2 -2
  16. package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -1
  17. package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -1
  18. package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -1
  19. package/docs/interfaces/react.VreoActionCallbacks.html +6 -6
  20. package/docs/modules/Player.html +14 -12
  21. package/docs/modules/fivePlugins.html +2 -2
  22. package/docs/modules/react.html +1 -1
  23. package/lib/Player/App.js +4 -0
  24. package/lib/Player/Controller.d.ts +1 -0
  25. package/lib/Player/Controller.js +11 -4
  26. package/lib/Player/index.d.ts +1 -0
  27. package/lib/Player/index.js +50 -31
  28. package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +2 -0
  29. package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +62 -22
  30. package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +2 -0
  31. package/lib/Player/modules/VideoAgent/VideoAgentScene.js +7 -0
  32. package/lib/Player/modules/VideoAgent/index.js +6 -0
  33. package/lib/Player/modules/keyframes/Prompter/index.js +2 -1
  34. package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +4 -0
  35. package/lib/fivePlugins/CameraMovementPlugin/index.js +5 -4
  36. package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts +1 -0
  37. package/lib/react/index.js +12 -4
  38. package/lib/typings/VreoUnit.d.ts +7 -1
  39. package/lib/typings/VreoUnit.js +1 -0
  40. package/package.json +6 -2
  41. package/resources/Player/App.tsx +3 -0
  42. package/resources/Player/Controller.ts +5 -5
  43. package/resources/Player/index.tsx +36 -23
  44. package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +63 -20
  45. package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +6 -0
  46. package/resources/Player/modules/VideoAgent/index.tsx +5 -0
  47. package/resources/Player/modules/keyframes/Prompter/index.tsx +1 -0
  48. package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +5 -1
  49. package/resources/fivePlugins/CameraMovementPlugin/index.ts +8 -3
  50. package/resources/fivePlugins/CameraMovementPlugin/typings.ts +1 -0
  51. package/resources/react/index.tsx +11 -4
  52. package/resources/typings/VreoUnit.ts +7 -0
  53. package/stylesheets/default.css +9 -1
@@ -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
 
@@ -11,6 +11,10 @@ export function UpdateVRPanorama() {
11
11
  const callback = (keyframe: VreoKeyframe) => {
12
12
  const { panoIndex, images } = keyframe.data as UpdateVRPanoramaData
13
13
 
14
+ Object.keys(images).forEach((_key) => {
15
+ const key = _key as keyof WorkCubeImage
16
+ images[key] = images[key].replace(/https*:\/\//, '//')
17
+ })
14
18
  const newWorkJSON = JSON.parse(JSON.stringify(five.work?.raw.work))
15
19
 
16
20
  // // 原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
@@ -7,13 +7,16 @@ const VreoContext = React.createContext<Player | null>(null)
7
7
 
8
8
  export const VreoProvider: React.FC = (props) => {
9
9
  const five = unsafe__useFiveInstance()
10
+
10
11
  const [player, setPlayer] = React.useState<Player | null>(null)
12
+ const playerRef = React.useRef<Player | null>(null)
11
13
 
12
14
  React.useEffect(() => {
13
- setPlayer(new Player(five))
15
+ playerRef.current = new Player(five)
16
+ setPlayer(playerRef.current)
14
17
 
15
18
  return () => {
16
- player?.dispose()
19
+ playerRef.current?.dispose()
17
20
  }
18
21
  }, [])
19
22
 
@@ -88,9 +91,13 @@ export function useVreoEventCallback<T extends keyof VreoKeyframeEvent>(
88
91
  if (deps !== undefined) {
89
92
  dependencyList = dependencyList.concat(deps)
90
93
  }
91
- React.useLayoutEffect(() => {
94
+ React.useEffect(() => {
92
95
  // @ts-ignore
93
- return player.on(name, callback)
96
+ player.on(name, callback)
97
+ return () => {
98
+ // @ts-ignore
99
+ player.off(name, callback)
100
+ }
94
101
  }, dependencyList)
95
102
  }
96
103
 
@@ -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
  /**
@@ -223,3 +227,6 @@ export type VideoEffectData = {
223
227
  direction?: Vertex
224
228
  vector?: Pick<Pose, 'longitude' | 'latitude'>
225
229
  }
230
+
231
+ /** 自定义序列帧 */
232
+ export type CustomData = Record<string, any>
@@ -133,7 +133,10 @@
133
133
  opacity: 1;
134
134
  transition: opacity 0.5s;
135
135
  }
136
-
136
+ .vreo-prompter--audio {
137
+ top: 72px;
138
+ left: 64px;
139
+ }
137
140
  .vreo-prompter-innerText {
138
141
  position: absolute;
139
142
  left: 0;
@@ -495,3 +498,8 @@
495
498
  width: 100%;
496
499
  max-width: 375px;
497
500
  }
501
+
502
+ .vreo-panel--hidden .vreo-panel-inner {
503
+ opacity: 0;
504
+ transition: opacity 0.45s;
505
+ }