From 403326166dc60947d8e31a732584770472a58bb0 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 4 May 2020 12:26:57 +0100 Subject: [PATCH] [microphone] Fixup template to get rid of ng-if on icon --- node-red-node-ui-microphone/package.json | 2 +- node-red-node-ui-microphone/ui_microphone.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/node-red-node-ui-microphone/package.json b/node-red-node-ui-microphone/package.json index 3acd620..ffee3bf 100644 --- a/node-red-node-ui-microphone/package.json +++ b/node-red-node-ui-microphone/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-ui-microphone", - "version": "0.1.3", + "version": "0.1.4", "description": "A Node-RED ui node to record audio on a dashboard.", "author": "Nick O'Leary", "license": "Apache-2.0", diff --git a/node-red-node-ui-microphone/ui_microphone.js b/node-red-node-ui-microphone/ui_microphone.js index 954d425..9f47e29 100644 --- a/node-red-node-ui-microphone/ui_microphone.js +++ b/node-red-node-ui-microphone/ui_microphone.js @@ -22,8 +22,8 @@ module.exports = function(RED) { function HTML(config) { var configAsJson = JSON.stringify(config); var html = String.raw` - - + + `; return html; } @@ -88,6 +88,12 @@ module.exports = function(RED) { $scope.enabled = !!navigator.mediaDevices; + if (!$scope.enabled) { + setTimeout(function() { + $("#microphone_control_"+$scope.$id+" i").removeClass("fa-microphone").addClass("fa-microphone-slash"); + },50); + } + var worker; var mediaRecorder; var audioContext;