@realsee/vreo 0.2.0-alpha.5 → 0.2.0-alpha.8

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 (69) hide show
  1. package/README.md +47 -3
  2. package/docs/assets/custom.css +2 -2
  3. package/docs/assets/search.js +1 -1
  4. package/docs/classes/Player.Controller.html +3 -3
  5. package/docs/classes/Player.Player-1.html +3 -3
  6. package/docs/classes/Player.VideoAgentMesh.html +11 -11
  7. package/docs/classes/Player.VideoAgentScene.html +1 -1
  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 +1 -1
  11. package/docs/enums/Player.PanoTagEnum.html +1 -1
  12. package/docs/enums/Player.VreoKeyframeEnum.html +12 -12
  13. package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
  14. package/docs/enums/fivePlugins.Rotation.html +1 -1
  15. package/docs/index.html +26 -2
  16. package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -1
  17. package/docs/interfaces/Player.PlayerConfigs.html +3 -3
  18. package/docs/interfaces/Player.Vertex.html +1 -1
  19. package/docs/interfaces/Player.VideoAgentMeshOptions.html +1 -1
  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 +2 -2
  25. package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -1
  26. package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -1
  27. package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -1
  28. package/docs/interfaces/react.VreoActionCallbacks.html +6 -6
  29. package/docs/interfaces/react.VreoProviderProps.html +1 -1
  30. package/docs/modules/Player.html +13 -13
  31. package/docs/modules/custom.html +1 -1
  32. package/docs/modules/fivePlugins.html +2 -2
  33. package/docs/modules/react.html +1 -1
  34. package/lib/PlayController/createHTMLAudioElement.d.ts +1 -0
  35. package/lib/PlayController/createHTMLAudioElement.js +47 -0
  36. package/lib/PlayController/index.d.ts +38 -0
  37. package/lib/PlayController/index.js +300 -0
  38. package/lib/Player/Controller.d.ts +2 -0
  39. package/lib/Player/Controller.js +14 -0
  40. package/lib/Player/custom/SpatialScenePanel/index.d.ts +2 -2
  41. package/lib/Player/custom/SpatialScenePanel/index.js +96 -15
  42. package/lib/Player/index.d.ts +1 -1
  43. package/lib/Player/index.js +71 -10
  44. package/lib/Player/modules/PopUp/index.d.ts +2 -0
  45. package/lib/Player/modules/PopUp/index.js +43 -0
  46. package/lib/Player/modules/keyframes/CameraMovement/index.js +41 -5
  47. package/lib/Player/modules/keyframes/InfoPanel/index.js +73 -35
  48. package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +23 -15
  49. package/lib/Player/typings.d.ts +4 -0
  50. package/lib/fivePlugins/CameraMovementPlugin/index.js +101 -90
  51. package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts +3 -2
  52. package/lib/typings/VreoUnit.d.ts +9 -3
  53. package/lib/typings/VreoUnit.js +14 -6
  54. package/package.json +2 -2
  55. package/resources/PlayController/createHTMLAudioElement.ts +53 -0
  56. package/resources/PlayController/index.ts +167 -0
  57. package/resources/Player/Controller.ts +12 -0
  58. package/resources/Player/custom/SpatialScenePanel/index.tsx +143 -34
  59. package/resources/Player/index.tsx +36 -2
  60. package/resources/Player/modules/PopUp/index.tsx +26 -0
  61. package/resources/Player/modules/keyframes/CameraMovement/index.tsx +7 -3
  62. package/resources/Player/modules/keyframes/InfoPanel/index.tsx +79 -34
  63. package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +20 -15
  64. package/resources/Player/typings.ts +2 -0
  65. package/resources/fivePlugins/CameraMovementPlugin/index.ts +55 -47
  66. package/resources/fivePlugins/CameraMovementPlugin/typings.ts +2 -1
  67. package/resources/typings/VreoUnit.ts +11 -4
  68. package/stylesheets/custom/SpatialScenePanel.css +14 -8
  69. package/stylesheets/default.css +66 -0
