Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

188
Vistas
Image On Hover Play Video And Reset the div with image on completion

I would like to show thumbnails for videos on load and on hover or touch I want to play the video inside the parent div of the image. On mouseout and video ends, the div should show the image automatically. How can I do it?

In simple, I need a homepage just like youtube page. I will show the images first and on hover it should play or pause respective videos.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Can you try this enter image description here:

var vid = document.getElementById("myVideo"); 
var text = document.getElementById("text"); 
function playVid() { 
  vid.play(); 
  text.innerHTML = "Start Video";
} 

function pauseVid() { 
  vid.pause(); 
  text.innerHTML = "Stop Video";
} 
<!DOCTYPE html> 
<html> 
<body> 
<video muted="muted" id="myVideo" onmouseenter="playVid()" onmouseleave="pauseVid()"> 
  <source src=http://techslides.com/demos/sample-videos/small.webm type=video/webm> 
  <source src=http://techslides.com/demos/sample-videos/small.ogv type=video/ogg> 
  <source src=http://techslides.com/demos/sample-videos/small.mp4 type=video/mp4>
  <source src=http://techslides.com/demos/sample-videos/small.3gp type=video/3gp>
</video>
<p id="text"></p>

</body>
</html>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda