Warning: session_start(): open(/var/lib/php/sessions/sess_cs8322k7o185r11obb7qihb9tc, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
cmodule WebCamDemo > DynPrintLog {
!include #1029545 // API for Eleu
O html(IWebRequest request) {
//ret "URI: " + request.uri();
ret hsansserif() + hfullcenter(p("WebCam Preview")
+ hfulltag video("", autoplay := true, id := "webcamPreview",
style := "width: 600px; height: 400px; border: 5px solid red;")
+ p("Snapshot" + hbutton("Grab", onclick := "snapshot()")
+ hfulltag canvas("", id := "snapshotCanvas", style := "width: 300px; height: 200px; border: 3px solid green;")
) + hscript([[
var video = document.querySelector("#webcamPreview");
if (navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ video: true })
.then(function (stream) {
video.srcObject = stream;
})
.catch(function (err0r) {
console.log("Something went wrong: " + err0r);
});
};
function snapshot() {
var canvas = document.getElementById("snapshotCanvas");
canvas.getContext("2d")
.drawImage(video, 0, 0, canvas.width, canvas.height);
}
]]);
}
}