@ericchen1990/pano-view 2.2.2 → 2.4.0
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 +355 -3
- package/README.zh-CN.md +321 -2
- package/dist/index.cjs +4021 -798
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +342 -188
- package/dist/index.d.ts +342 -188
- package/dist/index.mjs +3700 -460
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
package/dist/index.d.mts
CHANGED
|
@@ -127,6 +127,25 @@ type PanoramaPointerEvent = {
|
|
|
127
127
|
clientY: number;
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
+
type BackgroundAudioSnapshot = {
|
|
131
|
+
ready: boolean;
|
|
132
|
+
playing: boolean;
|
|
133
|
+
blocked: boolean;
|
|
134
|
+
ended: boolean;
|
|
135
|
+
muted: boolean;
|
|
136
|
+
volume: number;
|
|
137
|
+
};
|
|
138
|
+
type BackgroundAudioController = {
|
|
139
|
+
subscribe: (onStoreChange: () => void) => () => void;
|
|
140
|
+
getSnapshot: () => BackgroundAudioSnapshot;
|
|
141
|
+
play: () => void;
|
|
142
|
+
pause: () => void;
|
|
143
|
+
togglePlay: () => void;
|
|
144
|
+
setVolume: (volume: number) => void;
|
|
145
|
+
setMuted: (muted: boolean) => void;
|
|
146
|
+
toggleMuted: () => void;
|
|
147
|
+
};
|
|
148
|
+
|
|
130
149
|
type KeyboardControlAction = "left" | "right" | "up" | "down" | "zoomIn" | "zoomOut" | "previousScene" | "nextScene" | "reset";
|
|
131
150
|
type KeyboardControlKeys = Partial<Record<KeyboardControlAction, string | readonly string[]>>;
|
|
132
151
|
/** Options for keyboard-driven panorama navigation. */
|
|
@@ -173,6 +192,189 @@ declare function cycleSceneId(scenes: readonly {
|
|
|
173
192
|
*/
|
|
174
193
|
declare function KeyboardControls({ enabled, keys, rotateSpeed, zoomSpeed, shiftMultiplier, invert, fovSpeed, onPreviousScene, onNextScene, }: KeyboardControlsProps): null;
|
|
175
194
|
|
|
195
|
+
type VideoPlaybackState = "playing" | "paused" | "ended" | "blocked";
|
|
196
|
+
type VideoHotspotErrorEvent = {
|
|
197
|
+
id: string;
|
|
198
|
+
source: "poster" | "video";
|
|
199
|
+
error: unknown;
|
|
200
|
+
};
|
|
201
|
+
type VideoHotspotProps = HotspotCommonProps & {
|
|
202
|
+
src: string;
|
|
203
|
+
playing: boolean;
|
|
204
|
+
poster?: string;
|
|
205
|
+
loop?: boolean;
|
|
206
|
+
muted?: boolean;
|
|
207
|
+
volume?: number;
|
|
208
|
+
playsInline?: boolean;
|
|
209
|
+
preload?: "none" | "metadata" | "auto";
|
|
210
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
211
|
+
onPlaybackStateChange?: (state: VideoPlaybackState) => void;
|
|
212
|
+
onPlaybackError?: (error: unknown) => void;
|
|
213
|
+
onEnded?: () => void;
|
|
214
|
+
onError?: (event: VideoHotspotErrorEvent) => void;
|
|
215
|
+
};
|
|
216
|
+
declare function VideoHotspot({ id, src, playing, poster, loop, muted, volume, playsInline, preload, crossOrigin, width, height, opacity, onPlaybackStateChange, onPlaybackError, onEnded, onError, ...anchorProps }: VideoHotspotProps): react.JSX.Element;
|
|
217
|
+
|
|
218
|
+
type PanoVideoSource = {
|
|
219
|
+
src: string;
|
|
220
|
+
type?: string;
|
|
221
|
+
};
|
|
222
|
+
type PanoVideoVariant = {
|
|
223
|
+
id: string;
|
|
224
|
+
label: string;
|
|
225
|
+
poster?: string;
|
|
226
|
+
sources: readonly PanoVideoSource[];
|
|
227
|
+
};
|
|
228
|
+
type PanoVideoTrackKind = "subtitles" | "captions";
|
|
229
|
+
type PanoVideoTrack = {
|
|
230
|
+
/** Defaults to `srcLang`. */
|
|
231
|
+
id?: string;
|
|
232
|
+
src: string;
|
|
233
|
+
srcLang: string;
|
|
234
|
+
label: string;
|
|
235
|
+
kind?: PanoVideoTrackKind;
|
|
236
|
+
default?: boolean;
|
|
237
|
+
};
|
|
238
|
+
type PanoVideoCaptionAppearance = {
|
|
239
|
+
color?: string;
|
|
240
|
+
background?: string;
|
|
241
|
+
fontSize?: number | string;
|
|
242
|
+
fontFamily?: string;
|
|
243
|
+
fontWeight?: CSSProperties["fontWeight"];
|
|
244
|
+
textShadow?: string;
|
|
245
|
+
padding?: string;
|
|
246
|
+
borderRadius?: number | string;
|
|
247
|
+
maxWidth?: number | string;
|
|
248
|
+
bottom?: number | string;
|
|
249
|
+
lineHeight?: number | string;
|
|
250
|
+
};
|
|
251
|
+
type PanoVideoControlsAppearance = {
|
|
252
|
+
background?: string;
|
|
253
|
+
color?: string;
|
|
254
|
+
accent?: string;
|
|
255
|
+
borderRadius?: number | string;
|
|
256
|
+
fontSize?: number | string;
|
|
257
|
+
padding?: string;
|
|
258
|
+
};
|
|
259
|
+
type PanoVideoErrorSource = "poster" | "video" | "track";
|
|
260
|
+
type PanoVideoErrorEvent = {
|
|
261
|
+
source: PanoVideoErrorSource;
|
|
262
|
+
error: unknown;
|
|
263
|
+
};
|
|
264
|
+
type PanoVideoPlaybackSnapshot = {
|
|
265
|
+
ready: boolean;
|
|
266
|
+
playing: boolean;
|
|
267
|
+
blocked: boolean;
|
|
268
|
+
ended: boolean;
|
|
269
|
+
currentTime: number;
|
|
270
|
+
duration: number;
|
|
271
|
+
volume: number;
|
|
272
|
+
/** False when the element ignores `volume` (iOS Safari). Mute still works. */
|
|
273
|
+
volumeAdjustable: boolean;
|
|
274
|
+
muted: boolean;
|
|
275
|
+
playbackRate: number;
|
|
276
|
+
variantId: string;
|
|
277
|
+
variants: readonly PanoVideoVariant[];
|
|
278
|
+
trackId: string | null;
|
|
279
|
+
tracks: readonly PanoVideoTrack[];
|
|
280
|
+
captionText: string;
|
|
281
|
+
captionAppearance: Required<PanoVideoCaptionAppearance>;
|
|
282
|
+
captionsEnabled: boolean;
|
|
283
|
+
playbackRates: readonly number[];
|
|
284
|
+
playbackState: VideoPlaybackState;
|
|
285
|
+
};
|
|
286
|
+
type PanoVideoController = {
|
|
287
|
+
subscribe: (onStoreChange: () => void) => () => void;
|
|
288
|
+
getSnapshot: () => PanoVideoPlaybackSnapshot;
|
|
289
|
+
play: () => Promise<void>;
|
|
290
|
+
pause: () => void;
|
|
291
|
+
togglePlay: () => void;
|
|
292
|
+
seek: (time: number) => void;
|
|
293
|
+
setVolume: (volume: number) => void;
|
|
294
|
+
setMuted: (muted: boolean) => void;
|
|
295
|
+
toggleMuted: () => void;
|
|
296
|
+
setPlaybackRate: (rate: number) => void;
|
|
297
|
+
setVariantId: (id: string) => void;
|
|
298
|
+
setTrackId: (id: string | null) => void;
|
|
299
|
+
setCaptionAppearance: (appearance: Partial<PanoVideoCaptionAppearance>) => void;
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
type WebVRMode = "webxr" | "mobilevr" | "fake";
|
|
303
|
+
type WebVRProfileId = "none" | "cardboard-v1" | "cardboard-v2" | "gear-vr" | "daydream";
|
|
304
|
+
type WebVRProfile = {
|
|
305
|
+
id?: string;
|
|
306
|
+
label?: string;
|
|
307
|
+
/** Vertical field of view for each eye, in degrees. */
|
|
308
|
+
fov: number;
|
|
309
|
+
/** Distance between the eyes, in millimetres. */
|
|
310
|
+
ipdMm: number;
|
|
311
|
+
/** Distance from the display to the headset lens, in millimetres. */
|
|
312
|
+
screenToLensMm?: number;
|
|
313
|
+
/** Radial lens distortion coefficients. Zero disables distortion. */
|
|
314
|
+
k1: number;
|
|
315
|
+
k2: number;
|
|
316
|
+
};
|
|
317
|
+
type WebVRChromeAppearance = {
|
|
318
|
+
background?: CSSProperties["background"];
|
|
319
|
+
color?: CSSProperties["color"];
|
|
320
|
+
accent?: CSSProperties["color"];
|
|
321
|
+
borderRadius?: CSSProperties["borderRadius"];
|
|
322
|
+
fontSize?: CSSProperties["fontSize"];
|
|
323
|
+
setupTitle?: ReactNode;
|
|
324
|
+
};
|
|
325
|
+
type WebVRChrome = boolean | WebVRChromeAppearance;
|
|
326
|
+
type WebVRProps = {
|
|
327
|
+
/** Mount the built-in Enter / Exit / Setup chrome. Defaults to true. */
|
|
328
|
+
chrome?: WebVRChrome;
|
|
329
|
+
/** Enable the phone stereoscopic fallback. Defaults to true. */
|
|
330
|
+
mobileVr?: boolean;
|
|
331
|
+
/** Treat desktop device-orientation sensors as MobileVR. Defaults to false. */
|
|
332
|
+
desktopSupport?: boolean;
|
|
333
|
+
/** Allow a mouse-driven stereoscopic desktop simulation. Defaults to true. */
|
|
334
|
+
fakeSupport?: boolean;
|
|
335
|
+
/** Physical diagonal screen size in inches, or automatic detection. */
|
|
336
|
+
screensize?: number | "auto";
|
|
337
|
+
/** Headset preset or a custom lens profile. */
|
|
338
|
+
profile?: WebVRProfileId | WebVRProfile;
|
|
339
|
+
/** Show a center reticle in VR. Defaults to true. */
|
|
340
|
+
cursor?: boolean;
|
|
341
|
+
/**
|
|
342
|
+
* Milliseconds to keep looking at a hotspot before a gaze click.
|
|
343
|
+
* Defaults to 1500. Set to 0 to disable auto-click.
|
|
344
|
+
*/
|
|
345
|
+
cursorDwellMs?: number;
|
|
346
|
+
/**
|
|
347
|
+
* Keep the display awake while MobileVR or simulated VR is active.
|
|
348
|
+
* Uses the Screen Wake Lock API when available, otherwise a looping
|
|
349
|
+
* hidden video. Defaults to true.
|
|
350
|
+
*/
|
|
351
|
+
wakelock?: boolean;
|
|
352
|
+
/**
|
|
353
|
+
* Lock the mouse in simulated desktop VR so movement looks around with
|
|
354
|
+
* no visible cursor. Click the view to re-lock after Escape. Defaults to true.
|
|
355
|
+
*/
|
|
356
|
+
mousePointerLock?: boolean;
|
|
357
|
+
onAvailable?: () => void;
|
|
358
|
+
onUnavailable?: () => void;
|
|
359
|
+
onEnterVR?: (mode: WebVRMode) => void;
|
|
360
|
+
onExitVR?: (mode: WebVRMode) => void;
|
|
361
|
+
onDenied?: (error?: unknown) => void;
|
|
362
|
+
onUnknownDevice?: () => void;
|
|
363
|
+
};
|
|
364
|
+
type WebVRHandle = {
|
|
365
|
+
enterVR: () => Promise<boolean>;
|
|
366
|
+
exitVR: () => Promise<void>;
|
|
367
|
+
toggleVR: () => Promise<boolean>;
|
|
368
|
+
isAvailable: () => boolean;
|
|
369
|
+
isEnabled: () => boolean;
|
|
370
|
+
getMode: () => WebVRMode | null;
|
|
371
|
+
requestPermission: () => Promise<boolean>;
|
|
372
|
+
};
|
|
373
|
+
type WebVRSettings = {
|
|
374
|
+
screensize: number | "auto";
|
|
375
|
+
profileId: WebVRProfileId;
|
|
376
|
+
};
|
|
377
|
+
|
|
176
378
|
type PanoViewerState = {
|
|
177
379
|
/** Horizontal look angle in degrees. Positive values look right. */
|
|
178
380
|
yaw: number;
|
|
@@ -189,11 +391,44 @@ type PanoViewerHandle = {
|
|
|
189
391
|
getView: () => PanoViewerState;
|
|
190
392
|
setView: (view: Partial<PanoViewerState>, options?: SetPanoViewerOptions) => void;
|
|
191
393
|
reset: () => void;
|
|
394
|
+
enterFullscreen: () => Promise<void>;
|
|
395
|
+
exitFullscreen: () => Promise<void>;
|
|
396
|
+
toggleFullscreen: () => Promise<void>;
|
|
397
|
+
isFullscreen: () => boolean;
|
|
398
|
+
setScene: (id: string) => boolean;
|
|
399
|
+
nextScene: () => boolean;
|
|
400
|
+
previousScene: () => boolean;
|
|
401
|
+
getActiveSceneId: () => string | null;
|
|
402
|
+
getSceneIds: () => readonly string[];
|
|
403
|
+
isSceneTransitioning: () => boolean;
|
|
404
|
+
enterVR: () => Promise<boolean>;
|
|
405
|
+
exitVR: () => Promise<void>;
|
|
406
|
+
toggleVR: () => Promise<boolean>;
|
|
407
|
+
isVRAvailable: () => boolean;
|
|
408
|
+
isVREnabled: () => boolean;
|
|
409
|
+
getVRMode: () => WebVRMode | null;
|
|
410
|
+
requestVRPermission: () => Promise<boolean>;
|
|
411
|
+
getVideo: () => PanoVideoController | null;
|
|
412
|
+
subscribeVideo: (onStoreChange: () => void) => () => void;
|
|
413
|
+
playVideo: () => Promise<void>;
|
|
414
|
+
pauseVideo: () => void;
|
|
415
|
+
toggleVideo: () => void;
|
|
416
|
+
seekVideo: (time: number) => void;
|
|
417
|
+
setVideoVolume: (volume: number) => void;
|
|
418
|
+
setVideoMuted: (muted: boolean) => void;
|
|
419
|
+
toggleVideoMuted: () => void;
|
|
420
|
+
getBackgroundAudio: () => BackgroundAudioController | null;
|
|
421
|
+
subscribeBackgroundAudio: (onStoreChange: () => void) => () => void;
|
|
422
|
+
playBackgroundAudio: () => Promise<void>;
|
|
423
|
+
pauseBackgroundAudio: () => void;
|
|
424
|
+
toggleBackgroundAudio: () => void;
|
|
425
|
+
setBackgroundAudioVolume: (volume: number) => void;
|
|
426
|
+
setBackgroundAudioMuted: (muted: boolean) => void;
|
|
427
|
+
toggleBackgroundAudioMuted: () => void;
|
|
192
428
|
/** @deprecated Control an AutoRotate component's enabled prop instead. */
|
|
193
429
|
startAutoRotate: () => void;
|
|
194
430
|
/** @deprecated Control an AutoRotate component's enabled prop instead. */
|
|
195
431
|
stopAutoRotate: () => void;
|
|
196
|
-
toggleFullscreen: () => Promise<void>;
|
|
197
432
|
};
|
|
198
433
|
type MouseControlButton = "left" | "middle" | "right";
|
|
199
434
|
/** Options for the default mouse control channel (also MouseControls props). */
|
|
@@ -519,6 +754,73 @@ type AutoRotateProps = {
|
|
|
519
754
|
*/
|
|
520
755
|
declare function AutoRotate({ enabled, speed, acceleration, startDelay, }: AutoRotateProps): null;
|
|
521
756
|
|
|
757
|
+
type AudioPlaybackState = "playing" | "paused" | "ended" | "blocked";
|
|
758
|
+
type AudioHotspotErrorEvent = {
|
|
759
|
+
id: string;
|
|
760
|
+
error: unknown;
|
|
761
|
+
};
|
|
762
|
+
type AudioHotspotProps = HotspotCommonProps & {
|
|
763
|
+
src: string | string[];
|
|
764
|
+
playing: boolean;
|
|
765
|
+
loop?: boolean;
|
|
766
|
+
muted?: boolean;
|
|
767
|
+
volume?: number;
|
|
768
|
+
/** Degrees of look-away before the source is silent. Defaults to 360 (no look attenuation). */
|
|
769
|
+
range?: number;
|
|
770
|
+
pauseWhenHidden?: boolean;
|
|
771
|
+
/** Optional stopped-state image. When omitted, a built-in speaker icon is used. */
|
|
772
|
+
icon?: string;
|
|
773
|
+
/** Optional playing-state image. Falls back to `icon`, then the built-in playing icon. */
|
|
774
|
+
playingIcon?: string;
|
|
775
|
+
/** When false, no visual marker is rendered. Audio still plays. Defaults to true. */
|
|
776
|
+
marker?: boolean;
|
|
777
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
778
|
+
onPlaybackStateChange?: (state: AudioPlaybackState) => void;
|
|
779
|
+
onPlaybackError?: (error: unknown) => void;
|
|
780
|
+
onEnded?: () => void;
|
|
781
|
+
onError?: (event: AudioHotspotErrorEvent) => void;
|
|
782
|
+
};
|
|
783
|
+
declare function AudioHotspot({ id, src, playing, loop, muted, volume, range, pauseWhenHidden, icon, playingIcon, marker, crossOrigin, width, height, opacity, onPlaybackStateChange, onPlaybackError, onEnded, onError, ...anchorProps }: AudioHotspotProps): react.JSX.Element;
|
|
784
|
+
|
|
785
|
+
type BackgroundAudioSource = string | readonly string[];
|
|
786
|
+
type BackgroundAudioErrorEvent = {
|
|
787
|
+
error: unknown;
|
|
788
|
+
};
|
|
789
|
+
type BackgroundAudioProps = {
|
|
790
|
+
/** Shared tour track when `sources` is omitted, or fallback when a scene has no entry. */
|
|
791
|
+
src?: BackgroundAudioSource;
|
|
792
|
+
/** Per-scene tracks keyed by `Scene.id`. Requires `sceneId`. */
|
|
793
|
+
sources?: Readonly<Record<string, BackgroundAudioSource>>;
|
|
794
|
+
/** Current scene id. Required when `sources` is set. */
|
|
795
|
+
sceneId?: string;
|
|
796
|
+
/**
|
|
797
|
+
* Controlled playing state. When provided, the parent owns play/pause.
|
|
798
|
+
* When omitted, the component manages its own state and imperative
|
|
799
|
+
* `playBackgroundAudio` / `pauseBackgroundAudio` work directly.
|
|
800
|
+
*/
|
|
801
|
+
playing?: boolean;
|
|
802
|
+
/** Initial playing state when `playing` is omitted. Defaults to false. */
|
|
803
|
+
defaultPlaying?: boolean;
|
|
804
|
+
/** Defaults to true. */
|
|
805
|
+
loop?: boolean;
|
|
806
|
+
muted?: boolean;
|
|
807
|
+
volume?: number;
|
|
808
|
+
pauseWhenHidden?: boolean;
|
|
809
|
+
/** Crossfade duration when the resolved track changes. Defaults to 400; 0 is a hard cut. */
|
|
810
|
+
fadeMs?: number;
|
|
811
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
812
|
+
onPlaybackStateChange?: (state: AudioPlaybackState) => void;
|
|
813
|
+
onPlaybackError?: (error: unknown) => void;
|
|
814
|
+
onEnded?: () => void;
|
|
815
|
+
onError?: (event: BackgroundAudioErrorEvent) => void;
|
|
816
|
+
};
|
|
817
|
+
/**
|
|
818
|
+
* Adds a non-spatial soundtrack to the nearest PanoViewer. Render one instance
|
|
819
|
+
* as a child of PanoViewer, alongside Scenes or a panorama source — not inside
|
|
820
|
+
* renderHotspots.
|
|
821
|
+
*/
|
|
822
|
+
declare function BackgroundAudio({ src, sources, sceneId, playing: controlledPlaying, defaultPlaying, loop, muted, volume, pauseWhenHidden, fadeMs, crossOrigin, onPlaybackStateChange, onPlaybackError, onEnded, onError, }: BackgroundAudioProps): null;
|
|
823
|
+
|
|
522
824
|
declare const PANO_FILTER_PRESETS: readonly ["none", "grayscale", "sepia", "vintage", "cool", "warm", "pencil", "coloredPencil", "crayon", "watercolor", "cartoon", "crosshatch"];
|
|
523
825
|
type PanoFilterPreset = (typeof PANO_FILTER_PRESETS)[number];
|
|
524
826
|
|
|
@@ -578,82 +880,6 @@ type GyroProps = {
|
|
|
578
880
|
*/
|
|
579
881
|
declare const Gyro: react.ForwardRefExoticComponent<GyroProps & react.RefAttributes<GyroHandle>>;
|
|
580
882
|
|
|
581
|
-
type WebVRMode = "webxr" | "mobilevr" | "fake";
|
|
582
|
-
type WebVRProfileId = "none" | "cardboard-v1" | "cardboard-v2" | "gear-vr" | "daydream";
|
|
583
|
-
type WebVRProfile = {
|
|
584
|
-
id?: string;
|
|
585
|
-
label?: string;
|
|
586
|
-
/** Vertical field of view for each eye, in degrees. */
|
|
587
|
-
fov: number;
|
|
588
|
-
/** Distance between the eyes, in millimetres. */
|
|
589
|
-
ipdMm: number;
|
|
590
|
-
/** Distance from the display to the headset lens, in millimetres. */
|
|
591
|
-
screenToLensMm?: number;
|
|
592
|
-
/** Radial lens distortion coefficients. Zero disables distortion. */
|
|
593
|
-
k1: number;
|
|
594
|
-
k2: number;
|
|
595
|
-
};
|
|
596
|
-
type WebVRChromeAppearance = {
|
|
597
|
-
background?: CSSProperties["background"];
|
|
598
|
-
color?: CSSProperties["color"];
|
|
599
|
-
accent?: CSSProperties["color"];
|
|
600
|
-
borderRadius?: CSSProperties["borderRadius"];
|
|
601
|
-
fontSize?: CSSProperties["fontSize"];
|
|
602
|
-
setupTitle?: ReactNode;
|
|
603
|
-
};
|
|
604
|
-
type WebVRChrome = boolean | WebVRChromeAppearance;
|
|
605
|
-
type WebVRProps = {
|
|
606
|
-
/** Mount the built-in Enter / Exit / Setup chrome. Defaults to true. */
|
|
607
|
-
chrome?: WebVRChrome;
|
|
608
|
-
/** Enable the phone stereoscopic fallback. Defaults to true. */
|
|
609
|
-
mobileVr?: boolean;
|
|
610
|
-
/** Treat desktop device-orientation sensors as MobileVR. Defaults to false. */
|
|
611
|
-
desktopSupport?: boolean;
|
|
612
|
-
/** Allow a mouse-driven stereoscopic desktop simulation. Defaults to true. */
|
|
613
|
-
fakeSupport?: boolean;
|
|
614
|
-
/** Physical diagonal screen size in inches, or automatic detection. */
|
|
615
|
-
screensize?: number | "auto";
|
|
616
|
-
/** Headset preset or a custom lens profile. */
|
|
617
|
-
profile?: WebVRProfileId | WebVRProfile;
|
|
618
|
-
/** Show a center reticle in VR. Defaults to true. */
|
|
619
|
-
cursor?: boolean;
|
|
620
|
-
/**
|
|
621
|
-
* Milliseconds to keep looking at a hotspot before a gaze click.
|
|
622
|
-
* Defaults to 1500. Set to 0 to disable auto-click.
|
|
623
|
-
*/
|
|
624
|
-
cursorDwellMs?: number;
|
|
625
|
-
/**
|
|
626
|
-
* Keep the display awake while MobileVR or simulated VR is active.
|
|
627
|
-
* Uses the Screen Wake Lock API when available, otherwise a looping
|
|
628
|
-
* hidden video. Defaults to true.
|
|
629
|
-
*/
|
|
630
|
-
wakelock?: boolean;
|
|
631
|
-
/**
|
|
632
|
-
* Lock the mouse in simulated desktop VR so movement looks around with
|
|
633
|
-
* no visible cursor. Click the view to re-lock after Escape. Defaults to true.
|
|
634
|
-
*/
|
|
635
|
-
mousePointerLock?: boolean;
|
|
636
|
-
onAvailable?: () => void;
|
|
637
|
-
onUnavailable?: () => void;
|
|
638
|
-
onEnterVR?: (mode: WebVRMode) => void;
|
|
639
|
-
onExitVR?: (mode: WebVRMode) => void;
|
|
640
|
-
onDenied?: (error?: unknown) => void;
|
|
641
|
-
onUnknownDevice?: () => void;
|
|
642
|
-
};
|
|
643
|
-
type WebVRHandle = {
|
|
644
|
-
enterVR: () => Promise<boolean>;
|
|
645
|
-
exitVR: () => Promise<void>;
|
|
646
|
-
toggleVR: () => Promise<boolean>;
|
|
647
|
-
isAvailable: () => boolean;
|
|
648
|
-
isEnabled: () => boolean;
|
|
649
|
-
getMode: () => WebVRMode | null;
|
|
650
|
-
requestPermission: () => Promise<boolean>;
|
|
651
|
-
};
|
|
652
|
-
type WebVRSettings = {
|
|
653
|
-
screensize: number | "auto";
|
|
654
|
-
profileId: WebVRProfileId;
|
|
655
|
-
};
|
|
656
|
-
|
|
657
883
|
declare const WebVR: react.ForwardRefExoticComponent<WebVRProps & react.RefAttributes<WebVRHandle>>;
|
|
658
884
|
|
|
659
885
|
declare const DEFAULT_WEBVR_CHROME_APPEARANCE: Required<Omit<WebVRChromeAppearance, "setupTitle">>;
|
|
@@ -812,113 +1038,6 @@ type SphereProps = {
|
|
|
812
1038
|
};
|
|
813
1039
|
declare function Sphere({ src, previewUrl, yawOffset, onReady, onLoad, onError, onPreviewError, visible, }: SphereProps): react.JSX.Element | null;
|
|
814
1040
|
|
|
815
|
-
type VideoPlaybackState = "playing" | "paused" | "ended" | "blocked";
|
|
816
|
-
type VideoHotspotErrorEvent = {
|
|
817
|
-
id: string;
|
|
818
|
-
source: "poster" | "video";
|
|
819
|
-
error: unknown;
|
|
820
|
-
};
|
|
821
|
-
type VideoHotspotProps = HotspotCommonProps & {
|
|
822
|
-
src: string;
|
|
823
|
-
playing: boolean;
|
|
824
|
-
poster?: string;
|
|
825
|
-
loop?: boolean;
|
|
826
|
-
muted?: boolean;
|
|
827
|
-
volume?: number;
|
|
828
|
-
playsInline?: boolean;
|
|
829
|
-
preload?: "none" | "metadata" | "auto";
|
|
830
|
-
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
831
|
-
onPlaybackStateChange?: (state: VideoPlaybackState) => void;
|
|
832
|
-
onPlaybackError?: (error: unknown) => void;
|
|
833
|
-
onEnded?: () => void;
|
|
834
|
-
onError?: (event: VideoHotspotErrorEvent) => void;
|
|
835
|
-
};
|
|
836
|
-
declare function VideoHotspot({ id, src, playing, poster, loop, muted, volume, playsInline, preload, crossOrigin, width, height, opacity, onPlaybackStateChange, onPlaybackError, onEnded, onError, ...anchorProps }: VideoHotspotProps): react.JSX.Element;
|
|
837
|
-
|
|
838
|
-
type PanoVideoSource = {
|
|
839
|
-
src: string;
|
|
840
|
-
type?: string;
|
|
841
|
-
};
|
|
842
|
-
type PanoVideoVariant = {
|
|
843
|
-
id: string;
|
|
844
|
-
label: string;
|
|
845
|
-
poster?: string;
|
|
846
|
-
sources: readonly PanoVideoSource[];
|
|
847
|
-
};
|
|
848
|
-
type PanoVideoTrackKind = "subtitles" | "captions";
|
|
849
|
-
type PanoVideoTrack = {
|
|
850
|
-
/** Defaults to `srcLang`. */
|
|
851
|
-
id?: string;
|
|
852
|
-
src: string;
|
|
853
|
-
srcLang: string;
|
|
854
|
-
label: string;
|
|
855
|
-
kind?: PanoVideoTrackKind;
|
|
856
|
-
default?: boolean;
|
|
857
|
-
};
|
|
858
|
-
type PanoVideoCaptionAppearance = {
|
|
859
|
-
color?: string;
|
|
860
|
-
background?: string;
|
|
861
|
-
fontSize?: number | string;
|
|
862
|
-
fontFamily?: string;
|
|
863
|
-
fontWeight?: CSSProperties["fontWeight"];
|
|
864
|
-
textShadow?: string;
|
|
865
|
-
padding?: string;
|
|
866
|
-
borderRadius?: number | string;
|
|
867
|
-
maxWidth?: number | string;
|
|
868
|
-
bottom?: number | string;
|
|
869
|
-
lineHeight?: number | string;
|
|
870
|
-
};
|
|
871
|
-
type PanoVideoControlsAppearance = {
|
|
872
|
-
background?: string;
|
|
873
|
-
color?: string;
|
|
874
|
-
accent?: string;
|
|
875
|
-
borderRadius?: number | string;
|
|
876
|
-
fontSize?: number | string;
|
|
877
|
-
padding?: string;
|
|
878
|
-
};
|
|
879
|
-
type PanoVideoErrorSource = "poster" | "video" | "track";
|
|
880
|
-
type PanoVideoErrorEvent = {
|
|
881
|
-
source: PanoVideoErrorSource;
|
|
882
|
-
error: unknown;
|
|
883
|
-
};
|
|
884
|
-
type PanoVideoPlaybackSnapshot = {
|
|
885
|
-
ready: boolean;
|
|
886
|
-
playing: boolean;
|
|
887
|
-
blocked: boolean;
|
|
888
|
-
ended: boolean;
|
|
889
|
-
currentTime: number;
|
|
890
|
-
duration: number;
|
|
891
|
-
volume: number;
|
|
892
|
-
/** False when the element ignores `volume` (iOS Safari). Mute still works. */
|
|
893
|
-
volumeAdjustable: boolean;
|
|
894
|
-
muted: boolean;
|
|
895
|
-
playbackRate: number;
|
|
896
|
-
variantId: string;
|
|
897
|
-
variants: readonly PanoVideoVariant[];
|
|
898
|
-
trackId: string | null;
|
|
899
|
-
tracks: readonly PanoVideoTrack[];
|
|
900
|
-
captionText: string;
|
|
901
|
-
captionAppearance: Required<PanoVideoCaptionAppearance>;
|
|
902
|
-
captionsEnabled: boolean;
|
|
903
|
-
playbackRates: readonly number[];
|
|
904
|
-
playbackState: VideoPlaybackState;
|
|
905
|
-
};
|
|
906
|
-
type PanoVideoController = {
|
|
907
|
-
subscribe: (onStoreChange: () => void) => () => void;
|
|
908
|
-
getSnapshot: () => PanoVideoPlaybackSnapshot;
|
|
909
|
-
play: () => Promise<void>;
|
|
910
|
-
pause: () => void;
|
|
911
|
-
togglePlay: () => void;
|
|
912
|
-
seek: (time: number) => void;
|
|
913
|
-
setVolume: (volume: number) => void;
|
|
914
|
-
setMuted: (muted: boolean) => void;
|
|
915
|
-
toggleMuted: () => void;
|
|
916
|
-
setPlaybackRate: (rate: number) => void;
|
|
917
|
-
setVariantId: (id: string) => void;
|
|
918
|
-
setTrackId: (id: string | null) => void;
|
|
919
|
-
setCaptionAppearance: (appearance: Partial<PanoVideoCaptionAppearance>) => void;
|
|
920
|
-
};
|
|
921
|
-
|
|
922
1041
|
type PanoVideoProps = {
|
|
923
1042
|
/** Single-file shortcut when `variants` is omitted. */
|
|
924
1043
|
src?: string;
|
|
@@ -1084,7 +1203,19 @@ type SceneTransitionErrorEvent = {
|
|
|
1084
1203
|
};
|
|
1085
1204
|
type ScenesProps = {
|
|
1086
1205
|
scenes: readonly Scene[];
|
|
1087
|
-
|
|
1206
|
+
/**
|
|
1207
|
+
* Controlled scene id. When provided, the parent owns the active scene.
|
|
1208
|
+
* Imperative `setScene` / `nextScene` / `previousScene` will call
|
|
1209
|
+
* `onActiveSceneIdChange` so the parent can update its state.
|
|
1210
|
+
*/
|
|
1211
|
+
activeSceneId?: string;
|
|
1212
|
+
/**
|
|
1213
|
+
* Uncontrolled initial scene id. Used when `activeSceneId` is omitted.
|
|
1214
|
+
* Imperative calls update the internal state directly.
|
|
1215
|
+
*/
|
|
1216
|
+
defaultActiveSceneId?: string;
|
|
1217
|
+
/** Called when imperative scene methods request a scene change in controlled mode. */
|
|
1218
|
+
onActiveSceneIdChange?: (id: string) => void;
|
|
1088
1219
|
transition?: SceneTransition;
|
|
1089
1220
|
/** Rendered only after a scene has finished transitioning in. */
|
|
1090
1221
|
renderHotspots?: (scene: Scene) => ReactNode;
|
|
@@ -1097,7 +1228,16 @@ type ScenesProps = {
|
|
|
1097
1228
|
/** Maximum physical-pixel area of the outgoing GPU snapshot. */
|
|
1098
1229
|
snapshotMaxPixels?: number;
|
|
1099
1230
|
};
|
|
1100
|
-
declare function Scenes({ maxTextureMemoryMb, maxConcurrentTileLoads, ...
|
|
1231
|
+
declare function Scenes({ maxTextureMemoryMb, maxConcurrentTileLoads, activeSceneId: controlledId, defaultActiveSceneId, onActiveSceneIdChange, scenes, ...rest }: ScenesProps): react.JSX.Element;
|
|
1232
|
+
|
|
1233
|
+
type ScenesController = {
|
|
1234
|
+
setScene: (id: string) => boolean;
|
|
1235
|
+
nextScene: () => boolean;
|
|
1236
|
+
previousScene: () => boolean;
|
|
1237
|
+
getActiveSceneId: () => string;
|
|
1238
|
+
getSceneIds: () => readonly string[];
|
|
1239
|
+
isTransitioning: () => boolean;
|
|
1240
|
+
};
|
|
1101
1241
|
|
|
1102
1242
|
type ImageHotspotProps = HotspotCommonProps & {
|
|
1103
1243
|
src: string;
|
|
@@ -1379,6 +1519,20 @@ type VideoHotspotDefinition = PointHotspotDefinitionBase & {
|
|
|
1379
1519
|
preload?: "none" | "metadata" | "auto";
|
|
1380
1520
|
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1381
1521
|
};
|
|
1522
|
+
type AudioHotspotDefinition = PointHotspotDefinitionBase & {
|
|
1523
|
+
type: "audio";
|
|
1524
|
+
src: string | string[];
|
|
1525
|
+
playing?: boolean;
|
|
1526
|
+
loop?: boolean;
|
|
1527
|
+
muted?: boolean;
|
|
1528
|
+
volume?: number;
|
|
1529
|
+
pauseWhenHidden?: boolean;
|
|
1530
|
+
range?: number;
|
|
1531
|
+
icon?: string;
|
|
1532
|
+
playingIcon?: string;
|
|
1533
|
+
marker?: boolean;
|
|
1534
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
1535
|
+
};
|
|
1382
1536
|
type TextHotspotDefinition = PointHotspotDefinitionBase & TextHotspotStyle & {
|
|
1383
1537
|
type: "text";
|
|
1384
1538
|
text: string;
|
|
@@ -1415,8 +1569,8 @@ type PolylineHotspotDefinition = HotspotDefinitionBase & {
|
|
|
1415
1569
|
strokeDashSize?: number;
|
|
1416
1570
|
strokeGapSize?: number;
|
|
1417
1571
|
};
|
|
1418
|
-
type PointHotspotDefinition = ImageHotspotDefinition | GraphicHotspotDefinition | SequenceHotspotDefinition | VideoHotspotDefinition | TextHotspotDefinition | IframeHotspotDefinition;
|
|
1572
|
+
type PointHotspotDefinition = ImageHotspotDefinition | GraphicHotspotDefinition | SequenceHotspotDefinition | VideoHotspotDefinition | AudioHotspotDefinition | TextHotspotDefinition | IframeHotspotDefinition;
|
|
1419
1573
|
/** A serializable, discriminated hotspot collection item. */
|
|
1420
1574
|
type HotspotDefinition = PointHotspotDefinition | PolygonHotspotDefinition | PolylineHotspotDefinition;
|
|
1421
1575
|
|
|
1422
|
-
export { type ArrowGraphic, AutoRotate, type AutoRotateProps, type CircleGraphic, type CubeFaceCode, DEFAULT_HOTSPOT_TOOLTIP_APPEARANCE, DEFAULT_HOTSPOT_TOOLTIP_OFFSET, DEFAULT_PANO_CURSORS, DEFAULT_PANO_VIDEO_CAPTION_APPEARANCE, DEFAULT_PANO_VIDEO_CONTROLS_APPEARANCE, DEFAULT_PANO_VIDEO_PLAYBACK_RATES, DEFAULT_WEBVR_CHROME_APPEARANCE, DEFAULT_WEBVR_CURSOR_DWELL_MS, type DiamondGraphic, type GraphicDefinition, GraphicHotspot, type GraphicHotspotDefinition, type GraphicHotspotProps, Gyro, type GyroHandle, type GyroProps, type GyroTouchMode, type HotspotCommonProps, type HotspotDefinition, type HotspotDefinitionBase, type HotspotDragEvent, type HotspotInputSource, type HotspotInteractionEvent, type HotspotMode, type HotspotPointerEvents, type HotspotPosition, type HotspotScaleMode, type HotspotTooltipAppearance, type HotspotTooltipContent, type HotspotTooltipPlacement, type HotspotTooltipTrigger, IframeHotspot, type IframeHotspotDefinition, type IframeHotspotProps, type IframePointerPolicy, ImageHotspot, type ImageHotspotDefinition, type ImageHotspotProps, type KeyboardControlAction, type KeyboardControlKeys, KeyboardControls, type KeyboardControlsProps, MAX_HOTSPOT_PITCH, MIN_PANO_CONTEXT_MENU_BACKGROUND_OPACITY, type MouseControlButton, MouseControls, type MouseControlsOptions, type MouseControlsProps, PANO_FILTER_PRESETS, PanoContextMenu, type PanoContextMenuActionItem, type PanoContextMenuAppearance, type PanoContextMenuEntry, type PanoContextMenuItem, type PanoContextMenuPresetActions, type PanoContextMenuPresetId, type PanoContextMenuPresetRef, type PanoContextMenuPresets, type PanoContextMenuProps, type PanoContextMenuRenderProps, type PanoContextMenuSelectContext, type PanoContextMenuSeparatorItem, type PanoCursor, type PanoCursors, type PanoEventBus, type PanoEventListener, type PanoEventMap, type PanoEventType, PanoEvents, type PanoEventsProps, PanoFilter, type PanoFilterPreset, type PanoFilterProps, type PanoResizeEvent, PanoVideo, type PanoVideoCaptionAppearance, type PanoVideoController, PanoVideoControls, type PanoVideoControlsAppearance, type PanoVideoControlsProps, type PanoVideoErrorEvent, type PanoVideoErrorSource, type PanoVideoPlaybackSnapshot, type PanoVideoProps, type PanoVideoSource, type PanoVideoTrack, type PanoVideoTrackKind, type PanoVideoVariant, PanoViewer, type PanoViewerHandle, type PanoViewerProps, type PanoViewerState, type PanoWheelEvent, type PanoramaControlsOptions, type PanoramaPointerEvent, type PointHotspotDefinition, type PointHotspotDefinitionBase, PolygonHotspot, type PolygonHotspotDefinition, type PolygonHotspotProps, type PolygonValidationCode, type PolygonValidationIssue, type PolygonVerticesChangeEvent, PolylineHotspot, type PolylineHotspotDefinition, type PolylineHotspotProps, type PolylineValidationIssue, type PolylineVerticesChangeEvent, type RectangleGraphic, type RingGraphic, type Scene, type SceneTransition, type SceneTransitionEndEvent, type SceneTransitionErrorEvent, type SceneTransitionPreset, Scenes, type ScenesProps, type SequenceFrameDirection, type SequenceFrameEvent, SequenceHotspot, type SequenceHotspotDefinition, type SequenceHotspotErrorEvent, type SequenceHotspotProps, type SequenceLoadProgress, type SequencePlaybackState, type SetPanoViewerOptions, Sphere, type SphereProps, type SphereScene, type StarGraphic, type SvgGraphic, type SvgPathGraphic, TextHotspot, type TextHotspotAlign, type TextHotspotDefinition, type TextHotspotFontStyle, type TextHotspotProps, type TextHotspotStyle, type TextHotspotVerticalAlign, type TextHotspotWhiteSpace, Tile, type TileAddress, type TileLoadError, type TileLoadProgress, type TileMultiresConfig, type TileProps, type TileScene, TouchControls, type TouchControlsOptions, type TouchControlsProps, type TriangleGraphic, VideoHotspot, type VideoHotspotDefinition, type VideoHotspotErrorEvent, type VideoHotspotProps, type VideoPlaybackState, type ViewInteractionEvent, type ViewInteractionSource, WEBVR_PROFILES, WEBVR_PROFILE_IDS, WebVR, type WebVRChrome, type WebVRChromeAppearance, type WebVRHandle, type WebVRMode, type WebVRProfile, type WebVRProfileId, type WebVRProps, type WebVRSettings, clampPanoPitch, composePanoContextMenuItems, createDefaultPanoContextMenuItems, createPanoContextMenuPresets, cycleSceneId, normalizePanoPosition, normalizePanoYaw, panoPositionToVector3, resolvePanoContextMenuEntries, unwrapPolygonVertices, usePanoEvents, validatePolygonVertices, validatePolylineVertices, vector3ToPanoPosition };
|
|
1576
|
+
export { type ArrowGraphic, AudioHotspot, type AudioHotspotDefinition, type AudioHotspotErrorEvent, type AudioHotspotProps, type AudioPlaybackState, AutoRotate, type AutoRotateProps, BackgroundAudio, type BackgroundAudioController, type BackgroundAudioErrorEvent, type BackgroundAudioProps, type BackgroundAudioSnapshot, type BackgroundAudioSource, type CircleGraphic, type CubeFaceCode, DEFAULT_HOTSPOT_TOOLTIP_APPEARANCE, DEFAULT_HOTSPOT_TOOLTIP_OFFSET, DEFAULT_PANO_CURSORS, DEFAULT_PANO_VIDEO_CAPTION_APPEARANCE, DEFAULT_PANO_VIDEO_CONTROLS_APPEARANCE, DEFAULT_PANO_VIDEO_PLAYBACK_RATES, DEFAULT_WEBVR_CHROME_APPEARANCE, DEFAULT_WEBVR_CURSOR_DWELL_MS, type DiamondGraphic, type GraphicDefinition, GraphicHotspot, type GraphicHotspotDefinition, type GraphicHotspotProps, Gyro, type GyroHandle, type GyroProps, type GyroTouchMode, type HotspotCommonProps, type HotspotDefinition, type HotspotDefinitionBase, type HotspotDragEvent, type HotspotInputSource, type HotspotInteractionEvent, type HotspotMode, type HotspotPointerEvents, type HotspotPosition, type HotspotScaleMode, type HotspotTooltipAppearance, type HotspotTooltipContent, type HotspotTooltipPlacement, type HotspotTooltipTrigger, IframeHotspot, type IframeHotspotDefinition, type IframeHotspotProps, type IframePointerPolicy, ImageHotspot, type ImageHotspotDefinition, type ImageHotspotProps, type KeyboardControlAction, type KeyboardControlKeys, KeyboardControls, type KeyboardControlsProps, MAX_HOTSPOT_PITCH, MIN_PANO_CONTEXT_MENU_BACKGROUND_OPACITY, type MouseControlButton, MouseControls, type MouseControlsOptions, type MouseControlsProps, PANO_FILTER_PRESETS, PanoContextMenu, type PanoContextMenuActionItem, type PanoContextMenuAppearance, type PanoContextMenuEntry, type PanoContextMenuItem, type PanoContextMenuPresetActions, type PanoContextMenuPresetId, type PanoContextMenuPresetRef, type PanoContextMenuPresets, type PanoContextMenuProps, type PanoContextMenuRenderProps, type PanoContextMenuSelectContext, type PanoContextMenuSeparatorItem, type PanoCursor, type PanoCursors, type PanoEventBus, type PanoEventListener, type PanoEventMap, type PanoEventType, PanoEvents, type PanoEventsProps, PanoFilter, type PanoFilterPreset, type PanoFilterProps, type PanoResizeEvent, PanoVideo, type PanoVideoCaptionAppearance, type PanoVideoController, PanoVideoControls, type PanoVideoControlsAppearance, type PanoVideoControlsProps, type PanoVideoErrorEvent, type PanoVideoErrorSource, type PanoVideoPlaybackSnapshot, type PanoVideoProps, type PanoVideoSource, type PanoVideoTrack, type PanoVideoTrackKind, type PanoVideoVariant, PanoViewer, type PanoViewerHandle, type PanoViewerProps, type PanoViewerState, type PanoWheelEvent, type PanoramaControlsOptions, type PanoramaPointerEvent, type PointHotspotDefinition, type PointHotspotDefinitionBase, PolygonHotspot, type PolygonHotspotDefinition, type PolygonHotspotProps, type PolygonValidationCode, type PolygonValidationIssue, type PolygonVerticesChangeEvent, PolylineHotspot, type PolylineHotspotDefinition, type PolylineHotspotProps, type PolylineValidationIssue, type PolylineVerticesChangeEvent, type RectangleGraphic, type RingGraphic, type Scene, type SceneTransition, type SceneTransitionEndEvent, type SceneTransitionErrorEvent, type SceneTransitionPreset, Scenes, type ScenesController, type ScenesProps, type SequenceFrameDirection, type SequenceFrameEvent, SequenceHotspot, type SequenceHotspotDefinition, type SequenceHotspotErrorEvent, type SequenceHotspotProps, type SequenceLoadProgress, type SequencePlaybackState, type SetPanoViewerOptions, Sphere, type SphereProps, type SphereScene, type StarGraphic, type SvgGraphic, type SvgPathGraphic, TextHotspot, type TextHotspotAlign, type TextHotspotDefinition, type TextHotspotFontStyle, type TextHotspotProps, type TextHotspotStyle, type TextHotspotVerticalAlign, type TextHotspotWhiteSpace, Tile, type TileAddress, type TileLoadError, type TileLoadProgress, type TileMultiresConfig, type TileProps, type TileScene, TouchControls, type TouchControlsOptions, type TouchControlsProps, type TriangleGraphic, VideoHotspot, type VideoHotspotDefinition, type VideoHotspotErrorEvent, type VideoHotspotProps, type VideoPlaybackState, type ViewInteractionEvent, type ViewInteractionSource, WEBVR_PROFILES, WEBVR_PROFILE_IDS, WebVR, type WebVRChrome, type WebVRChromeAppearance, type WebVRHandle, type WebVRMode, type WebVRProfile, type WebVRProfileId, type WebVRProps, type WebVRSettings, clampPanoPitch, composePanoContextMenuItems, createDefaultPanoContextMenuItems, createPanoContextMenuPresets, cycleSceneId, normalizePanoPosition, normalizePanoYaw, panoPositionToVector3, resolvePanoContextMenuEntries, unwrapPolygonVertices, usePanoEvents, validatePolygonVertices, validatePolylineVertices, vector3ToPanoPosition };
|