@@ -8,6 +8,7 @@ import Image from "next/image";
|
||||
import Script from "next/script";
|
||||
import { ArrowLeft, CheckCircle2, Zap, LayoutDashboard, Cpu, PencilRuler, Factory, MapPin, ChevronDown, Play, FileText, Box, Loader2, Maximize, X, ChevronLeft, ChevronRight } from "lucide-react";
|
||||
import BreathingField from "@/components/visuals/BreathingField";
|
||||
import AutoPlayVideo from "@/components/AutoPlayVideo";
|
||||
|
||||
// 🔥 EL TRUCO DEFINITIVO PARA TYPESCRIPT Y WEB COMPONENTS 🔥
|
||||
// Al asignar el string a una variable con 'as any', TypeScript deja de
|
||||
@@ -467,7 +468,7 @@ const renderMarkdown = (text: string, onImageClick: (url: string) => void) => {
|
||||
</div>
|
||||
<div className="aspect-video">
|
||||
{isLocalMp4 ? (
|
||||
<video src={videoSrc} controls playsInline preload="metadata" className="w-full h-full object-contain" />
|
||||
<AutoPlayVideo src={videoSrc} className="w-full h-full object-contain" />
|
||||
) : (
|
||||
<iframe src={videoSrc} className="w-full h-full" allowFullScreen title="Embedded video" />
|
||||
)}
|
||||
@@ -887,7 +888,7 @@ function ExpandedCaseStudy({ node }: { node: any }) {
|
||||
return (
|
||||
<div key={`v-${idx}`} className="relative w-full aspect-video rounded-2xl md:rounded-3xl overflow-hidden border border-black/10 dark:border-white/10 shadow-xl bg-black col-span-1 md:col-span-2">
|
||||
{isLocalMp4 ? (
|
||||
<video src={videoSrc} controls playsInline preload="metadata" className="absolute inset-0 w-full h-full object-contain" />
|
||||
<AutoPlayVideo src={videoSrc} className="absolute inset-0 w-full h-full object-contain" />
|
||||
) : (
|
||||
<iframe src={videoSrc} className="absolute inset-0 w-full h-full" allowFullScreen title={`Video ${idx + 1}`} />
|
||||
)}
|
||||
|
||||
@@ -5,6 +5,7 @@ import Image from "next/image";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { ArrowLeft } from "lucide-react";
|
||||
import BreathingField from "@/components/visuals/BreathingField";
|
||||
import AutoPlayVideo from "@/components/AutoPlayVideo";
|
||||
|
||||
// 🔥 IMPORTACIONES DE IDIOMAS
|
||||
import { getLocalizedData } from "@/lib/i18nHelper";
|
||||
@@ -145,7 +146,7 @@ const renderMarkdown = (text: string) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const ulMatch = trimmed.match(/^[-*]\s*(.*)/);
|
||||
const ulMatch = trimmed.match(/^[-*]\s+(.*)/);
|
||||
if (ulMatch) {
|
||||
isOrderedList = false;
|
||||
listItems.push(<li key={idx} className="leading-relaxed pl-2">{parseInline(ulMatch[1])}</li>);
|
||||
@@ -242,17 +243,13 @@ export default async function HeritagePage({ params }: { params: Promise<{ local
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 🔥 BLOQUE DE VIDEO NATIVO (MP4 LOCAL) 🔥 */}
|
||||
{/* 🔥 BLOQUE DE VIDEO NATIVO (MP4 LOCAL) — AUTOPLAY ON SCROLL 🔥 */}
|
||||
{sec.type === 'video' && sec.mediaUrl && (
|
||||
<div className="relative w-full aspect-video rounded-3xl overflow-hidden border border-white/10 shadow-2xl bg-black">
|
||||
<video
|
||||
src={`/heritage/videos/${sec.mediaUrl}`}
|
||||
className="absolute inset-0 w-full h-full object-cover"
|
||||
autoPlay
|
||||
loop
|
||||
muted
|
||||
playsInline
|
||||
controls
|
||||
<AutoPlayVideo
|
||||
src={`/heritage/videos/${sec.mediaUrl}`}
|
||||
className="absolute inset-0 w-full h-full object-cover"
|
||||
loop
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -263,4 +260,4 @@ export default async function HeritagePage({ params }: { params: Promise<{ local
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { X, Wrench, ShoppingBag, ChevronLeft, ChevronRight, Tag, Info, Play, Loc
|
||||
import { useState } from "react";
|
||||
import { useUIStore } from "@/lib/store/uiStore";
|
||||
import { useTranslations } from "next-intl";
|
||||
import AutoPlayVideo from "@/components/AutoPlayVideo";
|
||||
|
||||
// 🔥 IMPORTAMOS TU SUPER PARSER
|
||||
import { renderMarkdown } from "@/lib/markdownParser";
|
||||
@@ -73,9 +74,8 @@ export default function PartDetailsModal({ part, isOpen, onClose }: PartDetailsM
|
||||
{media.length > 0 ? (
|
||||
<>
|
||||
{media[currentMediaIdx].endsWith('.mp4') || media[currentMediaIdx].endsWith('.mov') ? (
|
||||
<video
|
||||
<AutoPlayVideo
|
||||
src={`/parts/${part.sku.toLowerCase()}/${media[currentMediaIdx]}`}
|
||||
controls
|
||||
className="w-full h-full object-contain"
|
||||
/>
|
||||
) : (
|
||||
@@ -199,4 +199,4 @@ export default function PartDetailsModal({ part, isOpen, onClose }: PartDetailsM
|
||||
)}
|
||||
</AnimatePresence>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user