Answer the question
In order to leave comments, you need to log in
How to send a screenshot to the server?
const canvas = this.$refs.canvas
const video = this.$refs.video
const img = new Promise((resolve) => {
const ctx = canvas.getContext('2d')
const w = video.videoWidth
const h = video.videoHeight
canvas.width = w
canvas.height = h
ctx.drawImage(video, 0, 0, w, h)
ctx.font = '16px Arial'
ctx.fillText((new Date()).toString(), 0, 20)
canvas.toBlob((blob) => {
resolve(blob)
}, 'image/jpeg')
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question