feat: used advanced video player
This commit is contained in:
1 parent
c31058c4f7
commit
0f5ccd185b
12 files changed
+102
-199
No files matched your search
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import List from '@/components/List';
|
import List from '@/components/List';
|
||||||
import NoResults from '@/components/NoResults';
|
import NoResults from '@/components/NoResults';
|
||||||
import { Player } from '@/components/Show/components/Torrents/components/Player';
|
|
||||||
|
|
||||||
import usePopular from './usePopular';
|
import usePopular from './usePopular';
|
||||||
|
|
||||||
@@ -11,15 +10,7 @@ const Container = () => {
|
|||||||
|
|
||||||
if (isFetched && !shows.length) return <NoResults />;
|
if (isFetched && !shows.length) return <NoResults />;
|
||||||
|
|
||||||
return (
|
return <List shows={shows} fetchNextPage={fetchNextPage} />;
|
||||||
<>
|
|
||||||
<Player
|
|
||||||
backdrop='https://image.tmdb.org/t/p/w1280//lgkPzcOSnTvjeMnuFzozRO5HHw1.jpg'
|
|
||||||
magnet='magnet:?xt=urn:btih:8844A64033DA9AC2E94CE5F82FA645297B7F09D3&dn=Despicable%20Me%204&tr=udp://open.demonii.com:1337/announce&tr=udp://tracker.openbittorrent.com:80&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://glotorrents.pw:6969/announce&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://torrent.gresille.org:80/announce&tr=udp://p4p.arenabg.com:1337&tr=udp://tracker.leechers-paradise.org:6969'
|
|
||||||
/>
|
|
||||||
<List shows={shows} fetchNextPage={fetchNextPage} />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Container;
|
export default Container;
|
||||||
+2
-5
@@ -1,15 +1,12 @@
|
|||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
import type { Metadata, Viewport } from 'next';
|
import type { Metadata, Viewport } from 'next';
|
||||||
import { Poppins } from 'next/font/google';
|
|
||||||
import { cookies } from 'next/headers';
|
import { cookies } from 'next/headers';
|
||||||
|
|
||||||
const poppins = Poppins({ subsets: ['latin'], weight: '400' });
|
|
||||||
|
|
||||||
import Header from '@/components/Header';
|
import Header from '@/components/Header';
|
||||||
import Providers from '@/providers';
|
import Providers from '@/providers';
|
||||||
|
import { font } from '@/styles/font';
|
||||||
|
|
||||||
import '@/styles/index.css';
|
import '@/styles/index.css';
|
||||||
import '@/styles/player.css';
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: 'Movie advisor | Discover Your Next Favorite Movie',
|
title: 'Movie advisor | Discover Your Next Favorite Movie',
|
||||||
@@ -33,7 +30,7 @@ const RootLayout = ({ children }: { children: ReactNode }) => {
|
|||||||
<head>
|
<head>
|
||||||
<meta name='theme-color' content='black' />
|
<meta name='theme-color' content='black' />
|
||||||
</head>
|
</head>
|
||||||
<body style={poppins.style}>
|
<body style={font.style}>
|
||||||
<Providers theme={theme}>
|
<Providers theme={theme}>
|
||||||
<div className='sticky top-0 z-20'>
|
<div className='sticky top-0 z-20'>
|
||||||
<Header />
|
<Header />
|
||||||
|
|||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
import { useActiveTextTrack, useCaptionOptions } from '@vidstack/react';
|
||||||
|
import { ClosedCaptionsIcon, ClosedCaptionsOnIcon } from '@vidstack/react/icons';
|
||||||
|
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
|
import PlayerMenu from '../PlayerMenu';
|
||||||
|
|
||||||
|
const CaptionsMenu = () => {
|
||||||
|
const track = useActiveTextTrack(['subtitles']);
|
||||||
|
const tracks = useCaptionOptions();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PlayerMenu
|
||||||
|
options={tracks.map((track) => ({ label: track.label, onClick: () => track.select() }))}
|
||||||
|
isChecked={({ label }) => (label === 'Off' ? !track : label === track?.label)}
|
||||||
|
>
|
||||||
|
{track ? <ClosedCaptionsOnIcon className={cn('vds-icon')} /> : <ClosedCaptionsIcon className={cn('vds-icon')} />}
|
||||||
|
</PlayerMenu>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CaptionsMenu;
|
||||||
+4
-4
@@ -13,17 +13,17 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const PlayerMenu: FC<Props> = ({ children, options, isChecked }) => (
|
const PlayerMenu: FC<Props> = ({ children, options, isChecked }) => (
|
||||||
<Menu.Root className='vds-menu'>
|
<Menu.Root className={cn('vds-menu')}>
|
||||||
<Menu.Button className='vds-menu-button vds-button' aria-label='Settings'>
|
<Menu.Button className={cn('vds-menu-button vds-button')} aria-label='Settings'>
|
||||||
{children}
|
{children}
|
||||||
</Menu.Button>
|
</Menu.Button>
|
||||||
<Menu.Items className='vds-menu-items !p-2' placement='top' offset={0}>
|
<Menu.Items className={cn('vds-menu-items !p-2')} placement='top end' offset={0}>
|
||||||
<Menu.RadioGroup>
|
<Menu.RadioGroup>
|
||||||
{options.map((option) => (
|
{options.map((option) => (
|
||||||
<Menu.Radio
|
<Menu.Radio
|
||||||
key={option.label}
|
key={option.label}
|
||||||
title={option.label}
|
title={option.label}
|
||||||
className='flex w-64 cursor-pointer items-center gap-2 truncate'
|
className='flex w-64 cursor-pointer items-center gap-2 truncate p-2'
|
||||||
onClick={option.onClick}
|
onClick={option.onClick}
|
||||||
>
|
>
|
||||||
<CheckIcon className={cn('vds-icon shrink-0', { invisible: !isChecked(option) })} size={16} />
|
<CheckIcon className={cn('vds-icon shrink-0', { invisible: !isChecked(option) })} size={16} />
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { FC } from 'react';
|
||||||
|
import { PlaylistIcon } from '@vidstack/react/icons';
|
||||||
|
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
|
import PlayerMenu from '../PlayerMenu';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
source: Source;
|
||||||
|
sources: Source[];
|
||||||
|
onChange: (index: number) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const VideosMenu: FC<Props> = ({ sources, source, onChange }) => (
|
||||||
|
<PlayerMenu
|
||||||
|
options={sources.map(({ name }, index) => ({ label: name, onClick: () => onChange(index) }))}
|
||||||
|
isChecked={({ label }) => source.name === label}
|
||||||
|
>
|
||||||
|
<PlaylistIcon className={cn('vds-icon')} />
|
||||||
|
</PlayerMenu>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default VideosMenu;
|
||||||
@@ -1,92 +1,66 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { FC, useRef } from 'react';
|
import { useRef, useState } from 'react';
|
||||||
import { create, InstanceProps } from 'react-modal-promise';
|
import { create, InstanceProps } from 'react-modal-promise';
|
||||||
import {
|
import { MediaPlayer, MediaPlayerInstance, MediaProvider, Poster, Track, VideoSrc } from '@vidstack/react';
|
||||||
MediaPlayer,
|
|
||||||
MediaPlayerInstance,
|
|
||||||
MediaProvider,
|
|
||||||
Poster,
|
|
||||||
Track,
|
|
||||||
useActiveTextTrack,
|
|
||||||
useCaptionOptions,
|
|
||||||
useMediaPlayer,
|
|
||||||
useMediaStore,
|
|
||||||
VideoSrc
|
|
||||||
} from '@vidstack/react';
|
|
||||||
import { ClosedCaptionsIcon, ClosedCaptionsOnIcon, PlaylistIcon } from '@vidstack/react/icons';
|
|
||||||
import { defaultLayoutIcons, DefaultVideoLayout } from '@vidstack/react/player/layouts/default';
|
import { defaultLayoutIcons, DefaultVideoLayout } from '@vidstack/react/player/layouts/default';
|
||||||
|
|
||||||
import { Modal } from '@/components/ui/dialog';
|
import { Modal } from '@/components/ui/dialog';
|
||||||
import { useToast } from '@/hooks/useToast';
|
import { useToast } from '@/hooks/useToast';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
import PlayerMenu from './components/PlayerMenu';
|
import CaptionsMenu from './components/CaptionsMenu';
|
||||||
|
import VideosMenu from './components/VideosMenu';
|
||||||
import useFiles from './useFiles';
|
import useFiles from './useFiles';
|
||||||
|
|
||||||
import '@vidstack/react/player/styles/default/theme.css';
|
import '@vidstack/react/player/styles/default/theme.css';
|
||||||
import '@vidstack/react/player/styles/default/layouts/video.css';
|
import '@vidstack/react/player/styles/default/layouts/video.css';
|
||||||
|
|
||||||
interface Props {
|
interface Props extends InstanceProps<void> {
|
||||||
magnet: string;
|
magnet: string;
|
||||||
backdrop: string;
|
backdrop: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
onClose: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CaptionsMenu = () => {
|
const showPlayer = create(({ onResolve, magnet, backdrop, className }: Props) => {
|
||||||
const track = useActiveTextTrack(['subtitles']);
|
const [index, setIndex] = useState(0);
|
||||||
const tracks = useCaptionOptions();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PlayerMenu
|
|
||||||
options={tracks.map((track) => ({ label: track.label, onClick: () => track.select() }))}
|
|
||||||
isChecked={({ label }) => (label === 'Off' ? !track : label === track?.label)}
|
|
||||||
>
|
|
||||||
{track ? <ClosedCaptionsOnIcon className='vds-icon' /> : <ClosedCaptionsIcon className='vds-icon' />}
|
|
||||||
</PlayerMenu>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const VideosMenu = () => {
|
|
||||||
const player = useMediaPlayer();
|
|
||||||
const { sources, source } = useMediaStore();
|
|
||||||
|
|
||||||
player?.remoteControl.console.log(sources, source);
|
|
||||||
|
|
||||||
return null;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PlayerMenu
|
|
||||||
options={tracks.map((track) => ({ label: track.label, onClick: () => track.select() }))}
|
|
||||||
isChecked={({ label }) => (label === 'Off' ? !track : label === track?.label)}
|
|
||||||
>
|
|
||||||
{track ? <ClosedCaptionsOnIcon className='vds-icon' /> : <ClosedCaptionsIcon className='vds-icon' />}
|
|
||||||
</PlayerMenu>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const Player: FC<Props> = ({ magnet, backdrop, className }) => {
|
|
||||||
const { toast } = useToast();
|
|
||||||
const player = useRef<MediaPlayerInstance>(null);
|
const player = useRef<MediaPlayerInstance>(null);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: { subtitles, videos }
|
data: { subtitles, videos },
|
||||||
|
isFetched
|
||||||
} = useFiles(magnet);
|
} = useFiles(magnet);
|
||||||
|
|
||||||
|
const source = videos[index];
|
||||||
|
|
||||||
|
const { toast } = useToast();
|
||||||
|
|
||||||
|
if (isFetched && !videos.length) {
|
||||||
|
toast({ description: 'This torrent doesn\'t contain any compatible video files' });
|
||||||
|
onResolve();
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<Modal
|
||||||
|
className='relative flex items-center justify-center overflow-hidden rounded-lg border-none bg-black p-0'
|
||||||
|
style={{ aspectRatio: '16/9' }}
|
||||||
|
onClose={onResolve}
|
||||||
|
>
|
||||||
<MediaPlayer
|
<MediaPlayer
|
||||||
ref={player}
|
|
||||||
autoPlay
|
autoPlay
|
||||||
load='eager'
|
load='eager'
|
||||||
storage='movie-advisor'
|
|
||||||
posterLoad='eager'
|
posterLoad='eager'
|
||||||
|
storage='movie-advisor'
|
||||||
aspectRatio='16/9'
|
aspectRatio='16/9'
|
||||||
src={videos as VideoSrc[]}
|
ref={player}
|
||||||
|
src={(source as VideoSrc) || []}
|
||||||
className={cn('size-full', className)}
|
className={cn('size-full', className)}
|
||||||
poster={backdrop}
|
poster={backdrop}
|
||||||
>
|
>
|
||||||
<MediaProvider>
|
<MediaProvider>
|
||||||
<Poster className='vds-poster' src={backdrop} />
|
<Poster className={cn('vds-poster')} src={backdrop} />
|
||||||
{subtitles.map((track) => (
|
{subtitles.map((track) => (
|
||||||
<Track key={track.name} src={track.src} kind='subtitles' label={track.name} type='srt' default />
|
<Track key={track.name} src={track.src} kind='subtitles' label={track.name} type='srt' default />
|
||||||
))}
|
))}
|
||||||
@@ -98,22 +72,13 @@ export const Player: FC<Props> = ({ magnet, backdrop, className }) => {
|
|||||||
settingsMenu: null,
|
settingsMenu: null,
|
||||||
captionButton: null,
|
captionButton: null,
|
||||||
googleCastButton: null,
|
googleCastButton: null,
|
||||||
beforeSettingsMenu: Boolean(videos.length) && <VideosMenu />,
|
beforeSettingsMenu: Boolean(videos.length > 1) && (
|
||||||
|
<VideosMenu source={source} sources={videos} onChange={setIndex} />
|
||||||
|
),
|
||||||
afterSettingsMenu: Boolean(subtitles.length) && <CaptionsMenu />
|
afterSettingsMenu: Boolean(subtitles.length) && <CaptionsMenu />
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</MediaPlayer>
|
</MediaPlayer>
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const showPlayer = create(({ onResolve, magnet, backdrop, className }: Props & InstanceProps<void>) => {
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
className='relative flex items-center justify-center overflow-hidden rounded-lg border-none bg-black p-0'
|
|
||||||
style={{ aspectRatio: '16/9' }}
|
|
||||||
onClose={onResolve}
|
|
||||||
>
|
|
||||||
<Player className={className} backdrop={backdrop} magnet={magnet} />
|
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Generated
+1
-75
@@ -39,15 +39,13 @@
|
|||||||
"tailwind-merge": "^1.14.0",
|
"tailwind-merge": "^1.14.0",
|
||||||
"tailwindcss-animate": "^1.0.6",
|
"tailwindcss-animate": "^1.0.6",
|
||||||
"typescript": "5.1.6",
|
"typescript": "5.1.6",
|
||||||
"vaul": "^0.8.9",
|
"vaul": "^0.8.9"
|
||||||
"video-react": "^0.16.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/js-cookie": "^3.0.3",
|
"@types/js-cookie": "^3.0.3",
|
||||||
"@types/node": "20.4.4",
|
"@types/node": "20.4.4",
|
||||||
"@types/react": "18.2.15",
|
"@types/react": "18.2.15",
|
||||||
"@types/react-dom": "18.2.7",
|
"@types/react-dom": "18.2.7",
|
||||||
"@types/video-react": "^0.15.8",
|
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||||
"eslint-plugin-tailwindcss": "^3.17.4",
|
"eslint-plugin-tailwindcss": "^3.17.4",
|
||||||
@@ -2121,15 +2119,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz",
|
||||||
"integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ=="
|
"integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/video-react": {
|
|
||||||
"version": "0.15.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/video-react/-/video-react-0.15.8.tgz",
|
|
||||||
"integrity": "sha512-ZFm57z6bwJ1FWMKAMXyDar0OAQCchals2T4mDG//JXeToW3C2dADI2MzX5y53tFL77Y2QAA1YQZh5XTL1rjiqw==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@types/react": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@typescript-eslint/parser": {
|
"node_modules/@typescript-eslint/parser": {
|
||||||
"version": "5.62.0",
|
"version": "5.62.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz",
|
||||||
@@ -5104,11 +5093,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
|
||||||
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="
|
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="
|
||||||
},
|
},
|
||||||
"node_modules/lodash.throttle": {
|
|
||||||
"version": "4.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz",
|
|
||||||
"integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ=="
|
|
||||||
},
|
|
||||||
"node_modules/loose-envify": {
|
"node_modules/loose-envify": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
|
||||||
@@ -6006,14 +5990,6 @@
|
|||||||
"node": ">=8.10.0"
|
"node": ">=8.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/redux": {
|
|
||||||
"version": "4.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz",
|
|
||||||
"integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==",
|
|
||||||
"dependencies": {
|
|
||||||
"@babel/runtime": "^7.9.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/reflect.getprototypeof": {
|
"node_modules/reflect.getprototypeof": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz",
|
||||||
@@ -7010,22 +6986,6 @@
|
|||||||
"react-dom": "^16.8 || ^17.0 || ^18.0"
|
"react-dom": "^16.8 || ^17.0 || ^18.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/video-react": {
|
|
||||||
"version": "0.16.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/video-react/-/video-react-0.16.0.tgz",
|
|
||||||
"integrity": "sha512-138NHPS8bmgqCYVCdbv2GVFhXntemNHWGw9AN8iJSzr3jizXMmWJd2LTBppr4hZJUbyW1A1tPZ3CQXZUaexMVA==",
|
|
||||||
"dependencies": {
|
|
||||||
"@babel/runtime": "^7.4.5",
|
|
||||||
"classnames": "^2.2.6",
|
|
||||||
"lodash.throttle": "^4.1.1",
|
|
||||||
"prop-types": "^15.7.2",
|
|
||||||
"redux": "^4.0.1"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
|
|
||||||
"react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/which": {
|
"node_modules/which": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
@@ -8330,15 +8290,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz",
|
||||||
"integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ=="
|
"integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ=="
|
||||||
},
|
},
|
||||||
"@types/video-react": {
|
|
||||||
"version": "0.15.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/video-react/-/video-react-0.15.8.tgz",
|
|
||||||
"integrity": "sha512-ZFm57z6bwJ1FWMKAMXyDar0OAQCchals2T4mDG//JXeToW3C2dADI2MzX5y53tFL77Y2QAA1YQZh5XTL1rjiqw==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@types/react": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@typescript-eslint/parser": {
|
"@typescript-eslint/parser": {
|
||||||
"version": "5.62.0",
|
"version": "5.62.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz",
|
||||||
@@ -10388,11 +10339,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
|
||||||
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="
|
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="
|
||||||
},
|
},
|
||||||
"lodash.throttle": {
|
|
||||||
"version": "4.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz",
|
|
||||||
"integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ=="
|
|
||||||
},
|
|
||||||
"loose-envify": {
|
"loose-envify": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
|
||||||
@@ -10956,14 +10902,6 @@
|
|||||||
"picomatch": "^2.2.1"
|
"picomatch": "^2.2.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"redux": {
|
|
||||||
"version": "4.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz",
|
|
||||||
"integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==",
|
|
||||||
"requires": {
|
|
||||||
"@babel/runtime": "^7.9.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"reflect.getprototypeof": {
|
"reflect.getprototypeof": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz",
|
||||||
@@ -11619,18 +11557,6 @@
|
|||||||
"@radix-ui/react-dialog": "^1.0.4"
|
"@radix-ui/react-dialog": "^1.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"video-react": {
|
|
||||||
"version": "0.16.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/video-react/-/video-react-0.16.0.tgz",
|
|
||||||
"integrity": "sha512-138NHPS8bmgqCYVCdbv2GVFhXntemNHWGw9AN8iJSzr3jizXMmWJd2LTBppr4hZJUbyW1A1tPZ3CQXZUaexMVA==",
|
|
||||||
"requires": {
|
|
||||||
"@babel/runtime": "^7.4.5",
|
|
||||||
"classnames": "^2.2.6",
|
|
||||||
"lodash.throttle": "^4.1.1",
|
|
||||||
"prop-types": "^15.7.2",
|
|
||||||
"redux": "^4.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"which": {
|
"which": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
|
|||||||
+1
-3
@@ -40,15 +40,13 @@
|
|||||||
"tailwind-merge": "^1.14.0",
|
"tailwind-merge": "^1.14.0",
|
||||||
"tailwindcss-animate": "^1.0.6",
|
"tailwindcss-animate": "^1.0.6",
|
||||||
"typescript": "5.1.6",
|
"typescript": "5.1.6",
|
||||||
"vaul": "^0.8.9",
|
"vaul": "^0.8.9"
|
||||||
"video-react": "^0.16.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/js-cookie": "^3.0.3",
|
"@types/js-cookie": "^3.0.3",
|
||||||
"@types/node": "20.4.4",
|
"@types/node": "20.4.4",
|
||||||
"@types/react": "18.2.15",
|
"@types/react": "18.2.15",
|
||||||
"@types/react-dom": "18.2.7",
|
"@types/react-dom": "18.2.7",
|
||||||
"@types/video-react": "^0.15.8",
|
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||||
"eslint-plugin-tailwindcss": "^3.17.4",
|
"eslint-plugin-tailwindcss": "^3.17.4",
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { Poppins } from 'next/font/google';
|
||||||
|
|
||||||
|
export const font = Poppins({ subsets: ['latin'], variable: '--font-family', weight: '400' });
|
||||||
+6
-2
@@ -2,8 +2,6 @@
|
|||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
@import url('video-react/dist/video-react.css');
|
|
||||||
|
|
||||||
@layer base {
|
@layer base {
|
||||||
:root {
|
:root {
|
||||||
--background: 0 0% 100%;
|
--background: 0 0% 100%;
|
||||||
@@ -89,6 +87,12 @@
|
|||||||
body {
|
body {
|
||||||
@apply bg-background text-foreground;
|
@apply bg-background text-foreground;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:where(.vds-time),
|
||||||
|
:where(.vds-menu-items),
|
||||||
|
:where(.vds-video-layout) {
|
||||||
|
--media-font-family: var(--font-family);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@layer utilities {
|
@layer utilities {
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
.video-react,
|
|
||||||
.video-react-menu .video-react-menu-content,
|
|
||||||
.video-react-control-text {
|
|
||||||
font-family: system-ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-react .video-react-menu-button-popup .video-react-menu {
|
|
||||||
right: 0;
|
|
||||||
left: auto;
|
|
||||||
width: 200px;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-react-menu li {
|
|
||||||
padding-inline: 0.5rem;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
max-width: 100%;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-react-menu li:first-child {
|
|
||||||
border-top-left-radius: 4px;
|
|
||||||
border-top-right-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-react .video-react-big-play-button.video-react-big-play-button-center {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-react .video-react-menu-button-popup .video-react-menu .video-react-menu-content {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
+8
-1
@@ -87,5 +87,12 @@ module.exports = {
|
|||||||
corePlugins: {
|
corePlugins: {
|
||||||
aspectRatio: false
|
aspectRatio: false
|
||||||
},
|
},
|
||||||
plugins: [require('tailwindcss-animate'), require('tailwindcss-touch')()]
|
plugins: [
|
||||||
|
require('tailwindcss-animate'),
|
||||||
|
require('tailwindcss-touch')(),
|
||||||
|
require('@vidstack/react/tailwind.cjs')({
|
||||||
|
selector: '.media-player',
|
||||||
|
prefix: 'media'
|
||||||
|
})
|
||||||
|
]
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user