import {useMount} from "ahooks";
import {getLiveUrl} from "@/service/api/live.ts";
import React, {useState} from "react";
import {Player} from "@/components/video/player.tsx";
import './style.scss'

export default function LivePlayer() {
	const [liveUrl, setLiveUrl] = useState<string>('http://fm.live.starbitech.com/fm/prod_fm.flv')
	useMount(async ()=>{
		getLiveUrl().then((ret)=>{
			setLiveUrl(ret.flv_url)
		})
	})
  return <div className="live-player-wrapper ">
	  <Player showControls url={liveUrl} className={'h-screen'} />
  </div>
}