mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
delay on screencast failed.
This commit is contained in:
parent
8c7030470d
commit
38ba2b8f92
@ -7,6 +7,7 @@
|
|||||||
import { RoomApi } from './api'
|
import { RoomApi } from './api'
|
||||||
|
|
||||||
const REFRESH_RATE = 1e3
|
const REFRESH_RATE = 1e3
|
||||||
|
const ERROR_DELAY_MS = 2500
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
name: 'neko-screencast',
|
name: 'neko-screencast',
|
||||||
@ -29,6 +30,7 @@
|
|||||||
while (this.continue) {
|
while (this.continue) {
|
||||||
const lastLoad = Date.now()
|
const lastLoad = Date.now()
|
||||||
|
|
||||||
|
try {
|
||||||
const res = await this.api.screenCastImage({ responseType: 'blob' })
|
const res = await this.api.screenCastImage({ responseType: 'blob' })
|
||||||
const image = URL.createObjectURL(res.data)
|
const image = URL.createObjectURL(res.data)
|
||||||
|
|
||||||
@ -42,6 +44,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
URL.revokeObjectURL(image)
|
URL.revokeObjectURL(image)
|
||||||
|
} catch (e) {
|
||||||
|
await new Promise((res) => setTimeout(res, ERROR_DELAY_MS))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.running = false
|
this.running = false
|
||||||
|
Loading…
Reference in New Issue
Block a user