Skip to content

Commit 87b198c

Browse files
committed
fixed aegir linting
1 parent c0080e0 commit 87b198c

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/webui/screenshot.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ async function streamHandler (format, stream) {
1010
canvas.width = bitmap.width
1111
canvas.height = bitmap.height
1212
const ctx = canvas.getContext('2d')
13-
// @ts-ignore
14-
ctx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height)
13+
if (ctx) { ctx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height) }
1514
return canvas.toDataURL(format)
1615
}
1716

@@ -25,15 +24,9 @@ async function screenshot (format) {
2524
const stream = await navigator.mediaDevices.getUserMedia({
2625
audio: false,
2726
video: {
28-
// @ts-ignore
29-
mandatory: {
30-
chromeMediaSource: 'desktop',
31-
chromeMediaSourceId: source.id,
32-
minWidth: 1280,
33-
maxWidth: 4000,
34-
minHeight: 720,
35-
maxHeight: 4000
36-
}
27+
width: { min: 1280, ideal: 1920, max: 4000 },
28+
height: { min: 720, ideal: 1080, max: 4000 },
29+
deviceId: source.id
3730
}
3831
})
3932

0 commit comments

Comments
 (0)