Skip to content

Commit

Permalink
embed test
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzapanther committed Sep 23, 2023
1 parent 6ab49fb commit 5f194d9
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions content/embed-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Embed Test
---

## Embed Test

<div id="stream-frame" style="width: 100%; height: 100%; color: white; background-color: black; display: flex; justify-content: center; align-items: center;">
<h2>Waiting for Stream to Start</h2>
</div>
<script>
function fetch_status() {
fetch('https://wildwoodag.herokuapp.com/stream-frame/status_1.json?channel=UCmo8zL1ZhvT4vYNzhSAuAEw&ts=' + Date.now())
.then(response => response.json())
.then((data) => {
if (data.status == 'live') {
document.querySelector("#stream-frame").innerHTML = data.embed;
} else{
setTimeout(fetch_status, 10000);
}
})
.catch(e => alert('Error fetching stream status; refresh page.'));
}

fetch_status();
</script>

0 comments on commit 5f194d9

Please sign in to comment.