// One slide as a TV shows it (plan step 5.6a): picture, video, text or menu board. Used by the // player (terminal) and the manager's previews. Needs a parent with `container-type: size`. // media(id) → { src, url, kind, width, height } | null (src: the address or the TV's kept copy) import { useEffect, useRef } from 'react' import { MenuSlide, TextSlide } from './Slides.jsx' export function SlideView({ slide, media, venue, now, pages, page, onEnded, playing = true }) { return ( <> {slide.kind === 'image' && } {slide.kind === 'video' && } {slide.kind === 'text' && } {slide.kind === 'menu' && } ) } function ImageSlide({ content, media }) { const m = content.media_id ? media(content.media_id) : null return (
{m && }
) } function VideoSlide({ slide, media, onEnded, playing }) { const c = slide.content || {} const m = c.media_id ? media(c.media_id) : null const ref = useRef(null) useEffect(() => { const v = ref.current if (!v) return if (playing) v.play?.().catch(() => {}) else v.pause?.() }, [m?.src, playing]) return (
{m &&
) }