mirror of
https://github.com/davedoesdev/streamana.git
synced 2024-08-20 23:27:41 +08:00
2479db5401
Android phones typically only support encoding of landscape. Still need to rotate the display back again.
16 lines
318 B
JavaScript
16 lines
318 B
JavaScript
export class UpdateLimiter {
|
|
constructor(nps) {
|
|
this.threshold = nps ? 1000/nps : 0;
|
|
this.last = 0;
|
|
}
|
|
|
|
check() {
|
|
const now = Date.now();
|
|
if ((now - this.last) >= this.threshold) {
|
|
this.last = now;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|