36 lines
1.1 KiB
HTML
36 lines
1.1 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf8" />
|
|
<link rel="stylesheet" type="text/css" href="style/styles.css">
|
|
<title>Acces camera</title>
|
|
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
|
|
<script type="text/javascript" >
|
|
var ws = new WebSocket ("ws://192.168.1.23/test");
|
|
ws.onmessage = function (evt) {
|
|
var str = "<img src='data:image/jpeg;base64,"+evt.data+"'>";
|
|
$('.image').html(str);
|
|
}
|
|
ws.onopen = function () {
|
|
console.log("websocket engage");
|
|
};
|
|
ws.onclose = function () {
|
|
console.log("connection closed");
|
|
};
|
|
function refresh() {
|
|
ws.send("next");
|
|
}
|
|
$(document).ready(refresh())
|
|
setInterval(refresh(), 2000);
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<h2>Vue camera</h2>
|
|
<div class="image"></div>
|
|
<form action="/disconnection" method="post">
|
|
<input type="submit" value="Deconnexion">
|
|
</form>
|
|
</body>
|
|
</html>
|
|
|