I have JavaScript code for audio. I want to redirect to a URL if the browser has audio support. Also if the browser does not support audio, redirect to another link.
I tried this:
<script>
var audio= document.createElement("audio")
var media= {audio : (audio.play) ? true : false}
if (media == true) {
window.location.replace("file1.php");
} else {
window.location.replace("file2.php");
}
</script>
It didn't work.
Can anyone help? Thanks.