summaryrefslogtreecommitdiff
path: root/app/client/live
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-07 10:13:27 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-07 10:13:27 +0200
commit47d9658375fc2003a69d51c663b182c3baf8a9c6 (patch)
tree25c0ddff18f3cdc07e03a8c1b4801f90965066c8 /app/client/live
parented240db41cb8e2d8d3423a3aeade4c2ace1c5cf7 (diff)
switching epochs working again
Diffstat (limited to 'app/client/live')
-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')