I'm creating a webserver on raspi that can be access by my webview in android phone. This is my JS.
setInterval(function() {
notif();
$("#position").load('refresh.php');
},1000);
function notif() {
var pos = $('.status').text();
var audio = new Audio('alarm.mp3');
if(pos == "Out") {
audio.play();
}
}
When I access my webserver from different laptop it plays the audio. But it is not working on android application webview even in browser. I tried to put the audio.play(); code in a button and open it in a webview and its working fine. Is it a webview problem or js Can you help me. Thank you.