video autoplay muted loop playsinline preload=none com poster; as fontes entram via IntersectionObserver e o video pausa fora da tela. Com prefers-reduced-motion aparece so o poster. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
35 lines
892 B
TypeScript
35 lines
892 B
TypeScript
/**
|
|
* Vídeos de rolagem dos projetos: public/videos/<id>/desktop.{webm,mp4,webp}.
|
|
* Gravados com scripts/record-project-videos.mjs; só entram aqui os ids que têm os três arquivos.
|
|
*/
|
|
export interface ProjectVideoAsset {
|
|
poster: string;
|
|
width: number;
|
|
height: number;
|
|
sources: Array<{ src: string; type: string }>;
|
|
}
|
|
|
|
export const PROJECT_VIDEO_IDS = [
|
|
"sev-modaintima",
|
|
"lavacao-047",
|
|
"nutriscan",
|
|
"sc-plus",
|
|
"as-servicos",
|
|
] as const;
|
|
|
|
const recorded = new Set<string>(PROJECT_VIDEO_IDS);
|
|
|
|
export function getProjectVideo(id: string): ProjectVideoAsset | undefined {
|
|
if (!recorded.has(id)) return undefined;
|
|
const base = `/videos/${id}/desktop`;
|
|
return {
|
|
poster: `${base}.webp`,
|
|
width: 1440,
|
|
height: 900,
|
|
sources: [
|
|
{ src: `${base}.webm`, type: 'video/webm; codecs="vp9"' },
|
|
{ src: `${base}.mp4`, type: "video/mp4" },
|
|
],
|
|
};
|
|
}
|