Skip to content

Commit

Permalink
temporary add 5 sec waiting for alert audio in case of videoalert
Browse files Browse the repository at this point in the history
  • Loading branch information
stCarolas committed Apr 2, 2024
1 parent 3cc41da commit 06c9892
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/components/ImageCache/ImageCache.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ export default function ImageCache({

return (
<>
{images.map((image) => (
<img
key={image}
style={{ display: "none" }}
src={`${process.env.REACT_APP_FILE_API_ENDPOINT}/files/${image}`}
/>
))}
{images
.filter((image) => image)
.map((image) => (
<img
key={image}
style={{ display: "none" }}
src={`${process.env.REACT_APP_FILE_API_ENDPOINT}/files/${image}`}
/>
))}
</>
);
}
8 changes: 8 additions & 0 deletions src/logic/alert/AlertController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ export class AlertController {
this.renderImage(alert);
this.renderTitle(alert, data);
this.renderMessage(alert, data);
if (alert.video) {
setTimeout(() => this.playAudio(alert, data, ackFunction), 5000);
} else {
this.playAudio(alert, data, ackFunction);
}
}

playAudio(alert: any, data: any, ackFunction: Function){
this.voiceController?.playAudio(alert, () => {
this.voiceController?.pronounceTitle(
alert,
Expand Down

0 comments on commit 06c9892

Please sign in to comment.