add sending video test
This commit is contained in:
10
api/index.js
10
api/index.js
@@ -66,10 +66,16 @@ var connect_to_api = function () {
|
||||
send_events_to_clients(msg);
|
||||
} else {
|
||||
console.log("got image");
|
||||
//TODO handle image
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("could not parse as json");
|
||||
console.log("could not parse as json, must be bytes");
|
||||
let image = new Image();
|
||||
image.src = URL.createObjectURL(message.data);
|
||||
image.addEventListener("load", function () {
|
||||
console.log("image loaded with width: " + image.width + " and height: " + image.height);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<div class="video">
|
||||
<div class="mainvideo">
|
||||
<p>Camera view:</p>
|
||||
<canvas id="msg" width="960" height="720" style="display: inline-block; border: 1px solid blue;"></canvas>
|
||||
<div id="connectedbuttons">
|
||||
<div id="connectedstatus">
|
||||
<p id="connectedlabel">Connected: <%- api_connected %></p>
|
||||
|
||||
Reference in New Issue
Block a user