Make radio check the stream endpoint
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m22s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m22s
This commit is contained in:
@@ -20,23 +20,17 @@ import Header from "@/components/text/Header.vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import axios from "axios";
|
||||
|
||||
const streamMount = ref("");
|
||||
const streamUrl = ref("");
|
||||
const streamLive = ref(false);
|
||||
const audio = ref(null);
|
||||
|
||||
async function checkStream() {
|
||||
try {
|
||||
const res = await axios.get("/radio/status-json.xsl");
|
||||
const data = res.data;
|
||||
|
||||
streamMount.value = data.icestats.source.listenurl.split("/").pop();
|
||||
if (streamMount.value) {
|
||||
await axios.head("/radio/stream");
|
||||
streamLive.value = true;
|
||||
streamUrl.value = "/radio/" + streamMount.value;
|
||||
streamUrl.value = "/radio/stream";
|
||||
|
||||
if (audio.value) audio.value.load();
|
||||
}
|
||||
} catch (err) {
|
||||
streamLive.value = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user