diff --git a/.gitignore b/.gitignore index 95dc7dd..73ca3ce 100644 --- a/.gitignore +++ b/.gitignore @@ -94,6 +94,7 @@ public/media/* !public/media/marker-shadow.png !public/media/bell_long.mp3 !public/media/bell_short.mp3 +!public/media/bell_message.mp3 *.bak *.save diff --git a/public/js/client_dbrd.js b/public/js/client_dbrd.js index 339bee3..bc49c69 100755 --- a/public/js/client_dbrd.js +++ b/public/js/client_dbrd.js @@ -616,5 +616,15 @@ socket.on('io.new_rmld', function (data) { // Anzahl der Rückmeldung zählen recount_rmld(pg_waip_uuid); }); - + var audio = document.getElementById('audio'); + audio.src = ('/media/bell_message.mp3'); + // Audio-Blockade des Browsers erkennen + var playPromise = document.querySelector('audio').play(); + if (playPromise !== undefined) { + playPromise.then(function () { + audio.play(); + }).catch(function (error) { + console.log('Notification playback failed'); + }); + }; }); diff --git a/public/js/client_waip.js b/public/js/client_waip.js index 0d6bc0e..b394f65 100644 --- a/public/js/client_waip.js +++ b/public/js/client_waip.js @@ -532,6 +532,18 @@ socket.on('io.new_rmld', function (data) { }); // Text anpassen resize_text(); + // Bing abspielen + var audio = document.getElementById('audio'); + audio.src = ('/media/bell_message.mp3'); + // Audio-Blockade des Browsers erkennen + var playPromise = document.querySelector('audio').play(); + if (playPromise !== undefined) { + playPromise.then(function () { + audio.play(); + }).catch(function (error) { + console.log('Notification playback failed'); + }); + }; }); /* ########################### */ diff --git a/public/media/bell_message.mp3 b/public/media/bell_message.mp3 new file mode 100755 index 0000000..bd69102 Binary files /dev/null and b/public/media/bell_message.mp3 differ diff --git a/views/includes/master_dashboard.pug b/views/includes/master_dashboard.pug index b2d2906..9581bce 100755 --- a/views/includes/master_dashboard.pug +++ b/views/includes/master_dashboard.pug @@ -317,5 +317,7 @@ style(type='text/css'). h3.list-group-item.list-group-item-light.flex-fill.text-dark 0 AGT //button#rueckmeldung.btn.btn-danger.btn-lg.btn-block.ion-md-paper-plane(type='button') Rückmeldung senden // TODO: zeitstrahl der den Ablauf anzeigt - +.d-none + audio#audio(controls='') + source(src='', type='audio/mpeg')