ai-stories-factory / src /lib /utils /parseVideoOrientation.ts
jbilcke-hf's picture
jbilcke-hf HF staff
up
3e3029e
raw
history blame
426 Bytes
import { VideoOrientation } from "@/app/types"
export function parseVideoOrientation(input?: any): VideoOrientation {
const orientation = `${input || ""}`.trim().toLowerCase() || "square"
return (
(orientation === "vertical" || orientation === "portrait") ? VideoOrientation.PORTRAIT
: (orientation === "horizontal" || orientation === "landscape") ? VideoOrientation.LANDSCAPE
: VideoOrientation.SQUARE
)
}