@realsee/vreo 0.2.0-alpha.10 → 0.2.0-alpha.13
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/README.md +2 -2
- package/docs/assets/search.js +1 -1
- package/docs/classes/Player.AudioLike.html +52 -0
- package/docs/classes/Player.Controller.html +3 -3
- package/docs/classes/Player.Player-1.html +3 -3
- package/docs/classes/Player.VideoAgentMesh.html +12 -12
- package/docs/classes/Player.VideoAgentScene.html +1 -1
- package/docs/demo/assets/AppReact.388465e9.js +1 -0
- package/docs/demo/assets/default.0350c336.css +1 -0
- package/docs/demo/assets/default.f03f1cdd.js +64 -0
- package/docs/demo/assets/dynamic.3f7479e4.js +1 -0
- package/docs/demo/assets/examples.02abaf01.js +25 -0
- package/docs/demo/assets/examples.dac4a6fe.css +1 -0
- package/docs/demo/assets/index.485f13f7.js +1 -0
- package/docs/demo/assets/index.a7bafdff.css +1 -0
- package/docs/demo/assets/main.0b6b41ab.js +1 -0
- package/docs/demo/assets/react.aa3cf7f7.css +1 -0
- package/docs/demo/assets/react.b14dadc7.js +25 -0
- package/docs/demo/assets/vendor.d3e0753c.js +3903 -0
- package/docs/demo/assets/znRoyv06SZQeqA7m.0057e8ae.js +1 -0
- package/docs/demo/examples.html +18 -0
- package/docs/demo/index-react-dynamic.html +21 -0
- package/docs/demo/index-react.html +21 -0
- package/docs/demo/index.html +20 -0
- package/docs/enums/Player.InfoPanelStyleEnum.html +1 -1
- 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.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 +2 -2
- package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -1
- package/docs/interfaces/Player.PlayerConfigs.html +2 -2
- package/docs/interfaces/Player.Vertex.html +1 -1
- package/docs/interfaces/Player.VideoAgentMeshOptions.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/interfaces/react.VreoProviderProps.html +1 -1
- package/docs/modules/Player.html +16 -14
- package/docs/modules/custom.html +1 -1
- package/docs/modules/fivePlugins.html +2 -2
- package/docs/modules/react.html +1 -1
- package/lib/Player/Controller.d.ts +1 -1
- package/lib/Player/index.d.ts +1 -1
- package/lib/Player/index.js +15 -15
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +4 -2
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +71 -23
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +2 -1
- package/lib/Player/modules/keyframes/ModelVideo/index.js +2 -2
- package/lib/Player/modules/keyframes/PanoTag/index.js +19 -6
- package/lib/Player/modules/keyframes/Prompter/index.js +2 -3
- package/lib/react/index.d.ts +2 -2
- package/lib/react/index.js +2 -2
- package/lib/shared-utils/AduioLike.d.ts +37 -0
- package/lib/shared-utils/AduioLike.js +165 -0
- package/lib/typings/VreoUnit.d.ts +14 -0
- package/lib/typings/VreoUnit.js +13 -1
- package/package.json +4 -4
- package/resources/Player/Controller.ts +2 -0
- package/resources/Player/index.tsx +42 -28
- package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +39 -9
- package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +2 -0
- package/resources/Player/modules/keyframes/ModelVideo/index.tsx +1 -1
- package/resources/Player/modules/keyframes/PanoTag/index.tsx +31 -12
- package/resources/Player/modules/keyframes/Prompter/index.tsx +2 -1
- package/resources/react/index.tsx +2 -2
- package/resources/shared-utils/AduioLike.ts +108 -0
- package/resources/typings/VreoUnit.ts +15 -0
- package/stylesheets/default.css +25 -4
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Subscribe } from '@realsee/five'
|
|
2
|
+
import { requestAnimationFrameInterval } from './animationFrame'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 模拟 `<Audio>` 事件。
|
|
6
|
+
*/
|
|
7
|
+
export type AudioLikeEvent = {
|
|
8
|
+
// 播放
|
|
9
|
+
play: () => void
|
|
10
|
+
// 语音状态 播放 -> 暂停
|
|
11
|
+
pause: () => void
|
|
12
|
+
// 语音时间刷新
|
|
13
|
+
timeupdate: () => void
|
|
14
|
+
// 播放
|
|
15
|
+
ended: () => void
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 模拟 `<Audio>` 功能:没有音频,但执行逻辑跟 `<Audio>` 相似。
|
|
21
|
+
*/
|
|
22
|
+
export class AudioLike extends Subscribe<AudioLikeEvent> {
|
|
23
|
+
private $timestamp = 0
|
|
24
|
+
private $currentTime = 0
|
|
25
|
+
private $duration = 0
|
|
26
|
+
private stopInterval?: () => void
|
|
27
|
+
muted = false
|
|
28
|
+
src = ''
|
|
29
|
+
|
|
30
|
+
setAttribute(name: string, value: string) {
|
|
31
|
+
// nothing todo
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
constructor({ duration }: { duration?: number } = {}) {
|
|
35
|
+
super()
|
|
36
|
+
if (duration) {
|
|
37
|
+
this.$duration = duration
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
play() {
|
|
42
|
+
if (this.$timestamp === 0) {
|
|
43
|
+
this.$timestamp = performance.now()
|
|
44
|
+
}
|
|
45
|
+
if (this.$currentTime === this.$duration) {
|
|
46
|
+
this.$currentTime = 0
|
|
47
|
+
}
|
|
48
|
+
this.stopInterval = requestAnimationFrameInterval(() => this.requestAnimationFrameLoop())
|
|
49
|
+
this.emit('play')
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
pause() {
|
|
53
|
+
if (this.stopInterval) {
|
|
54
|
+
this.stopInterval()
|
|
55
|
+
this.emit('pause')
|
|
56
|
+
this.stopInterval = undefined
|
|
57
|
+
}
|
|
58
|
+
this.$timestamp = 0
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
requestAnimationFrameLoop() {
|
|
62
|
+
const now = performance.now()
|
|
63
|
+
this.$currentTime = now - this.$timestamp
|
|
64
|
+
this.emit('timeupdate')
|
|
65
|
+
if (this.$currentTime >= this.$duration - 10) {
|
|
66
|
+
this.$currentTime = this.$duration
|
|
67
|
+
this.pause()
|
|
68
|
+
this.emit('ended')
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
get currentTime() {
|
|
73
|
+
return this.$currentTime / 1000
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
set currentTime(time: number) {
|
|
77
|
+
this.$currentTime = time
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
get duration() {
|
|
81
|
+
return this.$duration
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
set duration(duration: number) {
|
|
85
|
+
this.pause()
|
|
86
|
+
this.$duration = duration
|
|
87
|
+
this.$timestamp = 0
|
|
88
|
+
this.$currentTime = 0
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
get ended() {
|
|
92
|
+
return this.$currentTime === this.$duration
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
get paused() {
|
|
96
|
+
return !this.stopInterval
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
addEventListener(evtName: keyof AudioLikeEvent, callback: () => void, useCapture = false) {
|
|
100
|
+
this.on(evtName, callback)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
removeEventListener(evtName: keyof AudioLikeEvent, callback: () => void, useCapture = false) {
|
|
104
|
+
this.off(evtName, callback)
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default AudioLike
|
|
@@ -208,8 +208,23 @@ export enum PanoTagEnum {
|
|
|
208
208
|
Image = 'Image',
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
+
/**
|
|
212
|
+
* 标签样式种类
|
|
213
|
+
*/
|
|
214
|
+
export enum PanoTagStyleEnum {
|
|
215
|
+
/**
|
|
216
|
+
* 生长动画:默认值
|
|
217
|
+
*/
|
|
218
|
+
Growth = 'Growth',
|
|
219
|
+
/**
|
|
220
|
+
* 展开动画
|
|
221
|
+
*/
|
|
222
|
+
Expand = 'Expand',
|
|
223
|
+
}
|
|
224
|
+
|
|
211
225
|
export type PanoTagData = {
|
|
212
226
|
type: PanoTagEnum
|
|
227
|
+
style: PanoTagStyleEnum
|
|
213
228
|
text: string
|
|
214
229
|
vertex: Vertex
|
|
215
230
|
imgUrl?: string
|
package/stylesheets/default.css
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
5
|
-
width:
|
|
6
|
-
height:
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
7
|
pointer-events: none;
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
position: fixed;
|
|
32
32
|
bottom: 0;
|
|
33
33
|
left: 0;
|
|
34
|
-
width:
|
|
34
|
+
width: 100%;
|
|
35
35
|
height: 150px;
|
|
36
36
|
color: white;
|
|
37
37
|
transition: transform 0.5s;
|
|
@@ -195,6 +195,27 @@
|
|
|
195
195
|
opacity: 0;
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
.PanoTag--expand {
|
|
199
|
+
transform: translate(-50%, -50%);
|
|
200
|
+
color: white;
|
|
201
|
+
min-width: 150px;
|
|
202
|
+
max-width: 200px;
|
|
203
|
+
margin-top: 4px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.PanoTag--expand .PanoTag-box.PanoTag-box--Text {
|
|
207
|
+
display: flex;
|
|
208
|
+
justify-content: center;
|
|
209
|
+
align-items: center;
|
|
210
|
+
padding-bottom: 4px;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.PanoTag-guideline {
|
|
214
|
+
width: 100%;
|
|
215
|
+
background: linear-gradient(45deg, transparent 20% ,white, transparent 80%);
|
|
216
|
+
height: 3px;
|
|
217
|
+
}
|
|
218
|
+
|
|
198
219
|
.PanoTag--notHidden {
|
|
199
220
|
opacity: 1;
|
|
200
221
|
}
|
|
@@ -582,7 +603,7 @@
|
|
|
582
603
|
position: relative;
|
|
583
604
|
}
|
|
584
605
|
|
|
585
|
-
@media only screen and (min-width:
|
|
606
|
+
@media only screen and (min-width: 1080px) {
|
|
586
607
|
.vreo-PopUp-inner {
|
|
587
608
|
width: 678px;
|
|
588
609
|
height: 620px;
|