Live video on the AT Protocol
at eli/rtmp-push 18 lines 426 B view raw
1import { useLivestreamStore } from "../livestream-store"; 2 3export function useSegmentDimensions() { 4 const latestSegment = useLivestreamStore((x) => x.segment); 5 6 let seg = latestSegment?.video && latestSegment.video[0]; 7 8 let ratio = { 9 height: seg?.height || 0, 10 width: seg?.width || 0, 11 }; 12 13 return { 14 isPlayerRatioGreater: ratio.width > ratio.height, 15 height: ratio.height, 16 width: ratio.width, 17 }; 18}