import { getUrl, getNextVod, getPreviousVod, getLocalizedDate } from '@/lib/vods'; import { IVod } from '@/lib/vods'; import Link from 'next/link'; import { VideoInteractive } from './video-interactive'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faChevronLeft, faChevronRight, faGlobe, faImage, faLink } from "@fortawesome/free-solid-svg-icons"; import { notFound } from 'next/navigation'; import { IpfsCid } from './ipfs-cid'; import LinkableHeading from './linkable-heading'; import Image from 'next/image'; import Thumbnail from './thumbnail'; export function getVodTitle(vod: IVod): string { // console.log('lets getVodTitle, ey?') // console.log(JSON.stringify(vod, null, 2)) return vod.attributes?.title || vod.attributes?.announceTitle || `VOD ${vod.id}` // return vod.attributes.title || vod.attributes.announceTitle || (vod.attributes?.date2 && vod.attributes?.vtuber?.data?.attributes?.displayName) ? `${vod.attributes.vtuber.data.attributes.displayName} ${vod.attributes.date2}` : `VOD ${vod.id}`; } export function buildMuxUrl(playbackId: string, token: string) { return `https://stream.mux.com/${playbackId}.m3u8?token=${token}` } export function buildMuxSignedPlaybackId(playbackId: string, token: string) { return `${playbackId}?token=${token}` } export function buildMuxThumbnailUrl(playbackId: string, token: string) { return `https://image.mux.com/${playbackId}/storyboard.vtt?token=${token}` } export default async function VodPage({vod}: { vod: IVod }) { // console.log('vod page helllo') // console.log(vod) if (!vod) notFound(); const slug = vod.attributes.vtuber.data.attributes.slug; const previousVod = await getPreviousVod(vod); const nextVod = await getNextVod(vod); return (
{(vod.attributes.thumbnail) && (
)} {(vod.attributes.videoSrcHash || vod.attributes.video240Hash) && ( <> {vod.attributes.videoSrcHash && ( )} {vod.attributes.video240Hash && ( )} )}
); }