This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Audio object
#1
I use the custom Javascript below to play an audio file (doorbell).
Unfortunately it will not work cross browser since the play function isn't allowed from script any longer for Safari (IOS) and Firefox. Only in Chrome it's still working so far.
Does any of you know a better solution to play audio from a simple Javascript?

$(function() {
  if (typeof grp != 'undefined') {
    grp.listen('4/1/1', function(object, state) {
      if (state == 'value') {
        var myaudio = new Audio('https://knxgroep.nl/plugins/deurbel.mp3');
        myaudio.play();
      }
    }, true);
  }
});
Reply


Messages In This Thread
Audio object - by Joep - 17.12.2019, 16:50
RE: Audio object - by Erwin van der Zwart - 17.12.2019, 17:09
RE: Audio object - by Joep - 18.12.2019, 09:34

Forum Jump: