add sending video test

This commit is contained in:
Sem van der Hoeven
2023-05-31 20:05:10 +02:00
parent 1c8229ad98
commit f117ead9b1
3 changed files with 28 additions and 2 deletions

View File

@@ -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);
});
}
});