From 526d031a2211720ba683f90c7cf5268ed977602a Mon Sep 17 00:00:00 2001 From: mm Date: Wed, 30 Oct 2024 15:55:58 +0500 Subject: [PATCH] dev --- internal/model/widget-templates.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/model/widget-templates.go b/internal/model/widget-templates.go index 327dfe6..d2bef9e 100644 --- a/internal/model/widget-templates.go +++ b/internal/model/widget-templates.go @@ -68,7 +68,10 @@ function addText(text) { contentDiv.appendChild(p); } -function playAudio(audioUrl) { +function playAudio(audioUrl, widgetID) { + if (!audioUrl.includes("http")) { + audioUrl = "http://147.45.237.174/api/widget/media/audio/file/get/" + String(widgetID) + } fetch(audioUrl) .then(response => { if (!response.ok) { @@ -165,7 +168,7 @@ async function widgetView() { addImage(widget.ImageUrl) } if (widget.AudioUrl) { - playAudio(widget.AudioUrl) + playAudio(widget.AudioUrl, widgetID) } playSpeech(donat.Text)