-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nx-dev): refactor and improve style of video-player (#29749)
- Loading branch information
Showing
10 changed files
with
94 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
'use client'; | ||
import { useRef } from 'react'; | ||
|
||
export function ClientVideo({ | ||
src, | ||
alt, | ||
showControls = false, | ||
autoPlay = true, | ||
loop: explicitLoop, | ||
}: { | ||
src: string; | ||
alt: string; | ||
showControls?: boolean; | ||
autoPlay?: boolean; | ||
loop?: boolean; | ||
}): JSX.Element { | ||
const videoRef = useRef<HTMLVideoElement | null>(null); | ||
const loop = explicitLoop ?? autoPlay; | ||
|
||
return ( | ||
<video | ||
ref={videoRef} | ||
autoPlay={autoPlay} | ||
muted | ||
loop={loop} | ||
playsInline | ||
controls={showControls} | ||
className="m-0 p-0" | ||
> | ||
<source src={src} type="video/mp4" /> | ||
<div className="p-4 text-center"> | ||
<p className="pb-3 font-bold"> | ||
Your browser does not support the video tag. Here is a description of | ||
the video: | ||
</p> | ||
<p>{alt}</p> | ||
</div> | ||
</video> | ||
); | ||
} |
33 changes: 0 additions & 33 deletions
33
nx-dev/ui-markdoc/src/lib/tags/terminal-video.component.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters