PluginProbe
Extendify / 3.1.5
Extendify v3.1.5
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / src / Launch / components / VideoPlayer.jsx

VideoPlayer.jsx in Extendify 3.1.5, at src/Launch/components/VideoPlayer.jsx

33 lines 775 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { useRef, useState } from 'react';
2
3 export const VideoPlayer = ({ path, poster, className = null }) => {
4 const videoRef = useRef();
5 const [playing, setPlaying] = useState(false);
6 return (
7 <div
8 className={`relative ${className}`}
9 style={{
10 backgroundImage: !playing ? `url(${poster})` : 'none',
11 backgroundSize: 'contain',
12 backgroundPosition: 'center',
13 backgroundRepeat: 'no-repeat',
14 }}
15 >
16 <video
17 ref={videoRef}
18 id="video-player"
19 className="h-auto max-h-[min(50vh,400px)] w-full object-contain"
20 playsInline
21 muted
22 autoPlay
23 poster={poster}
24 loop
25 onPlay={() => setPlaying(true)}
26 >
27 <source src={path} type="video/webm" />
28 Your browser does not support the video tag.
29 </video>
30 </div>
31 );
32 };
33