added data-vjs-player and added 2/3 scaling wrapper in event.js

This commit is contained in:
Bernt Christian Egeland 2021-08-19 20:49:31 +02:00
parent c52423206b
commit a5e7ccfa75
2 changed files with 18 additions and 16 deletions

View File

@ -87,7 +87,7 @@ export default function VideoPlayer({ children, options, seekOptions = {}, onRea
}, []); // eslint-disable-line react-hooks/exhaustive-deps }, []); // eslint-disable-line react-hooks/exhaustive-deps
return ( return (
<div className="md:w-2/3 sm:w-full m-auto"> <div data-vjs-player>
<video ref={playerRef} className="video-js vjs-default-skin" controls playsinline /> <video ref={playerRef} className="video-js vjs-default-skin" controls playsinline />
{children} {children}
</div> </div>

View File

@ -119,6 +119,7 @@ export default function Event({ eventId }) {
{data.has_clip ? ( {data.has_clip ? (
<Fragment> <Fragment>
<Heading size="lg">Clip</Heading> <Heading size="lg">Clip</Heading>
<div className="md:w-2/3 sm:w-full m-auto">
<VideoPlayer <VideoPlayer
options={{ options={{
sources: [ sources: [
@ -134,6 +135,7 @@ export default function Event({ eventId }) {
seekOptions={{ forward: 10, back: 5 }} seekOptions={{ forward: 10, back: 5 }}
onReady={(player) => {}} onReady={(player) => {}}
/> />
</div>
<div className="text-center"> <div className="text-center">
<Button <Button
className="mx-2" className="mx-2"