From 7d470e8b50cc0ad1b5da06c67923fe90a59d5644 Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Mon, 9 Nov 2015 20:01:16 -0500 Subject: alarm playback for desktops Former-commit-id: af8e1b78b5a5ece25d5220007355f5a25e3393b0 --- www/js/EventServer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'www/js') diff --git a/www/js/EventServer.js b/www/js/EventServer.js index 12935392..8b43fa1d 100644 --- a/www/js/EventServer.js +++ b/www/js/EventServer.js @@ -139,6 +139,7 @@ angular.module('zmApp.controllers') ws.$on('$message', function (str) { ZMDataModel.zmLog("Real-time event: " + JSON.stringify(str)); + // Error messages if (str.status != 'Success') { @@ -170,6 +171,7 @@ angular.module('zmApp.controllers') if (str.status == 'Success' && str.event == 'alarm') // new events { + new Audio('sounds/blop.mp3').play(); var localNotText = "Latest Alarms: "; $rootScope.isAlarm = 1; @@ -448,10 +450,12 @@ angular.module('zmApp.controllers') $rootScope.isAlarm = 0; $rootScope.tappedNotification = 1; } else { - // alarm received in foregroun + // alarm received in foreground //var str=data.additionalData.alarm_details; console.log("PLAYING MEDIA"); media.play(); + + var str = data.message; // console.log ("***STRING: " + str + " " +str.status); var eventsToDisplay = []; -- cgit v1.2.3