Ir al contenido

co-video

Reproductor de video con barra de controles personalizada y ampliamente configurable: relación de aspecto, radios, autoocultado de controles, velocidad de reproducción, Picture-in-Picture, descarga y umbral de visualización. Cada control puede mostrarse u ocultarse de forma independiente.

Ver código
<co-video src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" poster="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/BigBuckBunny.jpg" aspect-ratio="16:9" rounded="lg"></co-video>

Props

PropAtributoTipoDefaultDescripción
allowDownloadallow-downloadbooleanfalseEnable download functionality
aspectRatioaspect-ratio"16:9" | "1:1" | "21:9" | "4:3" | "auto"'16:9'Container aspect ratio
autoplayautoplaybooleanfalseAuto-start playback (requires muted for browser autoplay)
controlscontrolsbooleantrueMaster toggle for custom control bar
controlsAutoHidecontrols-auto-hidebooleantrueAuto-hide controls after inactivity
controlsAutoHideDelaycontrols-auto-hide-delaynumber3000Milliseconds before controls hide
currentTimecurrent-timenumber0Current playback position in seconds (enables resume)
disableddisabledbooleanfalseDisabled state
localelocale"en" | "es" | "pt"'es'Language for labels and aria attributes
looploopbooleanfalseLoop playback
mutedmutedbooleanfalseMuted state
playbackRateplayback-ratenumber1Playback speed
playbackRatesplayback-ratesstring'[0.5, 0.75, 1, 1.25, 1.5, 2]'Available playback speeds (JSON array string)
posterposterstring''Poster/thumbnail image URL
preloadpreload"auto" | "metadata" | "none"'metadata'Preload behavior
roundedrounded"lg" | "md" | "none" | "sm" | "xl"'lg'Border radius
showDownloadshow-downloadbooleanfalseShow download button
showFullscreenshow-fullscreenbooleantrueShow fullscreen button
showPipshow-pipbooleanfalseShow Picture-in-Picture button
showPlayshow-playbooleantrueShow play/pause button
showProgressshow-progressbooleantrueShow progress/seek bar
showSpeedshow-speedbooleanfalseShow playback speed selector
showTimeshow-timebooleantrueShow time display
showVolumeshow-volumebooleantrueShow volume controls
srcsrcstring''Video source URL
typetypestring''MIME type hint
volumevolumenumber1Initial volume (0-1)
watchThresholdwatch-thresholdnumber0Progress percentage (0-100) that triggers coThresholdReached. 0 = disabled

Eventos

EventoDetailBubblesCancelableDescripción
coDownload{ src: string; }
coEndedvoid
coError{ code: number; message: string; }
coFullscreenChange{ fullscreen: boolean; }
coPausevoid
coPipChange{ pip: boolean; }
coPlayvoid
coPlaybackRateChange{ rate: number; }
coReady{ duration: number; }
coSeeked{ from: number; to: number; }
coThresholdReached{ threshold: number; currentTime: number; duration: number; }
coTimeUpdate{ currentTime: number; duration: number; progressPercent: number; }
coVolumeChange{ volume: number; muted: boolean; }

Slots

SlotDescripción
(default)Default slot (unused, reserved for future captions/overlays)

CSS Parts

PartDescripción
::part(big-play)
::part(container)
::part(controls)
::part(poster)
::part(progress)
::part(toolbar)
::part(video)

CSS Custom Properties

Este componente no expone CSS custom properties.