summaryrefslogtreecommitdiff
path: root/app/client/live/player.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/client/live/player.js')
-rw-r--r--app/client/live/player.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/client/live/player.js b/app/client/live/player.js
index 37f7cab..facd032 100644
--- a/app/client/live/player.js
+++ b/app/client/live/player.js
@@ -37,13 +37,13 @@ export function onFrame (data) {
const blob = new Blob([data.frame], { type: 'image/jpg' })
const url = URL.createObjectURL(blob)
const img = new Image ()
+ let canvas = document.querySelector('.player canvas')
+ if (! canvas) return console.error('no canvas for frame')
img.onload = () => {
img.onload = null
last_frame = data.meta
URL.revokeObjectURL(url)
- let canvas = document.querySelector('.player canvas')
- if (! canvas) return console.error('no canvas for frame')
- const ctx = canvas.getContext('2d')
+ const ctx = canvas.getContext('2d-lodpi')
ctx.drawImage(img, 0, 0, canvas.width, canvas.height)
if (recording) {
console.log('record frame')