weird behaviour with send testing in docker
This commit is contained in:
parent
d310a97a7b
commit
94016c7432
@ -9,8 +9,8 @@ http {
|
|||||||
include /etc/nginx/mime.types;
|
include /etc/nginx/mime.types;
|
||||||
server {
|
server {
|
||||||
|
|
||||||
location /wave {
|
location /submit {
|
||||||
proxy_pass http://10.0.0.205:5000;
|
proxy_pass http://10.0.0.200:9000/submit;
|
||||||
}
|
}
|
||||||
location / {
|
location / {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
|
@ -1,22 +1,20 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Flag Waver</title>
|
<title>🚂Vote Train🚂</title>
|
||||||
<script src="https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js"></script>
|
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
|
||||||
<link rel="stylesheet" type="text/css" href="style.css">
|
|
||||||
<script type="text/javascript" src="script.js"></script>
|
<script type="text/javascript" src="script.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body class="">
|
||||||
<div class="video-wrapper">
|
<div class="justify-center text-center text-white sm:text-lg bg-green-200 sm:p-20 h-full m-36 sm:rounded-3xl">
|
||||||
<video id="videoElement" style="text-align: center; width:100%; display:none;" controls></video>
|
<div id="input" class="py-10 sm:max-w-xl mx-auto font-mono">
|
||||||
</div>
|
<form action="javascript:void(0)" class="shadow-2xl sm:rounded-r-full sm:p-10 bg-gradient-to-t from-black to-gray-500 tracking-widest">
|
||||||
|
<input type="text" placeholder="key" class="text-black" id="key"/><br>
|
||||||
<div class="button-wrapper">
|
Upvote: <input type="checkbox" id="upvote"/><br>
|
||||||
<button id="start-cam" onclick="runVid()">Play</button>
|
Downvote: <input type="checkbox" id="downvote"/><br>
|
||||||
</div>
|
<button onclick="send()" class="bg-gray-600 ">Submit</button>
|
||||||
|
</form>
|
||||||
<div class="button-wrapper">
|
</div>
|
||||||
<button onclick="wave()" id="wave">Press!</button>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,18 +1,21 @@
|
|||||||
function runVid(){
|
function send(){
|
||||||
if (flvjs.isSupported()) {
|
|
||||||
var videoElement = document.getElementById('videoElement');
|
data={
|
||||||
var flvPlayer = flvjs.createPlayer({
|
key:document.getElementById("key").value,
|
||||||
type: 'flv',
|
upvote: document.getElementById("upvote").checked,
|
||||||
url: 'https://stream.nannal.com/live/flag.flv'
|
downvote:document.getElementById("downvote").checked,
|
||||||
});
|
|
||||||
flvPlayer.attachMediaElement(videoElement);
|
}
|
||||||
flvPlayer.load();
|
let response = await fetch('http://localhost:9000/submit', {
|
||||||
flvPlayer.play();
|
method: 'POST',
|
||||||
var vid = document.getElementById("videoElement")
|
headers: {
|
||||||
vid.style.display = "block";
|
'Content-Type': 'application/json;charset=utf-8'
|
||||||
}
|
},
|
||||||
}
|
body: JSON.stringify(data)
|
||||||
|
});
|
||||||
|
|
||||||
|
let result = await response.json();
|
||||||
|
document.getElementById("input").innerHTML= result.message
|
||||||
|
|
||||||
|
|
||||||
function wave(){
|
|
||||||
let promise = fetch('/wave')
|
|
||||||
}
|
}
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
body {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-wrapper{
|
|
||||||
text-align: center;
|
|
||||||
margin: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#wave {
|
|
||||||
background-color: #f44336;
|
|
||||||
border: none;
|
|
||||||
color: white;
|
|
||||||
padding: 15px 32px;
|
|
||||||
text-align: center;
|
|
||||||
text-decoration: none;
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 16px;
|
|
||||||
cursor: pointer;
|
|
||||||
border: none;
|
|
||||||
border-radius: 15px;
|
|
||||||
box-shadow: 0 9px #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
#wave:active {
|
|
||||||
background-color: red;
|
|
||||||
box-shadow: 0 5px #666;
|
|
||||||
transform: translateY(4px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-wrapper{
|
|
||||||
margin: auto;
|
|
||||||
padding: 20px;
|
|
||||||
width: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#videoElement {
|
|
||||||
width:80%;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
#start-cam {
|
|
||||||
background-color: grey;
|
|
||||||
border: none;
|
|
||||||
color: white;
|
|
||||||
padding: 15px 32px;
|
|
||||||
text-align: center;
|
|
||||||
text-decoration: none;
|
|
||||||
display: inline;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user