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

271
Vistas
playlist autoplay but has not sound

I have a playlist in javascript, when it is muted the video plays automatically, otherwise it doesn't play automatically.

How can I make autoplay and muted false?

My code HTML is:

<video  id="vid" src="main/" style="width:1360px; height:750px; visibility:visibility;"  controls playsinline     >

var separador = ";";
var video = document.currentScript.parentElement;
var sec = document.getElementById("valor").textContent;
var playlist = sec.split(separador);
video.volume = 0.1;

var lastSong = null;
var selection = null;
var video = document.getElementById("vid");

video.autoplay = true;
video.muted = true;


video.addEventListener("ended", selectRandom);
//video.muted=false;
function selectRandom() {
  while (selection == lastSong) {

    selection = Math.floor(Math.random() * playlist.length);

  }

  lastSong = selection;
  video.src = playlist[selection];

}

selectRandom();
video.play();

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

0

You can't play a video automatically with sound. There's a thing called "Autoplay Policy", at least for Chrome, but all other browsers are trying to block it.

See more information here.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Thank you very much, it is indeed the autoplay policy. I can solve it by adding the page as a shortcut on the desktop. The objective is to reproduce the videos on screens in a store.

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