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

201
Vistas
set focus on iframe contents to allow sound

this is an extension to another question i've asked

i want to embed a game on a website and i want it to automaticaly focus on the iframe. but whenever i try anything like iframe.contentWindow.focus() it focuses on the iframe but the iframe doesnt have any sound

the code for the game was written in a special program so the code is all jumbled and hard to comprehend. though i did find a script that can test the audio. what i want is for this to return true.

testAudio(){
  playTestAudio();return _yb1&&g_WebAudioContext&&g_WebAudioContext.state!==_fa1._ga1
}
function playTestAudio() {
  if(_yb1||_zb1)return;
  _zb1=true;
  var _lb1=new Audio(_X91);
  _lb1.controls=false;
  _lb1.autoplay=true;
  _lb1.preload="none";
  document.body.appendChild(_lb1);
  try{
    var _Bb1=_lb1.play();
    if(_Bb1!==undefined) {
      _Bb1.then(function() {
        debug("WebAudio autoplay test passed.");
        _yb1=true;
        _zb1=false;
        _Cb1();
        document.body.removeChild(_lb1)
      }).catch(function(error) {
        console.log("WebAudio autoplay test failed: ",error);
        document.body.removeChild(_lb1);
        _zb1=false;
        _Db1()
      })
    }else {
      console.log("WebAudio autoplay test failed: Playback promise invalid.");
      document.body.removeChild(_lb1);
      _zb1=false;
      _Db1()
    }
  }
  catch(_wC){debug("WebAudio autoplay test failed with exception: "+_wC);
  document.body.removeChild(_lb1);_zb1=false;_Db1()}
}

this is the location of the script file if needed lacation.scripts.net

about 4 years ago · Juan Pablo Isaza
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