2020-06-02 08:50:32 +02:00
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
<title>Live stream test</title>
|
|
|
|
|
|
|
|
<link
|
|
|
|
href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
|
|
|
|
rel="stylesheet"
|
|
|
|
/>
|
2020-06-02 09:27:54 +02:00
|
|
|
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
|
2020-06-02 08:50:32 +02:00
|
|
|
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
|
|
|
|
|
2020-06-02 22:56:59 +02:00
|
|
|
<!-- Used for animating the scrolling of the chat div. Can that be done other ways? -->
|
2020-06-02 08:50:32 +02:00
|
|
|
<script src="vendor/jquery-2.1.4.min.js"></script>
|
|
|
|
</head>
|
|
|
|
|
2020-06-02 09:27:54 +02:00
|
|
|
<div>
|
|
|
|
<div class="flex">
|
|
|
|
<div class="w-4/6">
|
2020-06-02 22:56:59 +02:00
|
|
|
<video
|
|
|
|
id="video"
|
|
|
|
preload="auto"
|
|
|
|
autoplay
|
|
|
|
controls
|
|
|
|
style="width: 100%;"
|
|
|
|
></video>
|
2020-06-02 09:27:54 +02:00
|
|
|
<div id="app">
|
|
|
|
{{ streamStatus }}
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-06-02 08:50:32 +02:00
|
|
|
|
2020-06-02 09:27:54 +02:00
|
|
|
<div class="w-2/6">
|
|
|
|
<div
|
|
|
|
id="messages-container"
|
|
|
|
class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4"
|
|
|
|
style="height: 60vh; overflow-y: scroll;"
|
|
|
|
>
|
2020-06-02 22:56:59 +02:00
|
|
|
<div v-for="(message, index) in messages">
|
2020-06-02 09:27:54 +02:00
|
|
|
<div class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<img
|
2020-06-02 22:56:59 +02:00
|
|
|
v-bind:src="message.image"
|
2020-06-02 09:27:54 +02:00
|
|
|
class="w-10 h-10 rounded-full mr-4 border-black-500"
|
|
|
|
style="padding: 5px; background-color: #ececec;"
|
|
|
|
/>
|
2020-06-02 08:50:32 +02:00
|
|
|
|
2020-06-02 09:27:54 +02:00
|
|
|
<div class="text-sm">
|
2020-06-02 22:56:59 +02:00
|
|
|
<p class="text-700">{{ message.author }}</p>
|
|
|
|
<p class="text-gray-600">{{ message.body }}</p>
|
2020-06-02 09:27:54 +02:00
|
|
|
</div>
|
2020-06-02 08:50:32 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-06-02 09:27:54 +02:00
|
|
|
</div>
|
2020-06-02 22:56:59 +02:00
|
|
|
|
2020-06-02 09:27:54 +02:00
|
|
|
<form
|
2020-06-02 22:56:59 +02:00
|
|
|
id="chatForm"
|
|
|
|
@submit="submitChatForm"
|
2020-06-02 09:27:54 +02:00
|
|
|
class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4"
|
|
|
|
>
|
|
|
|
<!-- Author -->
|
|
|
|
<label class="control-label" for="inputAuthor">Author</label>
|
|
|
|
<input
|
|
|
|
id="inputAuthor"
|
|
|
|
type="text"
|
|
|
|
class="appearance-none bg-gray-200 text-gray-700 border border-black-500 rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white"
|
|
|
|
placeholder="Name"
|
2020-06-02 22:56:59 +02:00
|
|
|
v-model="message.author"
|
2020-06-02 09:27:54 +02:00
|
|
|
/>
|
2020-06-02 08:50:32 +02:00
|
|
|
|
2020-06-02 09:27:54 +02:00
|
|
|
<!-- Body -->
|
|
|
|
<div>
|
|
|
|
<label class="control-label" for="inputBody">Message</label>
|
|
|
|
<div class="controls">
|
|
|
|
<textarea
|
|
|
|
id="inputBody"
|
|
|
|
placeholder="Message"
|
2020-06-02 22:56:59 +02:00
|
|
|
v-model="message.body"
|
2020-06-02 09:27:54 +02:00
|
|
|
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-black-500 rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white"
|
|
|
|
>
|
|
|
|
</textarea>
|
|
|
|
</div>
|
2020-06-02 08:50:32 +02:00
|
|
|
</div>
|
|
|
|
|
2020-06-02 09:27:54 +02:00
|
|
|
<div class="control-group">
|
|
|
|
<div class="controls">
|
2020-06-02 22:56:59 +02:00
|
|
|
<button
|
2020-06-02 09:27:54 +02:00
|
|
|
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
|
|
|
|
>
|
2020-06-02 22:56:59 +02:00
|
|
|
Send
|
|
|
|
</button>
|
2020-06-02 09:27:54 +02:00
|
|
|
</div>
|
2020-06-02 08:50:32 +02:00
|
|
|
</div>
|
2020-06-02 09:27:54 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
2020-06-02 08:50:32 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-05-24 02:57:49 +02:00
|
|
|
|
2020-06-02 22:56:59 +02:00
|
|
|
<script src="js/message.js"></script>
|
|
|
|
<script src="js/app.js"></script>
|