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

116
Visualizações
Audio plays in all browsers but Safari desktop

I have an issue with Safari desktop. This snippet of code works even on the mobile version of Safari just not on the desktop version (12.1).

js

var targetBeep = "targetBeep";
var atmos = "atmos";

createjs.Sound.registerSound("targetBeep.mp3", targetBeep);
createjs.Sound.registerSound("25372639_dark-tension-atmosphere_by_umcsound_preview.mp3", atmos);

$( ".play" ).css({'cursor': 'pointer'}).click(function() {
  setTimeout(function () {
  createjs.Sound.play(atmos);
  }, 2000);
});

HTML

<div class="play">
  play
</div>

<script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<script src="https://code.createjs.com/1.0.0/createjs.min.js"></script>

Is it a problem with the code or is it Safari desktop? If its Safari what can I do to resolve this

var atmos = "atmos";

createjs.Sound.registerSound("https://upload.wikimedia.org/wikipedia/commons/1/12/03may2020-tobefree.mp3", atmos);

$(".play").css({
  'cursor': 'pointer'
}).click(function() {
  setTimeout(function() {
    createjs.Sound.play(atmos);
  }, 2000);
});
<div class="play">
  play
</div>

<script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<script src="https://code.createjs.com/1.0.0/createjs.min.js"></script>

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