Closed crookedbard closed 5 years ago
It seems that snap() functions always takes the local video cam pic.
So I wrote another method for such feature:
let canvas = document.createElement('canvas'); let context = canvas.getContext("2d"); let snap = { width: 640, height: 480 };
let video = $("div." + number).find("div.video-out").find("video")[0];
canvas.width = snap.width;
canvas.height = snap.height;
context.drawImage(video, 0, 0, snap.width, snap.height);
let img = document.createElement('img');
img.src = canvas.toDataURL('image/jpeg', 0.50);
pic.append(img);
Nice!
As far as I understood phone.snap is used to take a snapshot of local video cam and session.snap is used to take a snapshot of other callers video, but sometimes session.snap takes my local video pic.