//$("#audio").attr("autoplay", true); //document.getElementById("audio").play();//to play //document.getElementById("audio").pause();//to pause window.onload = function () { document.getElementById("audio").play(); } window.addEventListener("load", function () { document.getElementById("audio").play(); }); <%-- <audio src="Sounds/DPM317.wav" controls="controls" autoplay="autoplay">--%> <%-- <audio src="Sounds/DS250069new.wav" controls="controls" autoplay="autoplay"> <audio controls=""> <source src="Sounds/DPM317.wav" type="audio/wav" /> Your browser does not support the audio element. --%> <audio id="audio" controls="" autoplay=""> <source src="Sounds/DPM317.wav" type="audio/wav" />
<title> function PlaySound(soundobj) { var thissound = document.getElementById(soundobj); thissound.play(); } function PauseSound(soundobj) { var thissound = document.getElementById(soundobj); thissound.pause(); } <audio id="audio1" controls="controls" preload="auto" src="Sounds/DPM317.wav" type="audio/wav"> <audio id="audio2" controls="controls" preload="auto" src="Sounds/DS250069new.wav" type="audio/wav"> /pre> But none of them are working in chrome browser can anyone help me out as iam new to this< What I have tried: i tried the above codes which i had posted but none of them are working
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)