mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-04 12:26:42 +02:00
Add taking screenshot animation
This commit is contained in:
@@ -25,6 +25,10 @@ export class Screenshot {
|
||||
Screenshot.#filters = filters;
|
||||
}
|
||||
|
||||
private static onAnimationEnd(e: Event) {
|
||||
(e.target as any).classList.remove('bx-taking-screenshot');
|
||||
}
|
||||
|
||||
static takeScreenshot(callback?: any) {
|
||||
const currentStream = STATES.currentStream;
|
||||
const $video = currentStream.$video;
|
||||
@@ -33,6 +37,9 @@ export class Screenshot {
|
||||
return;
|
||||
}
|
||||
|
||||
$video.parentElement?.addEventListener('animationend', this.onAnimationEnd);
|
||||
$video.parentElement?.classList.add('bx-taking-screenshot');
|
||||
|
||||
const canvasContext = $canvas.getContext('2d', {
|
||||
alpha: false,
|
||||
willReadFrequently: false,
|
||||
|
Reference in New Issue
Block a user