mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
feat(site): add util reference pipeline (#537)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
c11395ece1
commit
78112fbefd
@@ -0,0 +1,24 @@
|
||||
.react-create-player-basic {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.react-create-player-basic video {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.react-create-player-basic__controls {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
.react-create-player-basic__button {
|
||||
padding-block: 8px;
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
backdrop-filter: blur(10px);
|
||||
color: black;
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
border-radius: 9999px;
|
||||
padding-inline: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import { createPlayer, features } from '@videojs/react';
|
||||
import { Video } from '@videojs/react/video';
|
||||
|
||||
import './BasicUsage.css';
|
||||
|
||||
const { Provider, Container, usePlayer } = createPlayer({
|
||||
features: features.video,
|
||||
});
|
||||
|
||||
function Controls() {
|
||||
const store = usePlayer();
|
||||
const paused = usePlayer((s) => s.paused);
|
||||
|
||||
return (
|
||||
<div className="react-create-player-basic__controls">
|
||||
<button
|
||||
type="button"
|
||||
className="react-create-player-basic__button"
|
||||
onClick={() => (paused ? store.play() : store.pause())}
|
||||
>
|
||||
{paused ? 'Play' : 'Pause'}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function BasicUsage() {
|
||||
return (
|
||||
<Provider>
|
||||
<Container className="react-create-player-basic">
|
||||
<Video
|
||||
src="https://stream.mux.com/lhnU49l1VGi3zrTAZhDm9LUUxSjpaPW9BL4jY25Kwo4/highest.mp4"
|
||||
autoPlay
|
||||
muted
|
||||
playsInline
|
||||
/>
|
||||
<Controls />
|
||||
</Container>
|
||||
</Provider>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user