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

1.4K
Views
Cómo manejar "DOMException no detectada (en promesa): play() falló porque el usuario no interactuó primero con el documento". en el escritorio con Chrome 66?

me sale el mensaje de error..

No detectada (en promesa) DOMException: play() falló porque el usuario no interactuó primero con el documento.

..al intentar reproducir un video en el escritorio con la versión 66 de Chrome.

Encontré un anuncio que comenzaba a reproducirse automáticamente en un sitio web, sin embargo, usaba el siguiente HTML:

 <video title="Advertisement" webkit-playsinline="true" playsinline="true" style="background-color: rgb(0, 0, 0); position: absolute; width: 640px; height: 360px;" src="http://ds.serving-sys.com/BurstingRes/Site-2500/Type-16/1ff26f6a-aa27-4b30-a264-df2173c79623.mp4" autoplay=""></video>

Entonces, ¿es tan fácil omitir el bloqueador de reproducción automática de Chrome v66 como simplemente agregar los webkit-playsinline="true" , playsinline="true" y autoplay="" al elemento <video> ? ¿Hay alguna consecuencia negativa en esto?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Para que la reproducción automática en elementos html 5 funcione después de la actualización de Chrome 66, solo necesita agregar la propiedad muted al elemento de video.

Así que tu video HTML actual

 <video title="Advertisement" webkit-playsinline="true" playsinline="true" style="background-color: rgb(0, 0, 0); position: absolute; width: 640px; height: 360px;" src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" autoplay=""></video>

Solo necesita muted="muted"

 <video title="Advertisement" style="background-color: rgb(0, 0, 0); position: absolute; width: 640px; height: 360px;" src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" autoplay="true" muted="muted"></video>

Creo que la actualización de Chrome 66 está tratando de evitar que las pestañas creen ruido aleatorio en las pestañas de los usuarios. Es por eso que la propiedad silenciada hace que la reproducción automática vuelva a funcionar.

over 4 years ago · Santiago Trujillo Report

0

Para mí (en el proyecto Angular) este código ayudó:

En HTML, debe agregar autoplay muted

En JS/TS

 playVideo() { const media = this.videoplayer.nativeElement; media.muted = true; // without this line it's not working although I have "muted" in HTML media.play(); }
over 4 years ago · Santiago Trujillo Report

0

Intenta usar el detector de eventos mousemove

 var audio = document.createElement("AUDIO") document.body.appendChild(audio); audio.src = "./audio/rain.m4a" document.body.addEventListener("mousemove", function () { audio.play() })
over 4 years ago · Santiago Trujillo 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!