added ajax loading for streams

This commit is contained in:
Erhard 2017-08-03 22:42:42 +02:00
parent 5781ac28db
commit 6a77fa054d
3 changed files with 29 additions and 11 deletions

View File

@ -20,11 +20,11 @@ h1 {
} }
form { form {
padding: 5px;
text-align: center; text-align: center;
display: inline;
} }
input { input, button {
background-color: #666; background-color: #666;
border: 1px solid #999; border: 1px solid #999;
border-radius: 5px; border-radius: 5px;
@ -34,6 +34,21 @@ input {
vertical-align: middle; vertical-align: middle;
} }
button {
margin: 5px;
}
button:hover {
background-color: #999;
border: 1px solid #666;
}
button:active {
background-color: #999;
border: 1px solid #666;
color: #000;
}
label { label {
vertical-align: middle; vertical-align: middle;
} }

View File

@ -101,6 +101,10 @@ function resetSearch() {
searchfield.focus(); searchfield.focus();
} }
function playStream(){
var streamUrl = document.querySelector("#streaming-url").value;
ajaxRequest("/?video="+encodeURI(streamUrl));
}
function hideSections() { function hideSections() {
var sections = document.querySelectorAll("section"); var sections = document.querySelectorAll("section");

View File

@ -42,15 +42,14 @@
{% endfor %} {% endfor %}
</section> </section>
<section id="streams" style="display:none;"> <section id="streams" style="display:none;">
<form action="/" method="GET"> <div>
<form>
<label for="video">Stream URL</label> <label for="video">Stream URL</label>
<input type="text" name="video" /> <input id="streaming-url" type="text" name="video" placeholder="paste stream url here..." />
<input type="submit" value="Play" />
</form>
<form action="/" method="GET">
<input type="hidden" name="killvideo" value="yes" />
<input type="submit" name="submit" value="Terminate videos" />
</form> </form>
<button onclick="playStream();">Play!</button>
</div>
<button name="submit" onclick="ajaxRequest('/?killvideo=yes');">Terminate videos</button>
</section> </section>
<section id="voice" style="display:none;"> <section id="voice" style="display:none;">
<form action="/say/" method="POST"> <form action="/say/" method="POST">