File size: 952 Bytes
f27679f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"use client"

import { Player } from "react-tuby"
import "react-tuby/css/main.css"

import { cn } from "@/lib/utils"
import { VideoInfo } from "@/types"

export function VideoPlayer({
  video,
  className = ""
 }: {
  video?: VideoInfo
  className?: string
}) {

  // TODO: keep the same form factor?
  if (!video) { return null }

  return (
    <div className={cn(
      `w-full`,
      `flex flex-col items-center justify-center`,
      `rounded-xl overflow-hidden`,
      className
      )}>
      <div className={cn(
        `w-[calc(100%+16px)]`,
        `-ml-2 -mr-2`,
        `flex flex-col items-center justify-center`,
        )}>
        <Player
        
          src={[
            {
              quality: "Full HD",
              url: video.assetUrl,
            }
          ]}
          subtitles={[]}
          // poster="https://cdn.jsdelivr.net/gh/naptestdev/video-examples@master/poster.png"
        />
      </div>
    </div>
  )
}