@vizor-vr/react 0.2.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/LICENSE +21 -0
- package/README.md +36 -0
- package/dist/VzAnnotation.d.ts +34 -0
- package/dist/VzAnnotation.d.ts.map +1 -0
- package/dist/VzAnnotation.js +46 -0
- package/dist/VzAnnotation.js.map +1 -0
- package/dist/VzCaption.d.ts +20 -0
- package/dist/VzCaption.d.ts.map +1 -0
- package/dist/VzCaption.js +25 -0
- package/dist/VzCaption.js.map +1 -0
- package/dist/VzCinema.d.ts +17 -0
- package/dist/VzCinema.d.ts.map +1 -0
- package/dist/VzCinema.js +32 -0
- package/dist/VzCinema.js.map +1 -0
- package/dist/VzImg.d.ts +16 -0
- package/dist/VzImg.d.ts.map +1 -0
- package/dist/VzImg.js +29 -0
- package/dist/VzImg.js.map +1 -0
- package/dist/VzLive.d.ts +28 -0
- package/dist/VzLive.d.ts.map +1 -0
- package/dist/VzLive.js +24 -0
- package/dist/VzLive.js.map +1 -0
- package/dist/VzPlaylist.d.ts +16 -0
- package/dist/VzPlaylist.d.ts.map +1 -0
- package/dist/VzPlaylist.js +57 -0
- package/dist/VzPlaylist.js.map +1 -0
- package/dist/VzTour.d.ts +21 -0
- package/dist/VzTour.d.ts.map +1 -0
- package/dist/VzTour.js +29 -0
- package/dist/VzTour.js.map +1 -0
- package/dist/VzVideo.d.ts +17 -0
- package/dist/VzVideo.d.ts.map +1 -0
- package/dist/VzVideo.js +32 -0
- package/dist/VzVideo.js.map +1 -0
- package/dist/__tests__/build-attributes.test.d.ts +2 -0
- package/dist/__tests__/build-attributes.test.d.ts.map +1 -0
- package/dist/__tests__/build-attributes.test.js +76 -0
- package/dist/__tests__/build-attributes.test.js.map +1 -0
- package/dist/__tests__/vz-annotation.test.d.ts +2 -0
- package/dist/__tests__/vz-annotation.test.d.ts.map +1 -0
- package/dist/__tests__/vz-annotation.test.js +29 -0
- package/dist/__tests__/vz-annotation.test.js.map +1 -0
- package/dist/__tests__/vz-caption.test.d.ts +2 -0
- package/dist/__tests__/vz-caption.test.d.ts.map +1 -0
- package/dist/__tests__/vz-caption.test.js +20 -0
- package/dist/__tests__/vz-caption.test.js.map +1 -0
- package/dist/__tests__/vz-components.test.d.ts +2 -0
- package/dist/__tests__/vz-components.test.d.ts.map +1 -0
- package/dist/__tests__/vz-components.test.js +106 -0
- package/dist/__tests__/vz-components.test.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +127 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/use-vizor-element.d.ts +18 -0
- package/dist/use-vizor-element.d.ts.map +1 -0
- package/dist/use-vizor-element.js +124 -0
- package/dist/use-vizor-element.js.map +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 UTG Networks
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @vizor-vr/react
|
|
2
|
+
|
|
3
|
+
React wrappers for the [Vizor VR player](https://www.npmjs.com/package/@vizor-vr/player). Type-safe components with native event props.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @vizor-vr/react @vizor-vr/player
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { VzVideo } from '@vizor-vr/react';
|
|
15
|
+
|
|
16
|
+
export function Player() {
|
|
17
|
+
return (
|
|
18
|
+
<VzVideo
|
|
19
|
+
src="video.mp4"
|
|
20
|
+
format="MONO_360"
|
|
21
|
+
autoplay
|
|
22
|
+
onReady={() => console.log('ready')}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The wrappers import and register the underlying custom elements for you. Components are client-only — in Next.js App Router or other RSC setups, render them from a Client Component (`'use client'`).
|
|
29
|
+
|
|
30
|
+
## Components
|
|
31
|
+
|
|
32
|
+
`VzVideo`, `VzImg`, `VzTour`, `VzCinema`, `VzLive`, `VzPlaylist`, `VzAnnotation`, `VzCaption`.
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
|
|
36
|
+
MIT — see [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface VzAnnotationProps {
|
|
3
|
+
lat?: number;
|
|
4
|
+
lon?: number;
|
|
5
|
+
title?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
timeStart?: number;
|
|
8
|
+
timeEnd?: number;
|
|
9
|
+
sortOrder?: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* React wrapper for <vz-annotation>.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <VzVideo src="video.mp4" format="MONO_360">
|
|
20
|
+
* <VzAnnotation
|
|
21
|
+
* lat={45}
|
|
22
|
+
* lon={-90}
|
|
23
|
+
* title="Look here"
|
|
24
|
+
* icon="info"
|
|
25
|
+
* timeStart={5}
|
|
26
|
+
* timeEnd={15}
|
|
27
|
+
* >
|
|
28
|
+
* <p>Popup content</p>
|
|
29
|
+
* </VzAnnotation>
|
|
30
|
+
* </VzVideo>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const VzAnnotation: React.ForwardRefExoticComponent<VzAnnotationProps & React.RefAttributes<HTMLElement>>;
|
|
34
|
+
//# sourceMappingURL=VzAnnotation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzAnnotation.d.ts","sourceRoot":"","sources":["../src/VzAnnotation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,YAAY,uFA0BxB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* React wrapper for <vz-annotation>.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* <VzVideo src="video.mp4" format="MONO_360">
|
|
8
|
+
* <VzAnnotation
|
|
9
|
+
* lat={45}
|
|
10
|
+
* lon={-90}
|
|
11
|
+
* title="Look here"
|
|
12
|
+
* icon="info"
|
|
13
|
+
* timeStart={5}
|
|
14
|
+
* timeEnd={15}
|
|
15
|
+
* >
|
|
16
|
+
* <p>Popup content</p>
|
|
17
|
+
* </VzAnnotation>
|
|
18
|
+
* </VzVideo>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export const VzAnnotation = forwardRef(function VzAnnotation(props, forwardedRef) {
|
|
22
|
+
const innerRef = useRef(null);
|
|
23
|
+
useImperativeHandle(forwardedRef, () => innerRef.current, [innerRef]);
|
|
24
|
+
const attrs = {};
|
|
25
|
+
if (props.lat !== undefined)
|
|
26
|
+
attrs.lat = props.lat;
|
|
27
|
+
if (props.lon !== undefined)
|
|
28
|
+
attrs.lon = props.lon;
|
|
29
|
+
if (props.title !== undefined)
|
|
30
|
+
attrs.title = props.title;
|
|
31
|
+
if (props.icon !== undefined)
|
|
32
|
+
attrs.icon = props.icon;
|
|
33
|
+
if (props.timeStart !== undefined)
|
|
34
|
+
attrs['time-start'] = props.timeStart;
|
|
35
|
+
if (props.timeEnd !== undefined)
|
|
36
|
+
attrs['time-end'] = props.timeEnd;
|
|
37
|
+
if (props.sortOrder !== undefined)
|
|
38
|
+
attrs['sort-order'] = props.sortOrder;
|
|
39
|
+
return React.createElement('vz-annotation', {
|
|
40
|
+
ref: innerRef,
|
|
41
|
+
class: props.className,
|
|
42
|
+
style: props.style,
|
|
43
|
+
...attrs,
|
|
44
|
+
}, props.children);
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=VzAnnotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzAnnotation.js","sourceRoot":"","sources":["../src/VzAnnotation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAevE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CACpC,SAAS,YAAY,CAAC,KAAK,EAAE,YAAY;IACvC,MAAM,QAAQ,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAE3C,mBAAmB,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEvE,MAAM,KAAK,GAAgD,EAAE,CAAC;IAC9D,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS;QAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IACnD,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS;QAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IACnD,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IACzD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACtD,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;QAAE,KAAK,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;IACzE,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAAE,KAAK,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;IACnE,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;QAAE,KAAK,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;IAEzE,OAAO,KAAK,CAAC,aAAa,CACxB,eAAe,EACf;QACE,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,KAAK,CAAC,SAAS;QACtB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,GAAG,KAAK;KACT,EACD,KAAK,CAAC,QAAQ,CACf,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface VzCaptionProps {
|
|
3
|
+
src: string;
|
|
4
|
+
srclang: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
default?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* React wrapper for caption <track> elements.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <VzVideo src="video.mp4" format="MONO_360">
|
|
14
|
+
* <VzCaption src="subs-en.vtt" srclang="en" label="English" default />
|
|
15
|
+
* <VzCaption src="subs-fr.vtt" srclang="fr" label="French" />
|
|
16
|
+
* </VzVideo>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const VzCaption: React.ForwardRefExoticComponent<VzCaptionProps & React.RefAttributes<HTMLTrackElement>>;
|
|
20
|
+
//# sourceMappingURL=VzCaption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzCaption.d.ts","sourceRoot":"","sources":["../src/VzCaption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,yFAYrB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* React wrapper for caption <track> elements.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* <VzVideo src="video.mp4" format="MONO_360">
|
|
8
|
+
* <VzCaption src="subs-en.vtt" srclang="en" label="English" default />
|
|
9
|
+
* <VzCaption src="subs-fr.vtt" srclang="fr" label="French" />
|
|
10
|
+
* </VzVideo>
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export const VzCaption = React.forwardRef(({ src, srclang, label, default: isDefault, ...rest }, ref) => {
|
|
14
|
+
return React.createElement('track', {
|
|
15
|
+
ref,
|
|
16
|
+
src,
|
|
17
|
+
srcLang: srclang,
|
|
18
|
+
label,
|
|
19
|
+
default: isDefault,
|
|
20
|
+
kind: 'subtitles',
|
|
21
|
+
...rest,
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
VzCaption.displayName = 'VzCaption';
|
|
25
|
+
//# sourceMappingURL=VzCaption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzCaption.js","sourceRoot":"","sources":["../src/VzCaption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CACvC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;IAC5D,OAAO,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE;QAClC,GAAG;QACH,GAAG;QACH,OAAO,EAAE,OAAO;QAChB,KAAK;QACL,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,WAAW;QACjB,GAAG,IAAI;KACR,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VzVideoProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* React wrapper for <vz-cinema>.
|
|
5
|
+
* Renders flat video on a virtual screen inside a 360° cinema environment.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <VzCinema
|
|
10
|
+
* src="movie.mp4"
|
|
11
|
+
* format="MONO_FLAT"
|
|
12
|
+
* style={{ width: '100%', aspectRatio: '16/9' }}
|
|
13
|
+
* />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const VzCinema: React.ForwardRefExoticComponent<VzVideoProps & React.RefAttributes<HTMLElement>>;
|
|
17
|
+
//# sourceMappingURL=VzCinema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzCinema.d.ts","sourceRoot":"","sources":["../src/VzCinema.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,kFAyBpB,CAAC"}
|
package/dist/VzCinema.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
3
|
+
import { useVizorEvents, buildAttributes, useVizorRef } from './use-vizor-element.js';
|
|
4
|
+
/**
|
|
5
|
+
* React wrapper for <vz-cinema>.
|
|
6
|
+
* Renders flat video on a virtual screen inside a 360° cinema environment.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <VzCinema
|
|
11
|
+
* src="movie.mp4"
|
|
12
|
+
* format="MONO_FLAT"
|
|
13
|
+
* style={{ width: '100%', aspectRatio: '16/9' }}
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export const VzCinema = forwardRef(function VzCinema(props, forwardedRef) {
|
|
18
|
+
const innerRef = useVizorRef();
|
|
19
|
+
useVizorEvents(innerRef, props);
|
|
20
|
+
useImperativeHandle(forwardedRef, () => innerRef.current, [innerRef]);
|
|
21
|
+
const attrs = buildAttributes(props);
|
|
22
|
+
if (props.src)
|
|
23
|
+
attrs.src = props.src;
|
|
24
|
+
const sources = props.sources?.map((s, i) => (_jsx("source", { src: s.src, type: s.type, "data-quality": s.quality }, i)));
|
|
25
|
+
return React.createElement('vz-cinema', {
|
|
26
|
+
ref: innerRef,
|
|
27
|
+
class: props.className,
|
|
28
|
+
style: props.style,
|
|
29
|
+
...attrs,
|
|
30
|
+
}, sources);
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=VzCinema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzCinema.js","sourceRoot":"","sources":["../src/VzCinema.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEtF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAChC,SAAS,QAAQ,CAAC,KAAK,EAAE,YAAY;IACnC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEhC,mBAAmB,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEvE,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,KAAK,CAAC,GAAG;QAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IAErC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAC3C,iBAAgB,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,kBAAgB,CAAC,CAAC,OAAO,IAApD,CAAC,CAAuD,CACtE,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,aAAa,CACxB,WAAW,EACX;QACE,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,KAAK,CAAC,SAAS;QACtB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,GAAG,KAAK;KACT,EACD,OAAO,CACR,CAAC;AACJ,CAAC,CACF,CAAC"}
|
package/dist/VzImg.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VzImgProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* React wrapper for <vz-img>.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <VzImg
|
|
9
|
+
* src="panorama.jpg"
|
|
10
|
+
* format="MONO_360"
|
|
11
|
+
* style={{ width: '100%', aspectRatio: '2/1' }}
|
|
12
|
+
* />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const VzImg: React.ForwardRefExoticComponent<VzImgProps & React.RefAttributes<HTMLElement>>;
|
|
16
|
+
//# sourceMappingURL=VzImg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzImg.d.ts","sourceRoot":"","sources":["../src/VzImg.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,KAAK,gFAoBjB,CAAC"}
|
package/dist/VzImg.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
2
|
+
import { useVizorEvents, buildAttributes, useVizorRef } from './use-vizor-element.js';
|
|
3
|
+
/**
|
|
4
|
+
* React wrapper for <vz-img>.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <VzImg
|
|
9
|
+
* src="panorama.jpg"
|
|
10
|
+
* format="MONO_360"
|
|
11
|
+
* style={{ width: '100%', aspectRatio: '2/1' }}
|
|
12
|
+
* />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export const VzImg = forwardRef(function VzImg(props, forwardedRef) {
|
|
16
|
+
const innerRef = useVizorRef();
|
|
17
|
+
useVizorEvents(innerRef, props);
|
|
18
|
+
useImperativeHandle(forwardedRef, () => innerRef.current, [innerRef]);
|
|
19
|
+
const attrs = buildAttributes(props);
|
|
20
|
+
if (props.src)
|
|
21
|
+
attrs.src = props.src;
|
|
22
|
+
return React.createElement('vz-img', {
|
|
23
|
+
ref: innerRef,
|
|
24
|
+
class: props.className,
|
|
25
|
+
style: props.style,
|
|
26
|
+
...attrs,
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=VzImg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzImg.js","sourceRoot":"","sources":["../src/VzImg.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEtF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAC7B,SAAS,KAAK,CAAC,KAAK,EAAE,YAAY;IAChC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEhC,mBAAmB,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEvE,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,KAAK,CAAC,GAAG;QAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IAErC,OAAO,KAAK,CAAC,aAAa,CACxB,QAAQ,EACR;QACE,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,KAAK,CAAC,SAAS;QACtB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,GAAG,KAAK;KACT,CACF,CAAC;AACJ,CAAC,CACF,CAAC"}
|
package/dist/VzLive.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VzLiveProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* React wrapper for <vz-live>.
|
|
5
|
+
* Live HLS/DASH streaming with live indicator.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <VzLive
|
|
10
|
+
* src="https://stream.example.com/live.m3u8"
|
|
11
|
+
* format="MONO_360"
|
|
12
|
+
* title="Live Concert"
|
|
13
|
+
* style={{ width: '100%', aspectRatio: '16/9' }}
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export interface VzLiveHandle {
|
|
18
|
+
/** Get the underlying <vz-live> element */
|
|
19
|
+
el: HTMLElement | null;
|
|
20
|
+
/** Start playback */
|
|
21
|
+
play: () => void;
|
|
22
|
+
/** Pause playback */
|
|
23
|
+
pause: () => void;
|
|
24
|
+
/** Seek to the live edge */
|
|
25
|
+
seekToLive: () => void;
|
|
26
|
+
}
|
|
27
|
+
export declare const VzLive: React.ForwardRefExoticComponent<VzLiveProps & React.RefAttributes<VzLiveHandle>>;
|
|
28
|
+
//# sourceMappingURL=VzLive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzLive.d.ts","sourceRoot":"","sources":["../src/VzLive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAG9C;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC;IACvB,qBAAqB;IACrB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,qBAAqB;IACrB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,MAAM,kFA8BlB,CAAC"}
|
package/dist/VzLive.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
3
|
+
import { useVizorEvents, buildAttributes, useVizorRef } from './use-vizor-element.js';
|
|
4
|
+
export const VzLive = forwardRef(function VzLive(props, forwardedRef) {
|
|
5
|
+
const innerRef = useVizorRef();
|
|
6
|
+
useVizorEvents(innerRef, props);
|
|
7
|
+
useImperativeHandle(forwardedRef, () => ({
|
|
8
|
+
el: innerRef.current,
|
|
9
|
+
play: () => innerRef.current?.play?.(),
|
|
10
|
+
pause: () => innerRef.current?.pause?.(),
|
|
11
|
+
seekToLive: () => innerRef.current?.seekToLiveEdge?.(),
|
|
12
|
+
}), [innerRef]);
|
|
13
|
+
const attrs = buildAttributes(props);
|
|
14
|
+
if (props.src)
|
|
15
|
+
attrs.src = props.src;
|
|
16
|
+
const sources = props.sources?.map((s, i) => (_jsx("source", { src: s.src, type: s.type, "data-quality": s.quality }, i)));
|
|
17
|
+
return React.createElement('vz-live', {
|
|
18
|
+
ref: innerRef,
|
|
19
|
+
class: props.className,
|
|
20
|
+
style: props.style,
|
|
21
|
+
...attrs,
|
|
22
|
+
}, sources);
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=VzLive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzLive.js","sourceRoot":"","sources":["../src/VzLive.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA2BtF,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAC9B,SAAS,MAAM,CAAC,KAAK,EAAE,YAAY;IACjC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEhC,mBAAmB,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC;QACvC,EAAE,EAAE,QAAQ,CAAC,OAAO;QACpB,IAAI,EAAE,GAAG,EAAE,CAAE,QAAQ,CAAC,OAAe,EAAE,IAAI,EAAE,EAAE;QAC/C,KAAK,EAAE,GAAG,EAAE,CAAE,QAAQ,CAAC,OAAe,EAAE,KAAK,EAAE,EAAE;QACjD,UAAU,EAAE,GAAG,EAAE,CAAE,QAAQ,CAAC,OAAe,EAAE,cAAc,EAAE,EAAE;KAChE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEhB,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,KAAK,CAAC,GAAG;QAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IAErC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAC3C,iBAAgB,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,kBAAgB,CAAC,CAAC,OAAO,IAApD,CAAC,CAAuD,CACtE,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,aAAa,CACxB,SAAS,EACT;QACE,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,KAAK,CAAC,SAAS;QACtB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,GAAG,KAAK;KACT,EACD,OAAO,CACR,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VzPlaylistProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* React wrapper for <vz-playlist>.
|
|
5
|
+
* Container for multiple video elements with auto-advance.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <VzPlaylist autoplay>
|
|
10
|
+
* <VzVideo src="video1.mp4" format="MONO_360" title="Video 1" />
|
|
11
|
+
* <VzVideo src="video2.mp4" format="MONO_FLAT" title="Video 2" />
|
|
12
|
+
* </VzPlaylist>
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const VzPlaylist: React.ForwardRefExoticComponent<VzPlaylistProps & React.RefAttributes<HTMLElement>>;
|
|
16
|
+
//# sourceMappingURL=VzPlaylist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzPlaylist.d.ts","sourceRoot":"","sources":["../src/VzPlaylist.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,qFAkDtB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useEffect } from 'react';
|
|
2
|
+
import { useVizorRef } from './use-vizor-element.js';
|
|
3
|
+
/**
|
|
4
|
+
* React wrapper for <vz-playlist>.
|
|
5
|
+
* Container for multiple video elements with auto-advance.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <VzPlaylist autoplay>
|
|
10
|
+
* <VzVideo src="video1.mp4" format="MONO_360" title="Video 1" />
|
|
11
|
+
* <VzVideo src="video2.mp4" format="MONO_FLAT" title="Video 2" />
|
|
12
|
+
* </VzPlaylist>
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export const VzPlaylist = forwardRef(function VzPlaylist(props, forwardedRef) {
|
|
16
|
+
const innerRef = useVizorRef();
|
|
17
|
+
useImperativeHandle(forwardedRef, () => innerRef.current, [innerRef]);
|
|
18
|
+
// Playlist-specific event listeners
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const el = innerRef.current;
|
|
21
|
+
if (!el)
|
|
22
|
+
return;
|
|
23
|
+
const cleanups = [];
|
|
24
|
+
if (props.onPlaylistChange) {
|
|
25
|
+
const handler = (e) => {
|
|
26
|
+
if (e instanceof CustomEvent) {
|
|
27
|
+
props.onPlaylistChange(e.detail);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
el.addEventListener('vz-playlist-change', handler);
|
|
31
|
+
cleanups.push(() => el.removeEventListener('vz-playlist-change', handler));
|
|
32
|
+
}
|
|
33
|
+
if (props.onPlaylistEnd) {
|
|
34
|
+
const handler = () => props.onPlaylistEnd();
|
|
35
|
+
el.addEventListener('vz-playlist-end', handler);
|
|
36
|
+
cleanups.push(() => el.removeEventListener('vz-playlist-end', handler));
|
|
37
|
+
}
|
|
38
|
+
return () => {
|
|
39
|
+
for (const cleanup of cleanups)
|
|
40
|
+
cleanup();
|
|
41
|
+
};
|
|
42
|
+
}, [innerRef, props.onPlaylistChange, props.onPlaylistEnd]);
|
|
43
|
+
const attrs = {};
|
|
44
|
+
if (props.autoplay)
|
|
45
|
+
attrs.autoplay = '';
|
|
46
|
+
if (props.loopPlaylist)
|
|
47
|
+
attrs['loop-playlist'] = '';
|
|
48
|
+
if (props.panel)
|
|
49
|
+
attrs.panel = props.panel;
|
|
50
|
+
return React.createElement('vz-playlist', {
|
|
51
|
+
ref: innerRef,
|
|
52
|
+
class: props.className,
|
|
53
|
+
style: props.style,
|
|
54
|
+
...attrs,
|
|
55
|
+
}, props.children);
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=VzPlaylist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzPlaylist.js","sourceRoot":"","sources":["../src/VzPlaylist.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAClC,SAAS,UAAU,CAAC,KAAK,EAAE,YAAY;IACrC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,mBAAmB,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEvE,oCAAoC;IACpC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,EAAE;YAAE,OAAO;QAEhB,MAAM,QAAQ,GAAsB,EAAE,CAAC;QAEvC,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;YAC3B,MAAM,OAAO,GAAG,CAAC,CAAQ,EAAE,EAAE;gBAC3B,IAAI,CAAC,YAAY,WAAW,EAAE,CAAC;oBAC7B,KAAK,CAAC,gBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;gBACpC,CAAC;YACH,CAAC,CAAC;YACF,EAAE,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;YACnD,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7E,CAAC;QAED,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;YACxB,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,aAAc,EAAE,CAAC;YAC7C,EAAE,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;YAChD,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,mBAAmB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC;QAC1E,CAAC;QAED,OAAO,GAAG,EAAE;YACV,KAAK,MAAM,OAAO,IAAI,QAAQ;gBAAE,OAAO,EAAE,CAAC;QAC5C,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;IAE5D,MAAM,KAAK,GAAuC,EAAE,CAAC;IACrD,IAAI,KAAK,CAAC,QAAQ;QAAE,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC;IACxC,IAAI,KAAK,CAAC,YAAY;QAAE,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC;IACpD,IAAI,KAAK,CAAC,KAAK;QAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAE3C,OAAO,KAAK,CAAC,aAAa,CACxB,aAAa,EACb;QACE,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,KAAK,CAAC,SAAS;QACtB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,GAAG,KAAK;KACT,EACD,KAAK,CAAC,QAAQ,CACf,CAAC;AACJ,CAAC,CACF,CAAC"}
|
package/dist/VzTour.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VzCommonProps } from './types.js';
|
|
3
|
+
/** Props for the tour element */
|
|
4
|
+
export interface VzTourProps extends Omit<VzCommonProps, 'loop' | 'muted' | 'preload'> {
|
|
5
|
+
/** Tour config URL (JSON) */
|
|
6
|
+
src?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* React wrapper for <vz-tour>.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <VzTour
|
|
14
|
+
* src="/tours/museum.json"
|
|
15
|
+
* format="MONO_360"
|
|
16
|
+
* style={{ width: '100%', aspectRatio: '16/9' }}
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const VzTour: React.ForwardRefExoticComponent<VzTourProps & React.RefAttributes<HTMLElement>>;
|
|
21
|
+
//# sourceMappingURL=VzTour.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzTour.d.ts","sourceRoot":"","sources":["../src/VzTour.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,iCAAiC;AACjC,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IACpF,6BAA6B;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,iFAoBlB,CAAC"}
|
package/dist/VzTour.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
2
|
+
import { useVizorEvents, buildAttributes, useVizorRef } from './use-vizor-element.js';
|
|
3
|
+
/**
|
|
4
|
+
* React wrapper for <vz-tour>.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <VzTour
|
|
9
|
+
* src="/tours/museum.json"
|
|
10
|
+
* format="MONO_360"
|
|
11
|
+
* style={{ width: '100%', aspectRatio: '16/9' }}
|
|
12
|
+
* />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export const VzTour = forwardRef(function VzTour(props, forwardedRef) {
|
|
16
|
+
const innerRef = useVizorRef();
|
|
17
|
+
useVizorEvents(innerRef, props);
|
|
18
|
+
useImperativeHandle(forwardedRef, () => innerRef.current, [innerRef]);
|
|
19
|
+
const attrs = buildAttributes(props);
|
|
20
|
+
if (props.src)
|
|
21
|
+
attrs.src = props.src;
|
|
22
|
+
return React.createElement('vz-tour', {
|
|
23
|
+
ref: innerRef,
|
|
24
|
+
class: props.className,
|
|
25
|
+
style: props.style,
|
|
26
|
+
...attrs,
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=VzTour.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzTour.js","sourceRoot":"","sources":["../src/VzTour.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAQtF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAC9B,SAAS,MAAM,CAAC,KAAK,EAAE,YAAY;IACjC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEhC,mBAAmB,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEvE,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,KAAK,CAAC,GAAG;QAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IAErC,OAAO,KAAK,CAAC,aAAa,CACxB,SAAS,EACT;QACE,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,KAAK,CAAC,SAAS;QACtB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,GAAG,KAAK;KACT,CACF,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VzVideoProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* React wrapper for <vz-video>.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <VzVideo
|
|
9
|
+
* src="video.mp4"
|
|
10
|
+
* format="MONO_360"
|
|
11
|
+
* style={{ width: '100%', aspectRatio: '16/9' }}
|
|
12
|
+
* onReady={() => console.log('ready')}
|
|
13
|
+
* />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const VzVideo: React.ForwardRefExoticComponent<VzVideoProps & React.RefAttributes<HTMLElement>>;
|
|
17
|
+
//# sourceMappingURL=VzVideo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzVideo.d.ts","sourceRoot":"","sources":["../src/VzVideo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,kFAyBnB,CAAC"}
|
package/dist/VzVideo.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { forwardRef, useImperativeHandle } from 'react';
|
|
3
|
+
import { useVizorEvents, buildAttributes, useVizorRef } from './use-vizor-element.js';
|
|
4
|
+
/**
|
|
5
|
+
* React wrapper for <vz-video>.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <VzVideo
|
|
10
|
+
* src="video.mp4"
|
|
11
|
+
* format="MONO_360"
|
|
12
|
+
* style={{ width: '100%', aspectRatio: '16/9' }}
|
|
13
|
+
* onReady={() => console.log('ready')}
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export const VzVideo = forwardRef(function VzVideo(props, forwardedRef) {
|
|
18
|
+
const innerRef = useVizorRef();
|
|
19
|
+
useVizorEvents(innerRef, props);
|
|
20
|
+
useImperativeHandle(forwardedRef, () => innerRef.current, [innerRef]);
|
|
21
|
+
const attrs = buildAttributes(props);
|
|
22
|
+
if (props.src)
|
|
23
|
+
attrs.src = props.src;
|
|
24
|
+
const sources = props.sources?.map((s, i) => (_jsx("source", { src: s.src, type: s.type, "data-quality": s.quality }, i)));
|
|
25
|
+
return React.createElement('vz-video', {
|
|
26
|
+
ref: innerRef,
|
|
27
|
+
class: props.className,
|
|
28
|
+
style: props.style,
|
|
29
|
+
...attrs,
|
|
30
|
+
}, sources);
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=VzVideo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzVideo.js","sourceRoot":"","sources":["../src/VzVideo.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEtF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAC/B,SAAS,OAAO,CAAC,KAAK,EAAE,YAAY;IAClC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEhC,mBAAmB,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEvE,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,KAAK,CAAC,GAAG;QAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IAErC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAC3C,iBAAgB,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,kBAAgB,CAAC,CAAC,OAAO,IAApD,CAAC,CAAuD,CACtE,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,aAAa,CACxB,UAAU,EACV;QACE,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,KAAK,CAAC,SAAS;QACtB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,GAAG,KAAK;KACT,EACD,OAAO,CACR,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-attributes.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/build-attributes.test.ts"],"names":[],"mappings":""}
|