From 21e075bbc1b8d48644d79bdcdcad66c165d24ff4 Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Fri, 22 May 2020 13:12:10 +0200 Subject: [PATCH] Add audo that plays on connect to enable autoplay --- assets/audio/silence.mp3 | Bin 0 -> 504 bytes index.html | 1 + js/glowingbear.js | 5 ++--- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 assets/audio/silence.mp3 diff --git a/assets/audio/silence.mp3 b/assets/audio/silence.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..69f7c373cdc365ba936a73ef1de83e9a1df8b848 GIT binary patch literal 504 zcmezW*n@=u9Ykd2r31zIftZEHNEM@ip(QtPX3KoPs$Q)yIa}d%*vq0vgQNbJl Do~MWm literal 0 HcmV?d00001 diff --git a/index.html b/index.html index 8bace4f..47ca999 100644 --- a/index.html +++ b/index.html @@ -49,6 +49,7 @@ +

Upload error: Image upload failed.

diff --git a/js/glowingbear.js b/js/glowingbear.js index 2f1909c..2888d4b 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -78,7 +78,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $log.debug($rootScope.$$watchersCount); }; - // Detect page visibility attributes (function() { // Sadly, the page visibility API still has a lot of vendor prefixes @@ -721,7 +720,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', }; $scope.connect = function() { - + document.getElementById('audioNotificationInitializer').play(); // Plays some silence, this will enable autoplay for notifications notifications.requestNotificationPermission(); $rootScope.sslError = false; $rootScope.securityError = false; @@ -730,7 +729,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $scope.connectbutton = 'Connecting'; $scope.connectbuttonicon = 'glyphicon-refresh glyphicon-spin'; connection.connect(settings.host, settings.port, settings.path, $scope.password, settings.ssl, settings.useTotp, $scope.totp); - $scope.totp = "";//clear for next time + $scope.totp = ""; // Clear for next time }; $scope.disconnect = function() {