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

136
Views
Reproducción automática en MouseOver

OBJETIVO: Intentar reproducir automáticamente cuando el mouse está sobre el video.

HTML:

 <video id = "litVideo" src="lt.mp4" onmouseover="over(this)" onmouseout="out(this)" controls>

JAVASCRIPT:

 function over(element) { alert("mouseover"); element.append(autoplay) **also tried element.add(autoplay)** } function out(element) { alert("mouseout"); element.remove(autoplay); }

Problema: Mouseover está alertando. Sin embargo, la reproducción automática no funciona . Por favor ayuda.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

use la función reproducir () y pausa ()

 const video = document.getElementById("video") video.onmouseover = function(){ video.play() } video.onmouseout = function(){ video.pause() }
 <video src="https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4" controls id="video"></video>

Sin embargo, si desea utilizar su enfoque, utilice

elemento.setAttribute("reproducción automática")

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!