This commit is contained in:
Ren Amamiya
2023-10-04 14:11:45 +07:00
parent 480580890e
commit f80dd78a8e
14 changed files with 165 additions and 176 deletions

View File

@@ -1,5 +1,10 @@
import { NDKEvent } from '@nostr-dev-kit/ndk';
import { MediaPlayer, MediaProvider } from '@vidstack/react';
import { MediaPlayer, MediaProvider, Poster } from '@vidstack/react';
import {
DefaultAudioLayout,
DefaultVideoLayout,
defaultLayoutIcons,
} from '@vidstack/react/player/layouts/default';
import { Link } from 'react-router-dom';
import { Image } from '@shared/image';
@@ -31,9 +36,27 @@ export function FileNote(props: { event?: NDKEvent }) {
poster={`https://thumbnail.video/api/get?url=${url}&seconds=1`}
load="visible"
aspectRatio="16/9"
muted={true}
crossorigin=""
className="player"
>
<MediaProvider />
<MediaProvider>
<Poster
className="vds-poster"
src="https://thumbnail.video/api/get?url=${url}&seconds=1"
alt={url}
/>
</MediaProvider>
<DefaultAudioLayout
icons={defaultLayoutIcons}
smallLayoutWhen="(width < 500) or (height < 380)"
noModal={true}
/>
<DefaultVideoLayout
icons={defaultLayoutIcons}
smallLayoutWhen="(width < 500) or (height < 380)"
noModal={true}
/>
</MediaPlayer>
</div>
);