diff --git a/admin_clinics.php b/admin_clinics.php
index ea4a18d..5e81a36 100644
--- a/admin_clinics.php
+++ b/admin_clinics.php
@@ -107,12 +107,12 @@ qh_page_start(
= qh_h((int) $clinic['requires_vitals'] === 1 ? qh_t('Vitals', 'علامات') : qh_t('Direct', 'مباشر')) ?> |
|
diff --git a/assets/js/main.js b/assets/js/main.js
index 9ac5238..03c2439 100644
--- a/assets/js/main.js
+++ b/assets/js/main.js
@@ -84,9 +84,42 @@ document.addEventListener('DOMContentLoaded', () => {
fullscreenButton.hidden = true;
}
+ const audioBtn = document.querySelector('.js-audio-toggle');
+ if (audioBtn) {
+ const updateAudioBtnState = () => {
+ const isEnabled = window.localStorage.getItem('hospitalQueue:audioEnabled') === 'true';
+ if (isEnabled) {
+ audioBtn.innerHTML = '';
+ } else {
+ audioBtn.innerHTML = '';
+ }
+ audioBtn.setAttribute('aria-pressed', isEnabled.toString());
+
+ const videoPlayer = document.getElementById('adsVideoPlayer');
+ if (videoPlayer) {
+ videoPlayer.muted = !isEnabled;
+ }
+ };
+
+ updateAudioBtnState();
+
+ audioBtn.addEventListener('click', () => {
+ const isEnabled = window.localStorage.getItem('hospitalQueue:audioEnabled') === 'true';
+ const nextState = !isEnabled;
+ window.localStorage.setItem('hospitalQueue:audioEnabled', nextState.toString());
+ updateAudioBtnState();
+
+ if (nextState && 'speechSynthesis' in window) {
+ const primeUtterance = new SpeechSynthesisUtterance('');
+ window.speechSynthesis.speak(primeUtterance);
+ }
+ });
+ }
+
const cards = Array.from(document.querySelectorAll('.announcement-card'));
const latest = cards[0];
- if (latest && 'speechSynthesis' in window) {
+ const audioEnabled = window.localStorage.getItem('hospitalQueue:audioEnabled') === 'true';
+ if (latest && 'speechSynthesis' in window && audioEnabled) {
const announcementKey = latest.dataset.announcementKey || '';
const storageKey = `hospitalQueue:lastAnnouncement:${locale}`;
const storedKey = window.localStorage.getItem(storageKey) || '';
diff --git a/display.php b/display.php
index a071b96..72664b3 100644
--- a/display.php
+++ b/display.php
@@ -59,13 +59,16 @@ qh_page_start(
= qh_h(date('H:i')) ?>
+