Fix checkStream function and useTemplateRef instead of implicit
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m35s

This commit is contained in:
2026-03-10 22:40:15 +00:00
parent 5b3cd267b6
commit b47d1a3df3

View File

@@ -17,22 +17,24 @@
<script setup>
import Button from "@/components/input/Button.vue";
import Header from "@/components/text/Header.vue";
import { ref, onMounted } from "vue";
import { ref, useTemplateRef, onMounted, nextTick } from "vue";
import axios from "axios";
const streamUrl = ref("");
const streamLive = ref(false);
const audio = ref(null);
const audio = useTemplateRef("audio");
async function checkStream() {
try {
await axios.head("/radio/stream");
streamLive.value = true;
streamUrl.value = "/radio/stream";
if (audio.value) {
audio.value.load();
audio.value.volume = 0.2;
if (!streamLive.value) {
streamLive.value = true;
streamUrl.value = "/radio/stream";
await nextTick();
if (audio.value) {
audio.value.load();
audio.value.volume = 0.2;
}
}
} catch (err) {
streamLive.value = false;