Merge pull request #4371 from nightscout/wip/allow_speech_on_ios

Improvement: causes client to say Ok Ok when the alarm test button is…
This commit is contained in:
Sulka Haro
2019-02-17 14:53:43 +02:00
committed by GitHub
+8
View File
@@ -1046,6 +1046,14 @@ client.load = function load(serverSettings, callback) {
});
$('#testAlarms').click(function(event) {
// Speech synthesis also requires on iOS that user triggers a speech event for it to speak anything
if (client.plugins('speech').isEnabled) {
var msg = new SpeechSynthesisUtterance('Ok ok.');
msg.lang = 'en-US';
window.speechSynthesis.speak(msg);
}
d3.selectAll('.audio.alarms audio').each(function () {
var audio = this;
playAlarm(audio);