30 lines
905 B
TypeScript
30 lines
905 B
TypeScript
import { useTranslation } from "react-i18next";
|
|
import { VideoPlayer } from "@/ui/VideoPlayer";
|
|
|
|
const viteBase = import.meta.env.BASE_URL;
|
|
const STREAMING_VIDEO_SRC =
|
|
!viteBase || viteBase === "/"
|
|
? "/videos/streaming.mp4"
|
|
: `${viteBase.replace(/\/$/, "")}/videos/streaming.mp4`;
|
|
|
|
export default function StreamPlayer({ className }: { className?: string }) {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<div className={`w-full ${className ?? ""}`}>
|
|
<VideoPlayer
|
|
src={STREAMING_VIDEO_SRC}
|
|
showMutingBtn
|
|
loop
|
|
autoPlay
|
|
muted
|
|
className="lg:aspect-[1400/640] max-h-dvh md:max-lg:aspect-[736/480] aspect-[340/600]"
|
|
>
|
|
<p className="absolute font-medium md:bottom-6 md:left-6 bottom-4 left-4 lg:max-w-[40%] md:max-lg:max-w-[80%] accent">
|
|
{t("streamPlayer.caption")}
|
|
</p>
|
|
</VideoPlayer>
|
|
</div>
|
|
);
|
|
}
|