2014-02-28 00:13:54 +00:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf8" />
|
|
|
|
<link rel="stylesheet" type="text/css" href="style/styles.css">
|
|
|
|
<title>Acces camera</title>
|
2014-02-28 01:34:08 +00:00
|
|
|
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
|
2014-02-28 01:12:24 +00:00
|
|
|
<script type="text/javascript" >
|
2014-02-28 06:17:02 +00:00
|
|
|
var ws = new WebSocket ("ws://192.168.1.23/socket");
|
2014-02-28 06:14:25 +00:00
|
|
|
ws.onmessage = function (evt) {
|
|
|
|
console.log("data receive");
|
|
|
|
var str = "<img src='data:image/jpeg;base64,"+evt.data+"'>";
|
|
|
|
$('.image').html(str);
|
2014-02-28 02:36:53 +00:00
|
|
|
}
|
2014-02-28 06:14:25 +00:00
|
|
|
ws.onopen = function () {
|
|
|
|
console.log("websocket engage");
|
|
|
|
};
|
|
|
|
ws.onclose = function () {
|
|
|
|
console.log("connection closed");
|
|
|
|
};
|
2014-02-28 06:43:20 +00:00
|
|
|
|
2014-02-28 06:47:51 +00:00
|
|
|
window.onbeforeunload=function(){
|
2014-02-28 06:43:20 +00:00
|
|
|
ws.close();
|
|
|
|
};
|
2014-02-28 01:12:24 +00:00
|
|
|
</script>
|
2014-02-28 00:13:54 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h2>Vue camera</h2>
|
2014-02-28 02:50:12 +00:00
|
|
|
<div class="image"></div>
|
2014-02-28 03:19:03 +00:00
|
|
|
<form action="/disconnection" method="post">
|
|
|
|
<input type="submit" value="Deconnexion">
|
|
|
|
</form>
|
2014-02-28 00:13:54 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
2014-02-28 06:14:25 +00:00
|
|
|
|