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

218
Visualizações
Video hides for a second when playing in safari

I'm playing some videos on mouseenter, and everything is working right on Chrome but not in Safari, here's an example of what happens: (Gif: https://gyazo.com/cc4693840cd30fee3f61cda6082e6f7f)

Also tried to play the video with 'canplay' event... Canplay

It hides itself just before playing the video... It should not jump, right after remove the poster the video should play... I've tried also with preload="auto" and loading the video first in js and after a few seconds playing it with a settimeout

It only happens the first time you hover the video (because it has to load)

First time it happens to me

Here's the code:

document.querySelectorAll('.work').forEach((work) => {
  work.addEventListener('mouseenter', function() {
    // this.querySelector('video').load();
    // setTimeout(() => {
      this.querySelector('video').play();
    // }, 3000);
  })
  work.addEventListener('mouseleave', function() {
    this.querySelector('video').currentTime = 0;
    this.querySelector('video').pause();
  });
});
.work {
  float: left;
  width: calc(50% - 5px);
}
.work:before {
  display: block;
  content: "";
  width: 100%;
  padding-top: 56.25%;
  pointer-events: none;
}
    
video {
  position: absolute;
  top: 0;
  left:0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  right: 0;
  left: 0; 
}
<div class="work"><video muted="" playsinline="" preload="metadata" loop="" src="https://player.vimeo.com/progressive_redirect/playback/670660302/rendition/1080p/1080p.mp4?loc=external&signature=23ceaaa3a5475f94cfbe326a81c9c01ce8b02a217e54c7262bb6cf23dd3390d3" poster="http://ticklefilm.com/new/wp-content/uploads/2021/12/IMG_9660-720x1080.jpg"></video></div>

about 4 years ago · Juan Pablo Isaza
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