Finally embedded my twitch stream into the site, now just need to get links posting to work.
This commit is contained in:
parent
26f61eb68b
commit
592e1c4fd8
4 changed files with 346 additions and 38 deletions
|
@ -2,34 +2,46 @@
|
|||
let req = new GetJson("/api/stream/1");
|
||||
let link_req = new GetJson("/api/stream/1/links");
|
||||
</script>
|
||||
<script src="https://player.twitch.tv/js/embed/v1.js"></script>
|
||||
|
||||
<div x-init="Stream = await req.theData()" x-data="{Stream: {}}">
|
||||
<div class="flex justify-center items-center w-full bg-gray-300 text-gray-950 text-center aspect-video">
|
||||
<span>Stream Viewer</span>
|
||||
<div id="twitch-player" class="flex justify-center items-center w-full bg-gray-300 text-gray-950 text-center aspect-video">
|
||||
</div>
|
||||
|
||||
<div class="p-6 flex flex-col justify-center">
|
||||
<div>
|
||||
<h2>Links Found in Chat</h2>
|
||||
<ul x-init="links = await link_req.theData()" x-data="{links: {}}">
|
||||
<template x-for="item in links">
|
||||
<li><a x-text="item.description" x-bind:href="item.url"></a></li>
|
||||
</template>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Links Found in Chat</h2>
|
||||
<ul x-init="links = await link_req.theData()" x-data="{links: {}}">
|
||||
<template x-for="item in links">
|
||||
<li><a x-text="item.description" x-bind:href="item.url"></a></li>
|
||||
</template>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<form action="/api/link" method="POST">
|
||||
<card class="card">
|
||||
<top>Submit a Link</top>
|
||||
<middle>
|
||||
<input id="stream_id" name="stream_id" type="hidden" value="1">
|
||||
<input id="url" name="url" type="text" placeholder="Link Url">
|
||||
<input id="description" name="description" type="text" placeholder="Description">
|
||||
</middle>
|
||||
<bottom>
|
||||
<button id="submit" type="submit">Send It</button>
|
||||
</bottom>
|
||||
</card>
|
||||
</form>
|
||||
<form action="/api/link" method="POST">
|
||||
<card class="card">
|
||||
<top>Submit a Link</top>
|
||||
<middle>
|
||||
<input id="stream_id" name="stream_id" type="hidden" value="1">
|
||||
<input id="url" name="url" type="text" placeholder="Link Url">
|
||||
<input id="description" name="description" type="text" placeholder="Description">
|
||||
</middle>
|
||||
<bottom>
|
||||
<button id="submit" type="submit">Send It</button>
|
||||
</bottom>
|
||||
</card>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var options = {
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
autoplay: false,
|
||||
muted: true,
|
||||
channel: "zedashaw"
|
||||
};
|
||||
var player = new Twitch.Player("twitch-player", options);
|
||||
player.setVolume(0.5);
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue