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.

sound on Win/PC and Android/Tablet
#9
You can use an additional object to control whether to play the sound or not. In this example the sound will play only when 1/1/1 value is true.
Code:
function CreateListeners(groupaddr,url){
    // Make event listener to object
    if (typeof grp != 'undefined') {
      grp.listen(groupaddr, function(object, state) {
        var value = object.value;
        var enabled = grp.getvalue('1/1/1');
        if (state == 'value' && value == 1 && enabled) {
          Play_Audio(url);
        }
      }, true);
    }
   }
Reply


Messages In This Thread
RE: sound on Win/PC and Android/Tablet - by admin - 25.03.2020, 07:24

Forum Jump: