Skip to content

Instantly share code, notes, and snippets.

@jasonLaster
Created May 31, 2021 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonLaster/43e705ca8d00f76f770d8e50d196e627 to your computer and use it in GitHub Desktop.
Save jasonLaster/43e705ca8d00f76f770d8e50d196e627 to your computer and use it in GitHub Desktop.
diff --git a/src/protocol/graphics.ts b/src/protocol/graphics.ts
index 2e10d755..50de1c54 100644
--- a/src/protocol/graphics.ts
+++ b/src/protocol/graphics.ts
@@ -444,7 +444,9 @@ export function refreshGraphics() {
}
}
- Video.init();
+ if (features.videoPlayback) {
+ Video.init();
+ }
canvas.style.visibility = "visible";
const cx = canvas.getContext("2d")!;
@@ -460,12 +462,14 @@ export function refreshGraphics() {
canvas.width = image.width;
canvas.height = image.height;
- graphicsVideo.style.width = image.width + "px";
- graphicsVideo.style.height = image.height + "px";
- canvas.style.transform = graphicsVideo.style.transform = `scale(${scale})`;
- canvas.style.left = graphicsVideo.style.left = String(offsetLeft);
- canvas.style.top = graphicsVideo.style.top = String(offsetTop);
+ if (features.videoPlayback) {
+ graphicsVideo.style.width = image.width + "px";
+ graphicsVideo.style.height = image.height + "px";
+ canvas.style.transform = graphicsVideo.style.transform = `scale(${scale})`;
+ canvas.style.left = graphicsVideo.style.left = String(offsetLeft);
+ canvas.style.top = graphicsVideo.style.top = String(offsetTop);
+ }
cx.drawImage(image, 0, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment