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 }) {
  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">
          GRAFF.estate — модуль удаленной демонстрации — доступен на&nbsp;любых
          устройствах, для&nbsp;демонстрации нужен только интернет
        </p>
      </VideoPlayer>
    </div>
  );
}
