Vi esta desfiguración del anonimato, así que quiero agregar una canción escondida de chip mientras escucho el juego, pero me perdí un poco.
var success = function() { document.body.style.backgroundImage = "url(http://sofes.miximages.com/javascript/14685_1_other_wallpapers_anonymous.jpg)"; document.body.style.backgroundSize = "100%"; if(window.KICKASSGAME){window.KICKASSGAME.menuManager.menu.messageTypeChangeShip('242,0'); window.KICKASSGAME.menuManager.destroy()}else{ alert("AntiSec CAEK-mode activated... Destroy the system! Controls: up, down, left, right, space to fire."); var KICKASSVERSION='2.0'; var s = document.createElement('script'); s.type='text/javascript';document.body.appendChild(s); s.src='//hi.kickassapp.com/kickass.js'; void(0);} } var konami = new Konami(success);
play
es el método que estás buscando
var audioElement = document.createElement('audio'); audioElement.setAttribute('src', 'YourSong.ogg'); audioElement.load() audioElement.addEventListener("load", function() { audioElement.play(); }, true);
Mira esto … ¡Te puede ayudar …!
function play_sound(url){ if(play_html5_audio){ var snd = new Audio(url); //code snd.play(); }else{ var sound = $(""); //code $('body').append(sound); } } play_sound('beep.mp3');
Código fuente encontrado @ Reproducción automática de audio con HTML5 y Javascript