Commit fbf0e743 authored by Michael Murtaugh's avatar Michael Murtaugh

new webm loops + cameragif

parent 9e3ee32b
......@@ -17,6 +17,9 @@
<div id="draw">
<canvas id="canvas"></canvas>
</div>
<div id="video">
<video autoplay loop></video>
</div>
<div id="message"></div>
</body>
</html>
......@@ -6,6 +6,7 @@ document.addEventListener("DOMContentLoaded", function () {
img = document.querySelector("img"),
canvas = document.querySelector("canvas"),
ctx = canvas.getContext("2d"),
video = document.querySelector("video"),
msg = document.getElementById("message"),
imagesByPath = {},
width = 0,
......@@ -26,8 +27,10 @@ document.addEventListener("DOMContentLoaded", function () {
imagedata = null;
msg.innerHTML = "Waiting for a face...";
img.style.display = "none";
video.pause();
video.style.display = "none";
requestAnimationFrame(draw);
})
});
socket.on("countdown", function () {
// start a countdown...
imagedata = null;
......@@ -67,17 +70,29 @@ document.addEventListener("DOMContentLoaded", function () {
function s (f) {
return f.length == 1 ? "" : "s";
}
socket.on("imagedata", function (d) {
var m;
img.src = d.path;
img.style.display = "block";
// img.src = d.path;
// img.style.display = "block";
if (!d.faces || d.faces.length == 0) {
msg.innerHTML = "No faces detected";
} else {
msg.innerHTML = d.faces.length+" face"+s(d.faces)+" + "+d.eyes.length+" eye"+s(d.eyes)+" detected"
}
imagedata = d;
requestAnimationFrame(draw);
// imagedata = d;
// requestAnimationFrame(draw);
})
socket.on("annotatedcameraframe", function (d) {
img.src = d.src;
img.style.display = "block";
});
socket.on("cameragif", function (d) {
msg.innerHTML = "";
video.src = d.src;
img.style.display = "none";
video.style.display = "block";
})
function draw () {
ctx.clearRect(0, 0, width, height);
......
This diff is collapsed.
#!/bin/bash
archivegif=$1
collagegif=$2
cameragif=$1
archivegif=$2
collagegif=$3
rm -f frames/*
rm "$cameragif"
scp "$archivegif" "$collagegif" aa:/var/www/vhosts/sicv.activearchives.org/httpdocs/vitrine
......@@ -86,9 +86,15 @@ var cc = cascadecollage({
imagedata: function (data) {
broadcast("imagedata", data);
},
annotatedcameraframe: function (path) {
broadcast("annotatedcameraframe", {src: path});
},
archiveframe: function (img, cf, af) {
broadcast("archiveframe", {src: img, cf: cf, af:af});
},
cameragif: function (img) {
broadcast("cameragif", {src: img});
},
archivegif: function (img) {
broadcast("archivegif", {src: img});
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment