Offline screen
SSH Build / Deploy (push) Successful in 7s Details

This commit is contained in:
emerson 2024-08-22 18:01:06 -03:00
parent cb76ad8a2a
commit 266abc5ff3
2 changed files with 38 additions and 2 deletions

View File

@ -567,4 +567,18 @@ h1, h2, h3, h4, h5, h6 {
color: var(--text-color);
margin: 15px;
}
.player-off{
height: 80vh;
display: flex;
align-items: center;
justify-content: center;
}
.player-off h1{
font-size: 48px;
}

View File

@ -14,6 +14,10 @@ permalink: /live.html
controls
muted
/>
<div class="player-off">
<h1>Offline</h1>
</div>
</div>
@ -56,8 +60,26 @@ permalink: /live.html
// Exemplo de como usar o valor
console.log(user); // Isso vai exibir o valor do parâmetro 'user'
const videoElement = document.querySelector('video');
videoElement.src = `https://cast.alice.ufsj.edu.br/dash/${user}.mpd`;
const url = `https://cast.alice.ufsj.edu.br/dash/${user}.mpd`;
videoElement.src = url;
fetch(url)
.then(response => {
if (response.ok) {
console.log("Arquivo existe.");
} else {
console.log("Arquivo não encontrado.");
// Coloque o código para ocultar o vídeo aqui
videoElement.style.display = "none";
}
})
.catch(error => {
console.error("Erro ao verificar o arquivo:", error);
// Coloque o código para ocultar o vídeo aqui
videoElement.style.display = "none";
});
</script>