mirror of
https://github.com/immich-app/immich.git
synced 2025-06-23 15:30:51 -04:00
* [web]: support 360 video * lint * lint * fix typing --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
41 lines
962 B
Svelte
41 lines
962 B
Svelte
<script lang="ts">
|
|
import {
|
|
Viewer,
|
|
EquirectangularAdapter,
|
|
type PluginConstructor,
|
|
type AdapterConstructor,
|
|
} from '@photo-sphere-viewer/core';
|
|
import '@photo-sphere-viewer/core/index.css';
|
|
import { onDestroy, onMount } from 'svelte';
|
|
|
|
export let panorama: string | { source: string };
|
|
export let adapter: AdapterConstructor | [AdapterConstructor, unknown] = EquirectangularAdapter;
|
|
export let plugins: (PluginConstructor | [PluginConstructor, unknown])[] = [];
|
|
export let navbar = false;
|
|
|
|
let container: HTMLDivElement;
|
|
let viewer: Viewer;
|
|
|
|
onMount(() => {
|
|
viewer = new Viewer({
|
|
adapter,
|
|
plugins,
|
|
container,
|
|
panorama,
|
|
touchmoveTwoFingers: true,
|
|
mousewheelCtrlKey: false,
|
|
navbar,
|
|
maxFov: 180,
|
|
fisheye: true,
|
|
});
|
|
});
|
|
|
|
onDestroy(() => {
|
|
if (viewer) {
|
|
viewer.destroy();
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<div class="h-full w-full mb-0" bind:this={container} />
|