This commit is contained in:
mm 2024-10-30 15:55:58 +05:00
parent 7c4326ee9f
commit 526d031a22

View File

@ -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)