Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
¿Cómo puedo mostrar un esqueleto mientras se carga el video?

Quiero mostrar un esqueleto/marcador de posición antes de que se cargue el contenido de video completo, pero no sé cómo captar ese evento. Actualmente, primero se muestra un reproductor predeterminado y luego se muestra el video real (con diferentes dimensiones).

Este es mi componente.

 const Video = ({ src, type }) => { const videoRef = useRef(); return ( <video ref={videoRef} autoPlay loop controls> <source src={src} type={type} /> </video> ); }; export default Video;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

 //You will need a skeleton component that has a similar //structure to the component you're trying to load. The //implementation goes as follow. //1. Import your skeleton component inside your video component import VideoSkeleton from 'Video Skeleton module'; //2. add a fetch listener prop to your video component const Video = ({ src, type, isLoading }) => { // the rest of your code. }; export default Video; //3. based on the isLoading prop show the skeleton componet or the video component using the following logic const Video = ({ src, type, isLoading }) => { const videoRef = useRef(); return ( <div> { isLoading && <VideoSkeleton/> !isLaoding && <video ref={videoRef} autoPlay = { loop } controls = { controlles value } source = {src} type = {type} </video> } </div> )

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!