I'm creating a webserver on RPI3 that will display the status of the baby(Lying Down, Sitting, Out of the Crib). It will also play a sound notification once the status is "Out of the Crib".
The javasript of my webserver is this:
function notif() {
var pos = $('.status').text();
var audio = new Audio('alarm.mp3');
if(pos == "Out of the crib") {
audio.play();
}
This code is working fine when I access my webserver in different laptop. But when I view my webserver in android webview it does not play the sound, but in different laptop it's working.
Should I do something on my java file in android studio or android webview does not support this kind of thing?
But I tried to add button in my webserver that will play the sound once it's click. And I open it again in my webview and it's working I dont know what to do. Please help. Thank you.