modifié: video.html

This commit is contained in:
sidya82 2014-03-01 18:29:32 +01:00
parent 3132c13c35
commit 967d831fb7

View File

@ -12,13 +12,16 @@ return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});v
var ws = new WebSocket ("ws://192.168.1.23/socket"); var ws = new WebSocket ("ws://192.168.1.23/socket");
ws.onmessage = function (evt) { ws.onmessage = function (evt) {
console.log("data receive");
if(evt.data != "error") { if(evt.data != "error") {
console.log("data receive"); console.log("data OK !");
var str = "<img src='data:image/jpeg;base64,"+evt.data+"'>"; var str = "<img src='data:image/jpeg;base64,"+evt.data+"'>";
$('.image').html(str); $('.image').html(str);
} }
else else {
var str = "<error>Erreur : image camera indisponilbe</error>"; console.log("data NOK !");
var str = "<p>Erreur : image camera indisponilbe</p>";
}
} }
ws.onopen = function () { ws.onopen = function () {
console.log("websocket engage"); console.log("websocket engage");