@micrio/client 6.1.3 → 6.1.5
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/micrio.min.d.ts +114 -282
- package/micrio.min.js +2 -2
- package/package.json +1 -1
package/micrio.min.d.ts
CHANGED
|
@@ -12,10 +12,23 @@ declare module '@micrio/client' {
|
|
|
12
12
|
* @returns A Promise resolving to the loaded TextureBitmap.
|
|
13
13
|
*/
|
|
14
14
|
export const loadTexture: (src: string) => Promise<TextureBitmap>;
|
|
15
|
+
/**
|
|
16
|
+
* Mathematical utility functions.
|
|
17
|
+
* @author Marcel Duin <marcel@micr.io>
|
|
18
|
+
*/
|
|
15
19
|
/**
|
|
16
20
|
* Calculates the positive modulo (floored division remainder).
|
|
17
21
|
*/
|
|
18
22
|
export const mod: (n: number, m?: number) => number;
|
|
23
|
+
/**
|
|
24
|
+
* Converts a Camera.View tuple `[x, y, w, h]` to a center-based JSON object.
|
|
25
|
+
*/
|
|
26
|
+
export const toCenterJSON: (v: Models.Camera.View) => {
|
|
27
|
+
centerX: number;
|
|
28
|
+
centerY: number;
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
};
|
|
19
32
|
/**
|
|
20
33
|
* Defines various enums used throughout the Micrio application,
|
|
21
34
|
* primarily for standardizing action types and option values.
|
|
@@ -316,7 +329,7 @@ declare module '@micrio/client' {
|
|
|
316
329
|
* Initializes the engine (replaces WebAssembly loading).
|
|
317
330
|
* @throws Error if engine initialization fails
|
|
318
331
|
*/
|
|
319
|
-
load():
|
|
332
|
+
load(): void;
|
|
320
333
|
private _hostDrawQuad;
|
|
321
334
|
private _hostGetTileOpacity;
|
|
322
335
|
private _hostSetTileOpacity;
|
|
@@ -402,12 +415,6 @@ declare module '@micrio/client' {
|
|
|
402
415
|
*/
|
|
403
416
|
animateTo(idx: number): void;
|
|
404
417
|
}
|
|
405
|
-
/**
|
|
406
|
-
* Converts seconds into a human-readable time string (hh?:mm:ss).
|
|
407
|
-
* @param s Time in seconds. Can be negative for remaining time display.
|
|
408
|
-
* @returns Formatted time string (e.g., "1:23", "1:05:09", "-0:15").
|
|
409
|
-
*/
|
|
410
|
-
export function parseTime(s: number): string;
|
|
411
418
|
/**
|
|
412
419
|
* Centralized data loading controller.
|
|
413
420
|
* Uses the `bundle.json` endpoint which returns info + data for multiple
|
|
@@ -437,6 +444,8 @@ declare module '@micrio/client' {
|
|
|
437
444
|
getSpaceData(id: string): Models.Spaces.Space | undefined;
|
|
438
445
|
/** Returns the organisation data from the bundle, or undefined. */
|
|
439
446
|
getOrganisation(): Models.ImageInfo.Organisation | undefined;
|
|
447
|
+
/** Returns the album info for an album ID from the bundle cache. */
|
|
448
|
+
getAlbum(id: string): Models.ImageInfo.GallerySettings | undefined;
|
|
440
449
|
/**
|
|
441
450
|
* Returns the full bundle entry (info + data) for a single image ID,
|
|
442
451
|
* fetching the bundle once if not cached.
|
|
@@ -600,36 +609,6 @@ declare module '@micrio/client' {
|
|
|
600
609
|
/** Fades out the image smoothly or instantly. */
|
|
601
610
|
fadeOut(direct?: boolean): void;
|
|
602
611
|
}
|
|
603
|
-
/**
|
|
604
|
-
* Direction-keyed area rectangles for grid/gallery slide and swipe transitions.
|
|
605
|
-
* Areas use [x0, y0, x1, y1] in normalized parent-canvas coordinates and
|
|
606
|
-
* extend outside [0,1] to represent off-screen positions.
|
|
607
|
-
*
|
|
608
|
-
* Direction conventions (degrees of motion of the entering image):
|
|
609
|
-
* 0 = enters from top
|
|
610
|
-
* 90 = enters from right
|
|
611
|
-
* 180 = enters from bottom
|
|
612
|
-
* 270 = enters from left
|
|
613
|
-
*
|
|
614
|
-
* @author Marcel Duin <marcel@micr.io>
|
|
615
|
-
*/
|
|
616
|
-
/** Slide transition entry areas (entering image starts half-off-screen). */
|
|
617
|
-
export const slideAreas: Record<number, Models.Camera.ViewRect>;
|
|
618
|
-
/** Swipe transition entry areas (entering image starts fully off-screen). */
|
|
619
|
-
export const swipeAreas: Record<number, Models.Camera.ViewRect>;
|
|
620
|
-
/** Swipe transition exit areas (leaving image moves fully off-screen). */
|
|
621
|
-
export const swipeExitAreas: Record<number, Models.Camera.ViewRect>;
|
|
622
|
-
/** Centered visible slot. */
|
|
623
|
-
export const centerArea: Models.Camera.ViewRect;
|
|
624
|
-
/** Off-screen slot to the left, same height. */
|
|
625
|
-
export const leftSlot: Models.Camera.ViewRect;
|
|
626
|
-
/** Off-screen slot to the right, same height. */
|
|
627
|
-
export const rightSlot: Models.Camera.ViewRect;
|
|
628
|
-
/**
|
|
629
|
-
* Returns the horizontal slot area for an integer offset from the active slot.
|
|
630
|
-
* offset=0 → centered visible; positive → off to the right; negative → off to the left.
|
|
631
|
-
*/
|
|
632
|
-
export const horizontalSlot: (offset: number) => Models.Camera.ViewRect;
|
|
633
612
|
/**
|
|
634
613
|
* Micrio grid display controller
|
|
635
614
|
* @author Marcel Duin <marcel@micr.io>
|
|
@@ -1143,7 +1122,6 @@ declare module '@micrio/client' {
|
|
|
1143
1122
|
markersScale?: boolean;
|
|
1144
1123
|
/** Albums */
|
|
1145
1124
|
gallery?: GallerySettings;
|
|
1146
|
-
album?: AlbumInfo; /** V5 only */
|
|
1147
1125
|
/** FOR OMNI OBJECTS */
|
|
1148
1126
|
omni?: OmniSettings;
|
|
1149
1127
|
/** Optional marker settings */
|
|
@@ -1192,6 +1170,10 @@ declare module '@micrio/client' {
|
|
|
1192
1170
|
watermarkOpacity?: number;
|
|
1193
1171
|
};
|
|
1194
1172
|
type GallerySettings = {
|
|
1173
|
+
/** Album/image ID for the gallery */
|
|
1174
|
+
id?: string;
|
|
1175
|
+
/** Gallery name */
|
|
1176
|
+
name?: string;
|
|
1195
1177
|
/** Gallery has an associated .bin archive with thumbnails */
|
|
1196
1178
|
archive?: string;
|
|
1197
1179
|
/** Archive layer offset */
|
|
@@ -1206,6 +1188,8 @@ declare module '@micrio/client' {
|
|
|
1206
1188
|
isSpreads?: boolean;
|
|
1207
1189
|
/** For spreads, number of cover pages to show as single page */
|
|
1208
1190
|
coverPages?: number;
|
|
1191
|
+
/** Optional viewer settings that override/merge with defaults */
|
|
1192
|
+
settings?: Partial<ImageInfo.Settings>;
|
|
1209
1193
|
revisions?: {
|
|
1210
1194
|
[key: string]: RevisionType;
|
|
1211
1195
|
};
|
|
@@ -1793,6 +1777,7 @@ declare module '@micrio/client' {
|
|
|
1793
1777
|
id: string;
|
|
1794
1778
|
data: Models.Spaces.Space;
|
|
1795
1779
|
}[];
|
|
1780
|
+
album?: ImageInfo.GallerySettings;
|
|
1796
1781
|
};
|
|
1797
1782
|
}
|
|
1798
1783
|
namespace Assets {
|
|
@@ -1985,36 +1970,13 @@ declare module '@micrio/client' {
|
|
|
1985
1970
|
blur?: number;
|
|
1986
1971
|
}
|
|
1987
1972
|
}
|
|
1988
|
-
/** Albums */
|
|
1989
|
-
interface AlbumInfo {
|
|
1990
|
-
/** The album ID */
|
|
1991
|
-
id: string;
|
|
1992
|
-
/** The album name */
|
|
1993
|
-
name: string;
|
|
1994
|
-
/** The album UX type */
|
|
1995
|
-
type: ('swipe' | 'switch' | 'grid');
|
|
1996
|
-
/** The album image sorting */
|
|
1997
|
-
sort?: ('name' | '-name' | 'created' | '-created' | 'random');
|
|
1998
|
-
/** Album pages are shown as book spreads */
|
|
1999
|
-
isSpreads?: boolean;
|
|
2000
|
-
/** The number of single cover pages in case of spreads */
|
|
2001
|
-
coverPages?: number;
|
|
2002
|
-
/** Published revision number */
|
|
2003
|
-
revision: number;
|
|
2004
|
-
/** Available page data (markers, etc) */
|
|
2005
|
-
published: {
|
|
2006
|
-
[key: string]: RevisionType;
|
|
2007
|
-
};
|
|
2008
|
-
/** Album organisation */
|
|
2009
|
-
organisation?: ImageInfo.Organisation;
|
|
2010
|
-
}
|
|
2011
1973
|
interface Album {
|
|
2012
1974
|
/** The number of pages in this album */
|
|
2013
1975
|
numPages: number;
|
|
2014
1976
|
/** The current page index */
|
|
2015
1977
|
currentIndex: number;
|
|
2016
1978
|
/** The album info */
|
|
2017
|
-
info?:
|
|
1979
|
+
info?: ImageInfo.GallerySettings;
|
|
2018
1980
|
/** Go to previous page */
|
|
2019
1981
|
prev: () => void;
|
|
2020
1982
|
/** Go to next page */
|
|
@@ -2292,8 +2254,6 @@ declare module '@micrio/client' {
|
|
|
2292
2254
|
'volume'?: number;
|
|
2293
2255
|
/** Fade music to this volume while other audio plays (between 0 and 1). Default: 0 */
|
|
2294
2256
|
'data-mutedvolume'?: number;
|
|
2295
|
-
/** Configuration for the grid which the viewer will use. */
|
|
2296
|
-
'data-grid'?: string;
|
|
2297
2257
|
/** Toggle limited rendering mode in WebAssembly. */
|
|
2298
2258
|
'data-limited'?: boolean;
|
|
2299
2259
|
}
|
|
@@ -2393,13 +2353,6 @@ declare module '@micrio/client' {
|
|
|
2393
2353
|
/** Was panning active before pinching started? */
|
|
2394
2354
|
wasPanning: boolean;
|
|
2395
2355
|
};
|
|
2396
|
-
/** State for debouncing 'update' events. */
|
|
2397
|
-
updates: {
|
|
2398
|
-
/** Timeout ID for the debounced update. */
|
|
2399
|
-
to: number;
|
|
2400
|
-
/** Stack of event types that triggered the update. */
|
|
2401
|
-
stack: string[];
|
|
2402
|
-
};
|
|
2403
2356
|
};
|
|
2404
2357
|
/** Event listener options for passive listeners. */
|
|
2405
2358
|
export const eventPassive: AddEventListenerOptions;
|
|
@@ -2466,101 +2419,6 @@ declare module '@micrio/client' {
|
|
|
2466
2419
|
/** Has touch support */
|
|
2467
2420
|
hasTouch: boolean;
|
|
2468
2421
|
}
|
|
2469
|
-
/**
|
|
2470
|
-
* List of internal Micrio event types that should trigger a debounced 'update' event.
|
|
2471
|
-
* The 'update' event signals that the overall state relevant for external integrations might have changed.
|
|
2472
|
-
* @readonly
|
|
2473
|
-
*/
|
|
2474
|
-
export const UpdateEvents: (keyof Models.MicrioEventMap)[];
|
|
2475
|
-
/**
|
|
2476
|
-
* Update event handler module.
|
|
2477
|
-
* Manages debounced 'update' event dispatching when internal state changes.
|
|
2478
|
-
*/
|
|
2479
|
-
export class UpdateHandler {
|
|
2480
|
-
private ctx;
|
|
2481
|
-
constructor(ctx: EventContext);
|
|
2482
|
-
/** Hooks listeners for events that should trigger a debounced 'update' event. */
|
|
2483
|
-
hook(): void;
|
|
2484
|
-
/** Unhooks listeners for the debounced 'update' event. */
|
|
2485
|
-
unhook(): void;
|
|
2486
|
-
/**
|
|
2487
|
-
* Event listener callback that queues the event type and triggers the debounced dispatch.
|
|
2488
|
-
* @param e The Event object.
|
|
2489
|
-
*/
|
|
2490
|
-
private handleEvent;
|
|
2491
|
-
/**
|
|
2492
|
-
* Dispatches the 'update' event with the accumulated event types and current state.
|
|
2493
|
-
* Clears the event stack.
|
|
2494
|
-
*/
|
|
2495
|
-
private dispatch;
|
|
2496
|
-
}
|
|
2497
|
-
export { UpdateEvents } from "ts/events/update";
|
|
2498
|
-
/**
|
|
2499
|
-
* Handles user input events (mouse, touch, keyboard, wheel, gestures) for the Micrio viewer.
|
|
2500
|
-
* Translates browser events into camera movements (pan, zoom), dispatches custom Micrio events,
|
|
2501
|
-
* and manages interaction states like panning, pinching, and enabled/disabled states.
|
|
2502
|
-
* Accessed via `micrio.events`.
|
|
2503
|
-
* @author Marcel Duin <marcel@micr.io>
|
|
2504
|
-
*/
|
|
2505
|
-
export class Events implements EventContext {
|
|
2506
|
-
/** Writable Svelte store indicating if event handling is currently enabled. Set to false during tours or animations. */
|
|
2507
|
-
enabled: Writable<boolean>;
|
|
2508
|
-
/** Getter for the current value of the {@link enabled} store. */
|
|
2509
|
-
get $enabled(): boolean;
|
|
2510
|
-
/** Current pinch zoom factor relative to the start of the pinch. Undefined when not pinching. */
|
|
2511
|
-
pinchFactor: number | undefined;
|
|
2512
|
-
private dragHandler;
|
|
2513
|
-
private pinchHandler;
|
|
2514
|
-
private pointerPinchHandler;
|
|
2515
|
-
private gestureHandler;
|
|
2516
|
-
private wheelHandler;
|
|
2517
|
-
private keyboardHandler;
|
|
2518
|
-
private doubleTapHandler;
|
|
2519
|
-
private updateHandler;
|
|
2520
|
-
isEnabled(): boolean;
|
|
2521
|
-
isPanning(): boolean;
|
|
2522
|
-
isPinching(): boolean;
|
|
2523
|
-
setPanning(value: boolean): void;
|
|
2524
|
-
setPinching(value: boolean): void;
|
|
2525
|
-
isWheeling(): boolean;
|
|
2526
|
-
setWheeling(value: boolean): void;
|
|
2527
|
-
isControlZoom(): boolean;
|
|
2528
|
-
isTwoFingerPan(): boolean;
|
|
2529
|
-
getVisible(): MicrioImage[] | undefined;
|
|
2530
|
-
setCapturedPointerId(id: number | undefined): void;
|
|
2531
|
-
setPinchFactor(value: number | undefined): void;
|
|
2532
|
-
setPScale(value: number): void;
|
|
2533
|
-
setHasUsedCtrl(value: boolean): void;
|
|
2534
|
-
/**
|
|
2535
|
-
* Checks if the user is currently interacting with the map via panning, pinching, or wheeling.
|
|
2536
|
-
* @returns True if the user is actively navigating.
|
|
2537
|
-
*/
|
|
2538
|
-
get isNavigating(): boolean;
|
|
2539
|
-
/** Hooks all necessary event listeners based on current settings. */
|
|
2540
|
-
hook(): void;
|
|
2541
|
-
/** Unhooks all attached event listeners. */
|
|
2542
|
-
unhook(): void;
|
|
2543
|
-
/** Hooks keyboard event listeners. */
|
|
2544
|
-
hookKeys(): void;
|
|
2545
|
-
/** Unhooks keyboard event listeners. */
|
|
2546
|
-
unhookKeys(): void;
|
|
2547
|
-
/** Hooks zoom-related event listeners (pinch, scroll, double-tap/click). */
|
|
2548
|
-
hookZoom(): void;
|
|
2549
|
-
/** Unhooks zoom-related event listeners. */
|
|
2550
|
-
unhookZoom(): void;
|
|
2551
|
-
/** Hooks mouse wheel/scroll event listeners. */
|
|
2552
|
-
hookScroll(): void;
|
|
2553
|
-
/** Unhooks mouse wheel/scroll event listeners. */
|
|
2554
|
-
unhookScroll(): void;
|
|
2555
|
-
/** Hooks touch pinch and macOS gesture event listeners. */
|
|
2556
|
-
hookPinch(): void;
|
|
2557
|
-
/** Unhooks touch pinch and macOS gesture event listeners. */
|
|
2558
|
-
unhookPinch(): void;
|
|
2559
|
-
/** Hooks pointer down/move/up listeners for drag panning. */
|
|
2560
|
-
hookDrag(): void;
|
|
2561
|
-
/** Unhooks pointer listeners for drag panning. */
|
|
2562
|
-
unhookDrag(): void;
|
|
2563
|
-
}
|
|
2564
2422
|
/**
|
|
2565
2423
|
* Drag/pan event handler module.
|
|
2566
2424
|
* Handles pointer down/move/up events for panning the image.
|
|
@@ -2750,16 +2608,71 @@ declare module '@micrio/client' {
|
|
|
2750
2608
|
*/
|
|
2751
2609
|
private click;
|
|
2752
2610
|
}
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
export
|
|
2761
|
-
|
|
2762
|
-
|
|
2611
|
+
/**
|
|
2612
|
+
* Handles user input events (mouse, touch, keyboard, wheel, gestures) for the Micrio viewer.
|
|
2613
|
+
* Translates browser events into camera movements (pan, zoom), dispatches custom Micrio events,
|
|
2614
|
+
* and manages interaction states like panning, pinching, and enabled/disabled states.
|
|
2615
|
+
* Accessed via `micrio.events`.
|
|
2616
|
+
* @author Marcel Duin <marcel@micr.io>
|
|
2617
|
+
*/
|
|
2618
|
+
export class Events implements EventContext {
|
|
2619
|
+
/** Writable Svelte store indicating if event handling is currently enabled. Set to false during tours or animations. */
|
|
2620
|
+
enabled: Writable<boolean>;
|
|
2621
|
+
/** Getter for the current value of the {@link enabled} store. */
|
|
2622
|
+
get $enabled(): boolean;
|
|
2623
|
+
/** Current pinch zoom factor relative to the start of the pinch. Undefined when not pinching. */
|
|
2624
|
+
pinchFactor: number | undefined;
|
|
2625
|
+
private dragHandler;
|
|
2626
|
+
private pinchHandler;
|
|
2627
|
+
private pointerPinchHandler;
|
|
2628
|
+
private gestureHandler;
|
|
2629
|
+
private wheelHandler;
|
|
2630
|
+
private keyboardHandler;
|
|
2631
|
+
private doubleTapHandler;
|
|
2632
|
+
isEnabled(): boolean;
|
|
2633
|
+
isPanning(): boolean;
|
|
2634
|
+
isPinching(): boolean;
|
|
2635
|
+
setPanning(value: boolean): void;
|
|
2636
|
+
setPinching(value: boolean): void;
|
|
2637
|
+
isWheeling(): boolean;
|
|
2638
|
+
setWheeling(value: boolean): void;
|
|
2639
|
+
isControlZoom(): boolean;
|
|
2640
|
+
isTwoFingerPan(): boolean;
|
|
2641
|
+
getVisible(): MicrioImage[] | undefined;
|
|
2642
|
+
setCapturedPointerId(id: number | undefined): void;
|
|
2643
|
+
setPinchFactor(value: number | undefined): void;
|
|
2644
|
+
setPScale(value: number): void;
|
|
2645
|
+
setHasUsedCtrl(value: boolean): void;
|
|
2646
|
+
/**
|
|
2647
|
+
* Checks if the user is currently interacting with the map via panning, pinching, or wheeling.
|
|
2648
|
+
* @returns True if the user is actively navigating.
|
|
2649
|
+
*/
|
|
2650
|
+
get isNavigating(): boolean;
|
|
2651
|
+
/** Hooks all necessary event listeners based on current settings. */
|
|
2652
|
+
hook(): void;
|
|
2653
|
+
/** Unhooks all attached event listeners. */
|
|
2654
|
+
unhook(): void;
|
|
2655
|
+
/** Hooks keyboard event listeners. */
|
|
2656
|
+
hookKeys(): void;
|
|
2657
|
+
/** Unhooks keyboard event listeners. */
|
|
2658
|
+
unhookKeys(): void;
|
|
2659
|
+
/** Hooks zoom-related event listeners (pinch, scroll, double-tap/click). */
|
|
2660
|
+
hookZoom(): void;
|
|
2661
|
+
/** Unhooks zoom-related event listeners. */
|
|
2662
|
+
unhookZoom(): void;
|
|
2663
|
+
/** Hooks mouse wheel/scroll event listeners. */
|
|
2664
|
+
hookScroll(): void;
|
|
2665
|
+
/** Unhooks mouse wheel/scroll event listeners. */
|
|
2666
|
+
unhookScroll(): void;
|
|
2667
|
+
/** Hooks touch pinch and macOS gesture event listeners. */
|
|
2668
|
+
hookPinch(): void;
|
|
2669
|
+
/** Unhooks touch pinch and macOS gesture event listeners. */
|
|
2670
|
+
unhookPinch(): void;
|
|
2671
|
+
/** Hooks pointer down/move/up listeners for drag panning. */
|
|
2672
|
+
hookDrag(): void;
|
|
2673
|
+
/** Unhooks pointer listeners for drag panning. */
|
|
2674
|
+
unhookDrag(): void;
|
|
2675
|
+
}
|
|
2763
2676
|
/**
|
|
2764
2677
|
* Language-related constants and utilities.
|
|
2765
2678
|
*/
|
|
@@ -2960,8 +2873,6 @@ declare module '@micrio/client' {
|
|
|
2960
2873
|
*/
|
|
2961
2874
|
constructor(micrio: HTMLMicrioElement);
|
|
2962
2875
|
}
|
|
2963
|
-
export { i18n, langs } from "ts/i18n/strings";
|
|
2964
|
-
export { locale, languageNames, rtlLanguageCodes } from "ts/i18n/locale";
|
|
2965
2876
|
/**
|
|
2966
2877
|
* Manages the loading, playback, and WebGL integration of embedded videos
|
|
2967
2878
|
* that are rendered directly onto the Micrio canvas texture (not as HTML elements).
|
|
@@ -3098,80 +3009,21 @@ declare module '@micrio/client' {
|
|
|
3098
3009
|
setVolume(volume: number): void;
|
|
3099
3010
|
destroy(): void;
|
|
3100
3011
|
}
|
|
3101
|
-
export type PREDEFINED = [string, Models.ImageInfo.ImageInfo, Models.ImageData.ImageData | undefined];
|
|
3102
|
-
/** Enum for identifying media type. */
|
|
3103
|
-
export enum MediaType {
|
|
3104
|
-
None = 0,
|
|
3105
|
-
IFrame = 1,
|
|
3106
|
-
Video = 2,
|
|
3107
|
-
Audio = 3,
|
|
3108
|
-
VideoTour = 4,
|
|
3109
|
-
Micrio = 5
|
|
3110
|
-
}
|
|
3111
|
-
/** Enum for identifying iframe player type. */
|
|
3112
|
-
export enum FrameType {
|
|
3113
|
-
YouTube = 1,
|
|
3114
|
-
Vimeo = 2
|
|
3115
|
-
}
|
|
3116
|
-
/**
|
|
3117
|
-
* Media utilities for source parsing, type detection, and player management.
|
|
3118
|
-
* @author Marcel Duin <marcel@micr.io>
|
|
3119
|
-
*/
|
|
3120
|
-
/** YouTube no-cookies host */
|
|
3121
|
-
export const YOUTUBE_HOST = "https://www.youtube-nocookie.com";
|
|
3122
|
-
/**
|
|
3123
|
-
* Parsed media source information.
|
|
3124
|
-
*/
|
|
3125
|
-
interface ParsedMediaSource {
|
|
3126
|
-
/** The detected media type */
|
|
3127
|
-
type: MediaType;
|
|
3128
|
-
/** The frame type for iframe embeds (YouTube/Vimeo) */
|
|
3129
|
-
frameType?: FrameType;
|
|
3130
|
-
/** The normalized/processed source URL */
|
|
3131
|
-
src?: string;
|
|
3132
|
-
/** YouTube video ID (if applicable) */
|
|
3133
|
-
youtubeId?: string;
|
|
3134
|
-
/** Vimeo video ID (if applicable) */
|
|
3135
|
-
vimeoId?: string;
|
|
3136
|
-
/** Vimeo hash token (if applicable) */
|
|
3137
|
-
vimeoToken?: string;
|
|
3138
|
-
/** Cloudflare video ID (if applicable) */
|
|
3139
|
-
cloudflareId?: string;
|
|
3140
|
-
/** Micrio embed data [id, width?, height?, lang?] */
|
|
3141
|
-
micrioEmbed?: string[];
|
|
3142
|
-
/** Start time extracted from URL (seconds) */
|
|
3143
|
-
startTime?: number;
|
|
3144
|
-
/** Whether the source is a Cloudflare stream */
|
|
3145
|
-
isCloudflare: boolean;
|
|
3146
|
-
/** M3U8 URL for HLS streams */
|
|
3147
|
-
hlsSrc?: string;
|
|
3148
|
-
}
|
|
3149
|
-
/**
|
|
3150
|
-
* Parses a media source URL and determines its type and configuration.
|
|
3151
|
-
*/
|
|
3152
|
-
export function parseMediaSource(src: string | undefined, tour: Models.ImageData.VideoTour | null, useNativeFrames?: boolean, currentTime?: number): ParsedMediaSource;
|
|
3153
|
-
/**
|
|
3154
|
-
* Returns a shared Audio element instance for iOS.
|
|
3155
|
-
* This is a workaround for iOS audio playback restrictions where user
|
|
3156
|
-
* interaction is required per audio element.
|
|
3157
|
-
*/
|
|
3158
|
-
export function getIOSAudioElement(): HTMLAudioElement;
|
|
3159
3012
|
/**
|
|
3160
|
-
* Adapter for
|
|
3013
|
+
* Adapter for Vimeo Player API.
|
|
3161
3014
|
*/
|
|
3162
|
-
export class
|
|
3015
|
+
export class VimeoPlayerAdapter implements MediaPlayerAdapter {
|
|
3163
3016
|
private frame;
|
|
3164
3017
|
private config;
|
|
3165
3018
|
private callbacks;
|
|
3166
|
-
readonly requiresTimeTick =
|
|
3019
|
+
readonly requiresTimeTick = false;
|
|
3167
3020
|
private player;
|
|
3168
3021
|
private destroyed;
|
|
3169
3022
|
constructor(frame: HTMLIFrameElement, config: PlayerConfig, callbacks?: PlayerEventCallbacks);
|
|
3170
3023
|
/**
|
|
3171
|
-
* Loads the
|
|
3024
|
+
* Loads the Vimeo API and initializes the player.
|
|
3172
3025
|
*/
|
|
3173
3026
|
initialize(): Promise<void>;
|
|
3174
|
-
private handleStateChange;
|
|
3175
3027
|
play(): Promise<void>;
|
|
3176
3028
|
pause(): void;
|
|
3177
3029
|
getCurrentTime(): Promise<number>;
|
|
@@ -3179,24 +3031,25 @@ declare module '@micrio/client' {
|
|
|
3179
3031
|
getDuration(): Promise<number>;
|
|
3180
3032
|
isPaused(): Promise<boolean>;
|
|
3181
3033
|
setMuted(muted: boolean): void;
|
|
3182
|
-
setVolume(
|
|
3034
|
+
setVolume(volume: number): void;
|
|
3183
3035
|
destroy(): void;
|
|
3184
3036
|
}
|
|
3185
3037
|
/**
|
|
3186
|
-
* Adapter for
|
|
3038
|
+
* Adapter for YouTube IFrame Player API.
|
|
3187
3039
|
*/
|
|
3188
|
-
export class
|
|
3040
|
+
export class YouTubePlayerAdapter implements MediaPlayerAdapter {
|
|
3189
3041
|
private frame;
|
|
3190
3042
|
private config;
|
|
3191
3043
|
private callbacks;
|
|
3192
|
-
readonly requiresTimeTick =
|
|
3044
|
+
readonly requiresTimeTick = true;
|
|
3193
3045
|
private player;
|
|
3194
3046
|
private destroyed;
|
|
3195
3047
|
constructor(frame: HTMLIFrameElement, config: PlayerConfig, callbacks?: PlayerEventCallbacks);
|
|
3196
3048
|
/**
|
|
3197
|
-
* Loads the
|
|
3049
|
+
* Loads the YouTube API and initializes the player.
|
|
3198
3050
|
*/
|
|
3199
3051
|
initialize(): Promise<void>;
|
|
3052
|
+
private handleStateChange;
|
|
3200
3053
|
play(): Promise<void>;
|
|
3201
3054
|
pause(): void;
|
|
3202
3055
|
getCurrentTime(): Promise<number>;
|
|
@@ -3204,45 +3057,24 @@ declare module '@micrio/client' {
|
|
|
3204
3057
|
getDuration(): Promise<number>;
|
|
3205
3058
|
isPaused(): Promise<boolean>;
|
|
3206
3059
|
setMuted(muted: boolean): void;
|
|
3207
|
-
setVolume(
|
|
3060
|
+
setVolume(_volume: number): void;
|
|
3208
3061
|
destroy(): void;
|
|
3209
3062
|
}
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
export
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
export { Engine } from "ts/render/engine";
|
|
3225
|
-
export { WebGL } from "ts/render/webgl";
|
|
3226
|
-
export { Canvas } from "ts/render/canvas";
|
|
3227
|
-
export { PostProcessor } from "ts/render/postprocess";
|
|
3228
|
-
export { archive } from "ts/render/archive";
|
|
3229
|
-
export { loadTexture, runningThreads, numThreads, abortDownload } from "ts/render/textures";
|
|
3230
|
-
export type { TextureBitmap } from "ts/render/textures";
|
|
3231
|
-
/**
|
|
3232
|
-
* Marker clustering algorithm for calculating overlapping markers
|
|
3233
|
-
* and generating cluster marker objects.
|
|
3234
|
-
* @author Marcel Duin <marcel@micr.io>
|
|
3235
|
-
*/
|
|
3236
|
-
type MarkerData = Models.ImageData.Marker;
|
|
3237
|
-
export type MarkerCoords = [x: number, y: number, w?: number, h?: number];
|
|
3238
|
-
interface ClusterResult {
|
|
3239
|
-
overlapped: number[];
|
|
3240
|
-
clusterMarkers: MarkerData[];
|
|
3063
|
+
export type PREDEFINED = [string, Models.ImageInfo.ImageInfo, Models.ImageData.ImageData | undefined];
|
|
3064
|
+
/** Enum for identifying media type. */
|
|
3065
|
+
export enum MediaType {
|
|
3066
|
+
None = 0,
|
|
3067
|
+
IFrame = 1,
|
|
3068
|
+
Video = 2,
|
|
3069
|
+
Audio = 3,
|
|
3070
|
+
VideoTour = 4,
|
|
3071
|
+
Micrio = 5
|
|
3072
|
+
}
|
|
3073
|
+
/** Enum for identifying iframe player type. */
|
|
3074
|
+
export enum FrameType {
|
|
3075
|
+
YouTube = 1,
|
|
3076
|
+
Vimeo = 2
|
|
3241
3077
|
}
|
|
3242
|
-
/**
|
|
3243
|
-
* Calculates which markers overlap and generates synthetic cluster markers.
|
|
3244
|
-
*/
|
|
3245
|
-
export function calcClusters(visibleMarkers: MarkerData[] | undefined, coords: Map<string, MarkerCoords>, r: number, isOmni: boolean): ClusterResult;
|
|
3246
3078
|
}declare module "svelte/store" {
|
|
3247
3079
|
/** Callback to inform of a value updates.
|
|
3248
3080
|
*/
|