@vizor-vr/svelte 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 +29 -0
- package/dist/VzAnnotation.svelte +82 -0
- package/dist/VzAnnotation.svelte.d.ts +42 -0
- package/dist/VzAnnotation.svelte.d.ts.map +1 -0
- package/dist/VzCaption.svelte +44 -0
- package/dist/VzCaption.svelte.d.ts +27 -0
- package/dist/VzCaption.svelte.d.ts.map +1 -0
- package/dist/VzCinema.svelte +119 -0
- package/dist/VzCinema.svelte.d.ts +36 -0
- package/dist/VzCinema.svelte.d.ts.map +1 -0
- package/dist/VzImg.svelte +101 -0
- package/dist/VzImg.svelte.d.ts +29 -0
- package/dist/VzImg.svelte.d.ts.map +1 -0
- package/dist/VzLive.svelte +119 -0
- package/dist/VzLive.svelte.d.ts +36 -0
- package/dist/VzLive.svelte.d.ts.map +1 -0
- package/dist/VzPlaylist.svelte +87 -0
- package/dist/VzPlaylist.svelte.d.ts +26 -0
- package/dist/VzPlaylist.svelte.d.ts.map +1 -0
- package/dist/VzTour.svelte +83 -0
- package/dist/VzTour.svelte.d.ts +23 -0
- package/dist/VzTour.svelte.d.ts.map +1 -0
- package/dist/VzVideo.svelte +135 -0
- package/dist/VzVideo.svelte.d.ts +52 -0
- package/dist/VzVideo.svelte.d.ts.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/vizor-action.d.ts +54 -0
- package/dist/vizor-action.d.ts.map +1 -0
- package/dist/vizor-action.js +67 -0
- package/package.json +59 -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,29 @@
|
|
|
1
|
+
# @vizor-vr/svelte
|
|
2
|
+
|
|
3
|
+
Svelte 5 wrappers for the [Vizor VR player](https://www.npmjs.com/package/@vizor-vr/player). Type-safe components using runes.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @vizor-vr/svelte @vizor-vr/player
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```svelte
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import { VzVideo } from '@vizor-vr/svelte';
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<VzVideo src="video.mp4" format="MONO_360" autoplay on:ready={onReady} />
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The wrappers import and register the underlying custom elements for you. They are client-only — under SvelteKit SSR, guard rendering with `{#if browser}` (from `$app/environment`) since the player requires the browser DOM.
|
|
22
|
+
|
|
23
|
+
## Components
|
|
24
|
+
|
|
25
|
+
`VzVideo`, `VzImg`, `VzTour`, `VzCinema`, `VzLive`, `VzPlaylist`, `VzAnnotation`, `VzCaption`.
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
MIT — see [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
Svelte wrapper for <vz-annotation>.
|
|
4
|
+
|
|
5
|
+
@example
|
|
6
|
+
```svelte
|
|
7
|
+
<script>
|
|
8
|
+
import { VzVideo, VzAnnotation } from '@vizor-vr/svelte';
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<VzVideo src="video.mp4" format="MONO_360">
|
|
12
|
+
<VzAnnotation
|
|
13
|
+
lat={45}
|
|
14
|
+
lon={-90}
|
|
15
|
+
title="Look here"
|
|
16
|
+
icon="info"
|
|
17
|
+
timeStart={5}
|
|
18
|
+
timeEnd={15}
|
|
19
|
+
>
|
|
20
|
+
<p>Popup content</p>
|
|
21
|
+
</VzAnnotation>
|
|
22
|
+
</VzVideo>
|
|
23
|
+
```
|
|
24
|
+
-->
|
|
25
|
+
<script lang="ts">
|
|
26
|
+
import { vizorEvents, type VizorEventHandlers } from './vizor-action.js';
|
|
27
|
+
|
|
28
|
+
/* ---- Props ---- */
|
|
29
|
+
let {
|
|
30
|
+
lat = undefined,
|
|
31
|
+
lon = undefined,
|
|
32
|
+
title = undefined,
|
|
33
|
+
icon = undefined,
|
|
34
|
+
timeStart = undefined,
|
|
35
|
+
timeEnd = undefined,
|
|
36
|
+
sortOrder = undefined,
|
|
37
|
+
style = undefined,
|
|
38
|
+
class: className = undefined,
|
|
39
|
+
children,
|
|
40
|
+
// Event handlers
|
|
41
|
+
onannotationclick = undefined,
|
|
42
|
+
...restProps
|
|
43
|
+
}: {
|
|
44
|
+
lat?: number;
|
|
45
|
+
lon?: number;
|
|
46
|
+
title?: string;
|
|
47
|
+
icon?: string;
|
|
48
|
+
timeStart?: number;
|
|
49
|
+
timeEnd?: number;
|
|
50
|
+
sortOrder?: number;
|
|
51
|
+
style?: string;
|
|
52
|
+
class?: string;
|
|
53
|
+
children?: any;
|
|
54
|
+
} & Pick<VizorEventHandlers, 'onannotationclick'> & Record<string, any> = $props();
|
|
55
|
+
|
|
56
|
+
let el: HTMLElement | undefined = $state();
|
|
57
|
+
|
|
58
|
+
const eventHandlers: VizorEventHandlers = $derived({
|
|
59
|
+
onannotationclick,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export function getElement() { return el; }
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<vz-annotation
|
|
66
|
+
bind:this={el}
|
|
67
|
+
use:vizorEvents={eventHandlers}
|
|
68
|
+
{lat}
|
|
69
|
+
{lon}
|
|
70
|
+
{title}
|
|
71
|
+
{icon}
|
|
72
|
+
time-start={timeStart}
|
|
73
|
+
time-end={timeEnd}
|
|
74
|
+
sort-order={sortOrder}
|
|
75
|
+
{style}
|
|
76
|
+
class={className}
|
|
77
|
+
{...restProps}
|
|
78
|
+
>
|
|
79
|
+
{#if children}
|
|
80
|
+
{@render children()}
|
|
81
|
+
{/if}
|
|
82
|
+
</vz-annotation>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type VizorEventHandlers } from './vizor-action.js';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
lat?: number;
|
|
4
|
+
lon?: number;
|
|
5
|
+
title?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
timeStart?: number;
|
|
8
|
+
timeEnd?: number;
|
|
9
|
+
sortOrder?: number;
|
|
10
|
+
style?: string;
|
|
11
|
+
class?: string;
|
|
12
|
+
children?: any;
|
|
13
|
+
} & Pick<VizorEventHandlers, 'onannotationclick'> & Record<string, any>;
|
|
14
|
+
/**
|
|
15
|
+
* Svelte wrapper for <vz-annotation>.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```svelte
|
|
19
|
+
* <script>
|
|
20
|
+
* import { VzVideo, VzAnnotation } from '@vizor-vr/svelte';
|
|
21
|
+
* </script>
|
|
22
|
+
*
|
|
23
|
+
* <VzVideo src="video.mp4" format="MONO_360">
|
|
24
|
+
* <VzAnnotation
|
|
25
|
+
* lat={45}
|
|
26
|
+
* lon={-90}
|
|
27
|
+
* title="Look here"
|
|
28
|
+
* icon="info"
|
|
29
|
+
* timeStart={5}
|
|
30
|
+
* timeEnd={15}
|
|
31
|
+
* >
|
|
32
|
+
* <p>Popup content</p>
|
|
33
|
+
* </VzAnnotation>
|
|
34
|
+
* </VzVideo>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare const VzAnnotation: import("svelte").Component<$$ComponentProps, {
|
|
38
|
+
getElement: () => HTMLElement | undefined;
|
|
39
|
+
}, "">;
|
|
40
|
+
type VzAnnotation = ReturnType<typeof VzAnnotation>;
|
|
41
|
+
export default VzAnnotation;
|
|
42
|
+
//# sourceMappingURL=VzAnnotation.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzAnnotation.svelte.d.ts","sourceRoot":"","sources":["../src/lib/VzAnnotation.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAExE,KAAK,gBAAgB,GAAI;IACtB,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,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,GAAG,IAAI,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAuC1E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,YAAY;;MAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
Svelte wrapper for caption <track> elements.
|
|
4
|
+
|
|
5
|
+
@example
|
|
6
|
+
```svelte
|
|
7
|
+
<script>
|
|
8
|
+
import { VzVideo, VzCaption } from '@vizor-vr/svelte';
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<VzVideo src="video.mp4" format="MONO_360">
|
|
12
|
+
<VzCaption src="subs-en.vtt" srclang="en" label="English" default />
|
|
13
|
+
<VzCaption src="subs-fr.vtt" srclang="fr" label="French" />
|
|
14
|
+
</VzVideo>
|
|
15
|
+
```
|
|
16
|
+
-->
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
let {
|
|
19
|
+
src,
|
|
20
|
+
srclang,
|
|
21
|
+
label = undefined,
|
|
22
|
+
default: isDefault = undefined,
|
|
23
|
+
...restProps
|
|
24
|
+
}: {
|
|
25
|
+
src: string;
|
|
26
|
+
srclang: string;
|
|
27
|
+
label?: string;
|
|
28
|
+
default?: boolean;
|
|
29
|
+
} & Record<string, any> = $props();
|
|
30
|
+
|
|
31
|
+
let el: HTMLTrackElement | undefined = $state();
|
|
32
|
+
|
|
33
|
+
export function getElement() { return el; }
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<track
|
|
37
|
+
bind:this={el}
|
|
38
|
+
{src}
|
|
39
|
+
srclang={srclang}
|
|
40
|
+
{label}
|
|
41
|
+
default={isDefault}
|
|
42
|
+
kind="subtitles"
|
|
43
|
+
{...restProps}
|
|
44
|
+
/>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
src: string;
|
|
3
|
+
srclang: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
default?: boolean;
|
|
6
|
+
} & Record<string, any>;
|
|
7
|
+
/**
|
|
8
|
+
* Svelte wrapper for caption <track> elements.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```svelte
|
|
12
|
+
* <script>
|
|
13
|
+
* import { VzVideo, VzCaption } from '@vizor-vr/svelte';
|
|
14
|
+
* </script>
|
|
15
|
+
*
|
|
16
|
+
* <VzVideo src="video.mp4" format="MONO_360">
|
|
17
|
+
* <VzCaption src="subs-en.vtt" srclang="en" label="English" default />
|
|
18
|
+
* <VzCaption src="subs-fr.vtt" srclang="fr" label="French" />
|
|
19
|
+
* </VzVideo>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const VzCaption: import("svelte").Component<$$ComponentProps, {
|
|
23
|
+
getElement: () => HTMLTrackElement | undefined;
|
|
24
|
+
}, "">;
|
|
25
|
+
type VzCaption = ReturnType<typeof VzCaption>;
|
|
26
|
+
export default VzCaption;
|
|
27
|
+
//# sourceMappingURL=VzCaption.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzCaption.svelte.d.ts","sourceRoot":"","sources":["../src/lib/VzCaption.svelte.ts"],"names":[],"mappings":"AAGC,KAAK,gBAAgB,GAAI;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAoB1B;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,SAAS;;MAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
Svelte wrapper for <vz-cinema>.
|
|
4
|
+
-->
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { vizorEvents, type VizorEventHandlers } from './vizor-action.js';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
src = undefined,
|
|
10
|
+
format = undefined,
|
|
11
|
+
title = undefined,
|
|
12
|
+
poster = undefined,
|
|
13
|
+
loop = false,
|
|
14
|
+
muted = false,
|
|
15
|
+
preload = undefined,
|
|
16
|
+
apiKey = undefined,
|
|
17
|
+
licenseKey = undefined,
|
|
18
|
+
apiEndpoint = undefined,
|
|
19
|
+
contentId = undefined,
|
|
20
|
+
controlsBehavior = undefined,
|
|
21
|
+
hideControls = false,
|
|
22
|
+
primaryColor = undefined,
|
|
23
|
+
collabServer = undefined,
|
|
24
|
+
collabRoom = undefined,
|
|
25
|
+
collabRole = undefined,
|
|
26
|
+
collabUserId = undefined,
|
|
27
|
+
collabDisplayName = undefined,
|
|
28
|
+
collabPassword = undefined,
|
|
29
|
+
style = undefined,
|
|
30
|
+
class: className = undefined,
|
|
31
|
+
children,
|
|
32
|
+
onready = undefined,
|
|
33
|
+
onplay = undefined,
|
|
34
|
+
onpause = undefined,
|
|
35
|
+
onended = undefined,
|
|
36
|
+
ontimeupdate = undefined,
|
|
37
|
+
onerror = undefined,
|
|
38
|
+
onqualitychange = undefined,
|
|
39
|
+
onfullscreenenter = undefined,
|
|
40
|
+
onfullscreenexit = undefined,
|
|
41
|
+
onxrsessionstart = undefined,
|
|
42
|
+
onxrsessionend = undefined,
|
|
43
|
+
onannotationclick = undefined,
|
|
44
|
+
onorientationchange = undefined,
|
|
45
|
+
onlicensevalidated = undefined,
|
|
46
|
+
oncaptionchange = undefined,
|
|
47
|
+
...restProps
|
|
48
|
+
}: {
|
|
49
|
+
src?: string;
|
|
50
|
+
format?: string;
|
|
51
|
+
title?: string;
|
|
52
|
+
poster?: string;
|
|
53
|
+
loop?: boolean;
|
|
54
|
+
muted?: boolean;
|
|
55
|
+
preload?: 'auto' | 'metadata' | 'none';
|
|
56
|
+
apiKey?: string;
|
|
57
|
+
licenseKey?: string;
|
|
58
|
+
apiEndpoint?: string;
|
|
59
|
+
contentId?: string;
|
|
60
|
+
controlsBehavior?: 'autohide' | 'always' | 'minimal';
|
|
61
|
+
hideControls?: boolean;
|
|
62
|
+
primaryColor?: string;
|
|
63
|
+
collabServer?: string;
|
|
64
|
+
collabRoom?: string;
|
|
65
|
+
collabRole?: 'host' | 'viewer';
|
|
66
|
+
collabUserId?: string;
|
|
67
|
+
collabDisplayName?: string;
|
|
68
|
+
collabPassword?: string;
|
|
69
|
+
style?: string;
|
|
70
|
+
class?: string;
|
|
71
|
+
children?: any;
|
|
72
|
+
} & VizorEventHandlers & Record<string, any> = $props();
|
|
73
|
+
|
|
74
|
+
let el: HTMLElement | undefined = $state();
|
|
75
|
+
|
|
76
|
+
const eventHandlers: VizorEventHandlers = $derived({
|
|
77
|
+
onready, onplay, onpause, onended, ontimeupdate,
|
|
78
|
+
onerror, onqualitychange, onfullscreenenter, onfullscreenexit,
|
|
79
|
+
onxrsessionstart, onxrsessionend, onannotationclick,
|
|
80
|
+
onorientationchange, onlicensevalidated, oncaptionchange,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export function getElement() { return el; }
|
|
84
|
+
export function play() { (el as any)?.play?.(); }
|
|
85
|
+
export function pause() { (el as any)?.pause?.(); }
|
|
86
|
+
export function seek(time: number) { (el as any)?.seek?.(time); }
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<vz-cinema
|
|
90
|
+
bind:this={el}
|
|
91
|
+
use:vizorEvents={eventHandlers}
|
|
92
|
+
{src}
|
|
93
|
+
{format}
|
|
94
|
+
{title}
|
|
95
|
+
{poster}
|
|
96
|
+
loop={loop || undefined}
|
|
97
|
+
muted={muted || undefined}
|
|
98
|
+
{preload}
|
|
99
|
+
api-key={apiKey}
|
|
100
|
+
license-key={licenseKey}
|
|
101
|
+
api-endpoint={apiEndpoint}
|
|
102
|
+
content-id={contentId}
|
|
103
|
+
controls-behavior={controlsBehavior}
|
|
104
|
+
hide-controls={hideControls || undefined}
|
|
105
|
+
primary-color={primaryColor}
|
|
106
|
+
collab-server={collabServer}
|
|
107
|
+
collab-room={collabRoom}
|
|
108
|
+
collab-role={collabRole}
|
|
109
|
+
collab-user-id={collabUserId}
|
|
110
|
+
collab-display-name={collabDisplayName}
|
|
111
|
+
collab-password={collabPassword}
|
|
112
|
+
{style}
|
|
113
|
+
class={className}
|
|
114
|
+
{...restProps}
|
|
115
|
+
>
|
|
116
|
+
{#if children}
|
|
117
|
+
{@render children()}
|
|
118
|
+
{/if}
|
|
119
|
+
</vz-cinema>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type VizorEventHandlers } from './vizor-action.js';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
src?: string;
|
|
4
|
+
format?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
poster?: string;
|
|
7
|
+
loop?: boolean;
|
|
8
|
+
muted?: boolean;
|
|
9
|
+
preload?: 'auto' | 'metadata' | 'none';
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
licenseKey?: string;
|
|
12
|
+
apiEndpoint?: string;
|
|
13
|
+
contentId?: string;
|
|
14
|
+
controlsBehavior?: 'autohide' | 'always' | 'minimal';
|
|
15
|
+
hideControls?: boolean;
|
|
16
|
+
primaryColor?: string;
|
|
17
|
+
collabServer?: string;
|
|
18
|
+
collabRoom?: string;
|
|
19
|
+
collabRole?: 'host' | 'viewer';
|
|
20
|
+
collabUserId?: string;
|
|
21
|
+
collabDisplayName?: string;
|
|
22
|
+
collabPassword?: string;
|
|
23
|
+
style?: string;
|
|
24
|
+
class?: string;
|
|
25
|
+
children?: any;
|
|
26
|
+
} & VizorEventHandlers & Record<string, any>;
|
|
27
|
+
/** Svelte wrapper for <vz-cinema>. */
|
|
28
|
+
declare const VzCinema: import("svelte").Component<$$ComponentProps, {
|
|
29
|
+
getElement: () => HTMLElement | undefined;
|
|
30
|
+
play: () => void;
|
|
31
|
+
pause: () => void;
|
|
32
|
+
seek: (time: number) => void;
|
|
33
|
+
}, "">;
|
|
34
|
+
type VzCinema = ReturnType<typeof VzCinema>;
|
|
35
|
+
export default VzCinema;
|
|
36
|
+
//# sourceMappingURL=VzCinema.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzCinema.svelte.d.ts","sourceRoot":"","sources":["../src/lib/VzCinema.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAExE,KAAK,gBAAgB,GAAI;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;IACrD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,GAAG,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAsE/C,sCAAsC;AACtC,QAAA,MAAM,QAAQ;;;;iBAbS,MAAM;MAayB,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
Svelte wrapper for <vz-img>.
|
|
4
|
+
-->
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { vizorEvents, type VizorEventHandlers } from './vizor-action.js';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
src = undefined,
|
|
10
|
+
format = undefined,
|
|
11
|
+
title = undefined,
|
|
12
|
+
poster = undefined,
|
|
13
|
+
apiKey = undefined,
|
|
14
|
+
licenseKey = undefined,
|
|
15
|
+
apiEndpoint = undefined,
|
|
16
|
+
contentId = undefined,
|
|
17
|
+
controlsBehavior = undefined,
|
|
18
|
+
hideControls = false,
|
|
19
|
+
primaryColor = undefined,
|
|
20
|
+
collabServer = undefined,
|
|
21
|
+
collabRoom = undefined,
|
|
22
|
+
collabRole = undefined,
|
|
23
|
+
collabUserId = undefined,
|
|
24
|
+
collabDisplayName = undefined,
|
|
25
|
+
collabPassword = undefined,
|
|
26
|
+
style = undefined,
|
|
27
|
+
class: className = undefined,
|
|
28
|
+
onready = undefined,
|
|
29
|
+
onplay = undefined,
|
|
30
|
+
onpause = undefined,
|
|
31
|
+
onended = undefined,
|
|
32
|
+
ontimeupdate = undefined,
|
|
33
|
+
onerror = undefined,
|
|
34
|
+
onqualitychange = undefined,
|
|
35
|
+
onfullscreenenter = undefined,
|
|
36
|
+
onfullscreenexit = undefined,
|
|
37
|
+
onxrsessionstart = undefined,
|
|
38
|
+
onxrsessionend = undefined,
|
|
39
|
+
onannotationclick = undefined,
|
|
40
|
+
onorientationchange = undefined,
|
|
41
|
+
onlicensevalidated = undefined,
|
|
42
|
+
oncaptionchange = undefined,
|
|
43
|
+
...restProps
|
|
44
|
+
}: {
|
|
45
|
+
src?: string;
|
|
46
|
+
format?: string;
|
|
47
|
+
title?: string;
|
|
48
|
+
poster?: string;
|
|
49
|
+
apiKey?: string;
|
|
50
|
+
licenseKey?: string;
|
|
51
|
+
apiEndpoint?: string;
|
|
52
|
+
contentId?: string;
|
|
53
|
+
controlsBehavior?: 'autohide' | 'always' | 'minimal';
|
|
54
|
+
hideControls?: boolean;
|
|
55
|
+
primaryColor?: string;
|
|
56
|
+
collabServer?: string;
|
|
57
|
+
collabRoom?: string;
|
|
58
|
+
collabRole?: 'host' | 'viewer';
|
|
59
|
+
collabUserId?: string;
|
|
60
|
+
collabDisplayName?: string;
|
|
61
|
+
collabPassword?: string;
|
|
62
|
+
style?: string;
|
|
63
|
+
class?: string;
|
|
64
|
+
} & VizorEventHandlers & Record<string, any> = $props();
|
|
65
|
+
|
|
66
|
+
let el: HTMLElement | undefined = $state();
|
|
67
|
+
|
|
68
|
+
const eventHandlers: VizorEventHandlers = $derived({
|
|
69
|
+
onready, onplay, onpause, onended, ontimeupdate,
|
|
70
|
+
onerror, onqualitychange, onfullscreenenter, onfullscreenexit,
|
|
71
|
+
onxrsessionstart, onxrsessionend, onannotationclick,
|
|
72
|
+
onorientationchange, onlicensevalidated, oncaptionchange,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export function getElement() { return el; }
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<vz-img
|
|
79
|
+
bind:this={el}
|
|
80
|
+
use:vizorEvents={eventHandlers}
|
|
81
|
+
{src}
|
|
82
|
+
{format}
|
|
83
|
+
{title}
|
|
84
|
+
{poster}
|
|
85
|
+
api-key={apiKey}
|
|
86
|
+
license-key={licenseKey}
|
|
87
|
+
api-endpoint={apiEndpoint}
|
|
88
|
+
content-id={contentId}
|
|
89
|
+
controls-behavior={controlsBehavior}
|
|
90
|
+
hide-controls={hideControls || undefined}
|
|
91
|
+
primary-color={primaryColor}
|
|
92
|
+
collab-server={collabServer}
|
|
93
|
+
collab-room={collabRoom}
|
|
94
|
+
collab-role={collabRole}
|
|
95
|
+
collab-user-id={collabUserId}
|
|
96
|
+
collab-display-name={collabDisplayName}
|
|
97
|
+
collab-password={collabPassword}
|
|
98
|
+
{style}
|
|
99
|
+
class={className}
|
|
100
|
+
{...restProps}
|
|
101
|
+
/>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type VizorEventHandlers } from './vizor-action.js';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
src?: string;
|
|
4
|
+
format?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
poster?: string;
|
|
7
|
+
apiKey?: string;
|
|
8
|
+
licenseKey?: string;
|
|
9
|
+
apiEndpoint?: string;
|
|
10
|
+
contentId?: string;
|
|
11
|
+
controlsBehavior?: 'autohide' | 'always' | 'minimal';
|
|
12
|
+
hideControls?: boolean;
|
|
13
|
+
primaryColor?: string;
|
|
14
|
+
collabServer?: string;
|
|
15
|
+
collabRoom?: string;
|
|
16
|
+
collabRole?: 'host' | 'viewer';
|
|
17
|
+
collabUserId?: string;
|
|
18
|
+
collabDisplayName?: string;
|
|
19
|
+
collabPassword?: string;
|
|
20
|
+
style?: string;
|
|
21
|
+
class?: string;
|
|
22
|
+
} & VizorEventHandlers & Record<string, any>;
|
|
23
|
+
/** Svelte wrapper for <vz-img>. */
|
|
24
|
+
declare const VzImg: import("svelte").Component<$$ComponentProps, {
|
|
25
|
+
getElement: () => HTMLElement | undefined;
|
|
26
|
+
}, "">;
|
|
27
|
+
type VzImg = ReturnType<typeof VzImg>;
|
|
28
|
+
export default VzImg;
|
|
29
|
+
//# sourceMappingURL=VzImg.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VzImg.svelte.d.ts","sourceRoot":"","sources":["../src/lib/VzImg.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAExE,KAAK,gBAAgB,GAAI;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;IACrD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AA2D/C,mCAAmC;AACnC,QAAA,MAAM,KAAK;;MAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
Svelte wrapper for <vz-live>.
|
|
4
|
+
-->
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { vizorEvents, type VizorEventHandlers } from './vizor-action.js';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
src = undefined,
|
|
10
|
+
format = undefined,
|
|
11
|
+
title = undefined,
|
|
12
|
+
poster = undefined,
|
|
13
|
+
loop = false,
|
|
14
|
+
muted = false,
|
|
15
|
+
preload = undefined,
|
|
16
|
+
apiKey = undefined,
|
|
17
|
+
licenseKey = undefined,
|
|
18
|
+
apiEndpoint = undefined,
|
|
19
|
+
contentId = undefined,
|
|
20
|
+
controlsBehavior = undefined,
|
|
21
|
+
hideControls = false,
|
|
22
|
+
primaryColor = undefined,
|
|
23
|
+
collabServer = undefined,
|
|
24
|
+
collabRoom = undefined,
|
|
25
|
+
collabRole = undefined,
|
|
26
|
+
collabUserId = undefined,
|
|
27
|
+
collabDisplayName = undefined,
|
|
28
|
+
collabPassword = undefined,
|
|
29
|
+
style = undefined,
|
|
30
|
+
class: className = undefined,
|
|
31
|
+
children,
|
|
32
|
+
onready = undefined,
|
|
33
|
+
onplay = undefined,
|
|
34
|
+
onpause = undefined,
|
|
35
|
+
onended = undefined,
|
|
36
|
+
ontimeupdate = undefined,
|
|
37
|
+
onerror = undefined,
|
|
38
|
+
onqualitychange = undefined,
|
|
39
|
+
onfullscreenenter = undefined,
|
|
40
|
+
onfullscreenexit = undefined,
|
|
41
|
+
onxrsessionstart = undefined,
|
|
42
|
+
onxrsessionend = undefined,
|
|
43
|
+
onannotationclick = undefined,
|
|
44
|
+
onorientationchange = undefined,
|
|
45
|
+
onlicensevalidated = undefined,
|
|
46
|
+
oncaptionchange = undefined,
|
|
47
|
+
...restProps
|
|
48
|
+
}: {
|
|
49
|
+
src?: string;
|
|
50
|
+
format?: string;
|
|
51
|
+
title?: string;
|
|
52
|
+
poster?: string;
|
|
53
|
+
loop?: boolean;
|
|
54
|
+
muted?: boolean;
|
|
55
|
+
preload?: 'auto' | 'metadata' | 'none';
|
|
56
|
+
apiKey?: string;
|
|
57
|
+
licenseKey?: string;
|
|
58
|
+
apiEndpoint?: string;
|
|
59
|
+
contentId?: string;
|
|
60
|
+
controlsBehavior?: 'autohide' | 'always' | 'minimal';
|
|
61
|
+
hideControls?: boolean;
|
|
62
|
+
primaryColor?: string;
|
|
63
|
+
collabServer?: string;
|
|
64
|
+
collabRoom?: string;
|
|
65
|
+
collabRole?: 'host' | 'viewer';
|
|
66
|
+
collabUserId?: string;
|
|
67
|
+
collabDisplayName?: string;
|
|
68
|
+
collabPassword?: string;
|
|
69
|
+
style?: string;
|
|
70
|
+
class?: string;
|
|
71
|
+
children?: any;
|
|
72
|
+
} & VizorEventHandlers & Record<string, any> = $props();
|
|
73
|
+
|
|
74
|
+
let el: HTMLElement | undefined = $state();
|
|
75
|
+
|
|
76
|
+
const eventHandlers: VizorEventHandlers = $derived({
|
|
77
|
+
onready, onplay, onpause, onended, ontimeupdate,
|
|
78
|
+
onerror, onqualitychange, onfullscreenenter, onfullscreenexit,
|
|
79
|
+
onxrsessionstart, onxrsessionend, onannotationclick,
|
|
80
|
+
onorientationchange, onlicensevalidated, oncaptionchange,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export function getElement() { return el; }
|
|
84
|
+
export function play() { (el as any)?.play?.(); }
|
|
85
|
+
export function pause() { (el as any)?.pause?.(); }
|
|
86
|
+
export function seekToLive() { (el as any)?.seekToLiveEdge?.(); }
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<vz-live
|
|
90
|
+
bind:this={el}
|
|
91
|
+
use:vizorEvents={eventHandlers}
|
|
92
|
+
{src}
|
|
93
|
+
{format}
|
|
94
|
+
{title}
|
|
95
|
+
{poster}
|
|
96
|
+
loop={loop || undefined}
|
|
97
|
+
muted={muted || undefined}
|
|
98
|
+
{preload}
|
|
99
|
+
api-key={apiKey}
|
|
100
|
+
license-key={licenseKey}
|
|
101
|
+
api-endpoint={apiEndpoint}
|
|
102
|
+
content-id={contentId}
|
|
103
|
+
controls-behavior={controlsBehavior}
|
|
104
|
+
hide-controls={hideControls || undefined}
|
|
105
|
+
primary-color={primaryColor}
|
|
106
|
+
collab-server={collabServer}
|
|
107
|
+
collab-room={collabRoom}
|
|
108
|
+
collab-role={collabRole}
|
|
109
|
+
collab-user-id={collabUserId}
|
|
110
|
+
collab-display-name={collabDisplayName}
|
|
111
|
+
collab-password={collabPassword}
|
|
112
|
+
{style}
|
|
113
|
+
class={className}
|
|
114
|
+
{...restProps}
|
|
115
|
+
>
|
|
116
|
+
{#if children}
|
|
117
|
+
{@render children()}
|
|
118
|
+
{/if}
|
|
119
|
+
</vz-live>
|