@@ -50,65 +50,73 @@ function progressNumber(from: number, to: number, pst: number) {
50
50
  export const CameraMovementPlugin: FivePlugin<CameraMovementPluginParameterType, CameraMovementPluginExportType> = (
51
51
  five: Five,
52
52
  ) => {
53
- const move = async (args: Partial<MoveArgs>, duration: number, opts: MoveOpts = { preload: true }) => {
54
- if (opts.asyncStartCallback) {
55
- opts.asyncStartCallback()
56
- }
53
+ const move = (args: Partial<MoveArgs>, duration: number, opts: MoveOpts = { preload: true }) => {
54
+ return new Promise<boolean>(async (resolve, reject) => {
55
+
56
+ if (opts.asyncStartCallback) {
57
+ opts.asyncStartCallback()
58
+ }
59
+
60
+ if (five.panoIndex === undefined) {
61
+ return reject(false)
62
+ }
57
63
 
58
- if (args.mode && args.mode !== five.currentMode) {
59
- await new Promise((resolve) => {
60
- if (!args.mode) return
61
- five.once('modeChange', (mode) => {
62
- five.once('initAnimationEnded', () => {
63
- if (mode === args.mode) {
64
- resolve(true)
65
- }
64
+ if (args.mode && args.mode !== five.currentMode) {
65
+ await new Promise((resolve) => {
66
+ if (!args.mode) return
67
+ five.once('modeChange', (mode) => {
68
+ five.once('initAnimationEnded', () => {
69
+ if (mode === args.mode) {
70
+ resolve(true)
71
+ }
72
+ })
73
+ })
74
+ five.changeMode(args.mode, {
75
+ fov: args.fov || undefined,
76
+ latitude: args.latitude || undefined,
77
+ longitude: args.longitude || undefined,
78
+ panoIndex: args.panoIndex || undefined,
66
79
  })
67
80
  })
68
- five.changeMode(args.mode, {
69
- fov: args.fov || undefined,
70
- latitude: args.latitude || undefined,
71
- longitude: args.longitude || undefined,
72
- panoIndex: args.panoIndex || undefined,
73
- })
74
- })
75
- }
81
+ }
76
82
 
77
- if (args.mode === Five.Mode.Floorplan) {
78
- return true
79
- }
83
+ if (args.mode === Five.Mode.Floorplan) {
84
+ return resolve(true)
85
+ }
80
86
 
81
- if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex) {
82
- await five.preloadPano(args.panoIndex)
83
- }
87
+ if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five.panoIndex) {
88
+ await five.preloadPano(args.panoIndex)
89
+ }
90
+
91
+ if (opts.asyncEndCallback) {
92
+ opts.asyncEndCallback()
93
+ }
94
+
95
+ if (
96
+ args.panoIndex === undefined &&
97
+ args.fov === undefined &&
98
+ args.latitude === undefined &&
99
+ args.longitude === undefined
100
+ ) {
101
+ return resolve(true)
102
+ }
84
103
 
85
- if (opts.asyncEndCallback) {
86
- opts.asyncEndCallback()
87
- }
88
104
 
89
- if (
90
- args.panoIndex === undefined &&
91
- args.fov === undefined &&
92
- args.latitude === undefined &&
93
- args.longitude === undefined
94
- ) {
95
- return true
96
- }
97
- return await new Promise<boolean>((resolve, reject) => {
98
105
  const panoIndex = args.panoIndex !== undefined ? args.panoIndex : five.panoIndex
106
+
99
107
  if (panoIndex !== undefined) {
100
- const movePanoOptions: MovePanoOptions = {
108
+ const movePanoOptions: MovePanoOptions = Object.assign(args, {
101
109
  duration, // 移动耗时
102
110
  moveEndCallback: () => resolve(true), // 移动结束
103
- moveCancelCallback: () => reject(false), // 移动开始
104
- effect: 'fade',
105
- }
106
- five.moveToPano(
111
+ moveCancelCallback: () => {
112
+ resolve(true)
113
+ }, // 移动开始
114
+ // effect: args.transEffect || 'fade',
115
+ })
116
+
117
+ await five.moveToPano(
107
118
  panoIndex,
108
- Object.assign(
109
- movePanoOptions,
110
- args,
111
- ),
119
+ movePanoOptions,
112
120
  )
113
121
  } else {
114
122
  reject(false)
@@ -39,7 +39,8 @@ export interface CameraMovementOptsCallback {
39
39
  export type MoveArgs = {
40
40
  mode: Mode
41
41
  panoIndex: number
42
- } & Pose & Pick<MovePanoOptions, 'effect'>
42
+ transEffect?: "fly" | "fade" | "instant"
43
+ } & Pose
43
44
 
44
45
  export type MoveOpts = {
45
46
  preload?: boolean
@@ -1,4 +1,4 @@
1
- import { Mode, Pose } from '@realsee/five'
1
+ import { Mode, MovePanoOptions, Pose } from '@realsee/five'
2
2
  import { CameraMovementEffect, Rotation } from '../fivePlugins/CameraMovementPlugin/typings'
3
3
 
4
4
  export enum VreoKeyframeEnum {
@@ -65,7 +65,7 @@ export type VreoKeyframeConfigMap = {
65
65
  * 剧本关键帧
66
66
  */
67
67
  export interface VreoKeyframe {
68
- uuid: string
68
+ uuid?: string
69
69
  type: VreoKeyframeEnum
70
70
  start: number
71
71
  end: number
@@ -104,7 +104,7 @@ export type VreoKeyframeEvent = { [key in VreoKeyframeEnum]: (keyframe: VreoKeyf
104
104
  // 新数据载入完成
105
105
  loaded: (vreoUnit: VreoUnit) => void
106
106
  // 语音状态 播放 -> 暂停
107
- paused: () => void
107
+ paused: (ended?: boolean) => void
108
108
  // 语音状态 暂停 -> 播放
109
109
  playing: () => void
110
110
  // 未知的 剧本帧类型
@@ -115,7 +115,8 @@ export type VreoKeyframeEvent = { [key in VreoKeyframeEnum]: (keyframe: VreoKeyf
115
115
  * 相机运动
116
116
  */
117
117
  export type CameraMovementData = {
118
- effect: CameraMovementEffect
118
+ effect?: CameraMovementEffect
119
+ transEffect?: "fly" | "fade" | "instant"
119
120
  mode: Mode
120
121
  panoIndex: number
121
122
  loop?: boolean
@@ -235,11 +236,17 @@ export enum InfoPanelTypeEnum {
235
236
  Video = 'Video',
236
237
  }
237
238
 
239
+ export enum InfoPanelStyleEnum {
240
+ Drawer = 'Drawer',
241
+ PopUp = 'PopUp',
242
+ }
243
+
238
244
  /**
239
245
  * 信息面板
240
246
  */
241
247
  export type InfoPanelData = {
242
248
  type: InfoPanelTypeEnum
249
+ style?: InfoPanelStyleEnum
243
250
  url: string
244
251
  // 标题
245
252
  title?: string
@@ -77,9 +77,15 @@
77
77
  background-image: url("//vrlab-static.ljcdn.com/release/web/VoiceAssistant/images/panel-min.7d9ba2b7.png");
78
78
  background-size: 340rem 13.4375rem;
79
79
  background-repeat: no-repeat;
80
- animation: SpatialScenePanel-panel-sprites-animation 1.375s 0s steps(33) infinite normal
80
+ z-index: -1;
81
81
  }
82
82
 
83
+ .SpatialScenePanel-bg--animation {
84
+ /* animation: SpatialScenePanel-panel-sprites-animation 1.375s 0s steps(33) infinite normal; */
85
+ animation: SpatialScenePanel-panel-sprites-animation 1.375s 0.5s steps(33) normal;
86
+ }
87
+
88
+
83
89
  .SpatialScenePanel-show-area .SpatialScenePanel-header {
84
90
  width: 7.5rem;
85
91
  height: 1.375rem;
@@ -89,7 +95,9 @@
89
95
  background-image: url("//vrlab-static.ljcdn.com/release/web/VoiceAssistant/images/title-bg.377af865.png");
90
96
  background-size: 100%;
91
97
  margin: 1.875rem auto 1.25rem auto;
92
- padding-bottom: .25rem
98
+ background-image: linear-gradient(to left, rgba(234, 208, 154, 0), rgb(255 229 176 / 21%) 47%, rgba(234, 208, 154, 0));
99
+ border-bottom: 1px solid rgb(255 255 255 / 10%);
100
+ border-radius: 2px;
93
101
  }
94
102
 
95
103
  .SpatialScenePanel-show-area .SpatialScenePanel-header .SpatialScenePanel-title {
@@ -97,7 +105,7 @@
97
105
  font-size: 1.0625rem;
98
106
  color: #ffe5b0;
99
107
  letter-spacing: 0;
100
- line-height: 1.0625rem;
108
+ line-height: 1.125;
101
109
  text-shadow: 0 0 1.25rem rgba(0,0,0,0.15)
102
110
  }
103
111
 
@@ -106,7 +114,7 @@
106
114
  font-size: .625rem;
107
115
  color: rgba(255,229,176,0.6);
108
116
  letter-spacing: 0;
109
- line-height: .625rem;
117
+ line-height: 1.25rem;
110
118
  text-shadow: 0 0 .625rem rgba(255,255,255,0.03);
111
119
  align-self: flex-end
112
120
  }
@@ -270,9 +278,7 @@
270
278
 
271
279
  .SpatialScenePanel.hide .SpatialScenePanel-show-area {
272
280
  transform: scale3d(0,1,1);
273
- transition: -webkit-transform 500ms linear;
274
- transition: transform 500ms linear;
275
- transition: transform 500ms linear, -webkit-transform 500ms linear
281
+ transition: transform 150ms linear;
276
282
  }
277
283
 
278
284
  .SpatialScenePanel.hide .SpatialScenePanel-disappear-area {
@@ -298,6 +304,6 @@
298
304
  background-image: url("//vrlab-static.ljcdn.com/release/web/VoiceAssistant/images/line.4ac1c0bb.png");
299
305
  background-size: 10rem 11.666666666666666rem;
300
306
  background-repeat: no-repeat;
301
- animation: SpatialScenePanel-line-sprites-animation 500ms 500ms steps(23) 1 normal
307
+ animation: SpatialScenePanel-line-sprites-animation 500ms 100ms steps(23) 1 normal
302
308
  }
303
309
 
@@ -547,3 +547,69 @@
547
547
  opacity: 0;
548
548
  transition: opacity 0.45s;
549
549
  }
550
+
551
+ .vreo-PopUp {
552
+ position: absolute;
553
+ left: 0;
554
+ top: 0;
555
+ width: 100%;
556
+ height: 100%;
557
+ pointer-events: none;
558
+ background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.7) 65%);
559
+ opacity: 0;
560
+ transition: opacity .45s;
561
+ display: flex;
562
+ justify-content: center;
563
+ align-items: center;
564
+ }
565
+
566
+ .vreo-PopUp.vreo-PopUp-visible {
567
+ opacity: 1;
568
+ pointer-events: all;
569
+ }
570
+
571
+ .vreo-PopUp-inner {
572
+ width: 339px;
573
+ height: 425px;
574
+ position: relative;
575
+ }
576
+
577
+ @media only screen and (min-width: 960px) {
578
+ .vreo-PopUp-inner {
579
+ width: 678px;
580
+ height: 620px;
581
+ position: relative;
582
+ }
583
+ .vreo-infoPanelVideo {
584
+ max-width: 100%;
585
+ }
586
+ }
587
+
588
+ .vreo-PopUp-inner .vreo-infoPanel {
589
+ background-color: initial;
590
+ justify-content: center;
591
+ }
592
+
593
+ .vreo-PopUp-inner .vreo-infoPanel-title {
594
+ position: absolute;
595
+ bottom: 32px;
596
+ left: 0;
597
+ z-index: 1;
598
+ flex-direction: column;
599
+ justify-content: end;
600
+ height: 200px;
601
+ background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
602
+ }
603
+
604
+ .vreo-PopUp-inner .vreo-infoPanel-title .vreo-infoPanel-t1 {
605
+ padding-left: 0;
606
+ font-size: 20px;
607
+ font-weight: 600;
608
+ padding-bottom: 14px;
609
+ }
610
+
611
+ .vreo-PopUp-inner .vreo-infoPanel-title .vreo-infoPanel-t2 {
612
+ padding: 0 0 24px 0;
613
+ font-size: 14px;
614
+ opacity: 0.85;
615
+ }