Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

191
Visualizações
Whats the best way to avoid reloading videos when using the same source in different components or pages?

Is there an option in Javascript, React, or Next JS to optimize loading performance when using the same video resource in different components on different pages on the site (to avoid reloading)? Something like keeping the videos that have been loaded in Memory to not load them again if the layout changes. An example use case could be a full-width list view of multiple videos in one component and a grid overview in another.

const ComponentOne = () => {
  return (
    <div className="container">
      <video className="videoStyle01" autoPlay muted loop>
        // Using the same video src
        <source src="../videos/video_H264.mp4" type="video/mp4" />
      </video>
      <div>Video title</div>
    </div>
  );
};

const ComponentTwo = () => {
  return (
    <div className="container">
      <div>Other Styling Elements and Description</div>
      <video className="videoStyle02" autoPlay muted loop>
        // Using the same video src
        <source src="../videos/video_H264.mp4" type="video/mp4" />
      </video>
    </div>
  );
};
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Try React Memo,

If your component renders the same result given the same props, you can wrap it in a call to React.memo then it boosts the performance

https://reactjs.org/docs/react-api.html#reactmemo

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda