aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Amoush <mohammad_amoush@brown.edu>2019-09-17 17:25:17 -0400
committerMohammad Amoush <mohammad_amoush@brown.edu>2019-09-17 17:25:17 -0400
commit6279193cab61e322cfafee56c521fde1482b999a (patch)
treee9e5d5710ba5d2f29ae370b5d516b67392f4b8a5
parentb32a325b0bf17906a9ba062548b89899ac400659 (diff)
Removed Screenshot functionality
-rw-r--r--src/client/views/webcam/DashWebCam.tsx80
1 files changed, 41 insertions, 39 deletions
diff --git a/src/client/views/webcam/DashWebCam.tsx b/src/client/views/webcam/DashWebCam.tsx
index 210b22958..175bbe595 100644
--- a/src/client/views/webcam/DashWebCam.tsx
+++ b/src/client/views/webcam/DashWebCam.tsx
@@ -108,58 +108,60 @@ export class DashWebCam extends React.Component<CollectionFreeFormDocumentViewPr
}
}
- getScreenshot() {
- const { state, props } = this;
+ //These are for screenshot if wanted.
- if (!state.hasUserMedia) return null;
+ // getScreenshot() {
+ // const { state, props } = this;
- const canvas = this.getCanvas();
- return (
- canvas &&
- canvas.toDataURL(props.screenshotFormat, props.screenshotQuality)
- );
- }
+ // if (!state.hasUserMedia) return null;
- getCanvas() {
- const { state, props } = this;
+ // const canvas = this.getCanvas();
+ // return (
+ // canvas &&
+ // canvas.toDataURL(props.screenshotFormat, props.screenshotQuality)
+ // );
+ // }
- if (!this.video) {
- return null;
- }
+ // getCanvas() {
+ // const { state, props } = this;
- if (!state.hasUserMedia || !this.video.videoHeight) return null;
+ // if (!this.video) {
+ // return null;
+ // }
- if (!this.ctx) {
- const canvas = document.createElement("canvas");
- const aspectRatio = this.video.videoWidth / this.video.videoHeight;
+ // if (!state.hasUserMedia || !this.video.videoHeight) return null;
- let canvasWidth = props.minScreenshotWidth || this.video.clientWidth;
- let canvasHeight = canvasWidth / aspectRatio;
+ // if (!this.ctx) {
+ // const canvas = document.createElement("canvas");
+ // const aspectRatio = this.video.videoWidth / this.video.videoHeight;
- if (
- props.minScreenshotHeight &&
- canvasHeight < props.minScreenshotHeight
- ) {
- canvasHeight = props.minScreenshotHeight;
- canvasWidth = canvasHeight * aspectRatio;
- }
+ // let canvasWidth = props.minScreenshotWidth || this.video.clientWidth;
+ // let canvasHeight = canvasWidth / aspectRatio;
- canvas.width = canvasWidth;
- canvas.height = canvasHeight;
+ // if (
+ // props.minScreenshotHeight &&
+ // canvasHeight < props.minScreenshotHeight
+ // ) {
+ // canvasHeight = props.minScreenshotHeight;
+ // canvasWidth = canvasHeight * aspectRatio;
+ // }
- this.canvas = canvas;
- this.ctx = canvas.getContext("2d");
- }
+ // canvas.width = canvasWidth;
+ // canvas.height = canvasHeight;
- const { ctx, canvas } = this;
+ // this.canvas = canvas;
+ // this.ctx = canvas.getContext("2d");
+ // }
- if (ctx) {
- ctx.imageSmoothingEnabled = props.imageSmoothing;
- ctx.drawImage(this.video, 0, 0, canvas!.width, canvas!.height);
- }
+ // const { ctx, canvas } = this;
- return canvas;
- }
+ // if (ctx) {
+ // ctx.imageSmoothingEnabled = props.imageSmoothing;
+ // ctx.drawImage(this.video, 0, 0, canvas!.width, canvas!.height);
+ // }
+
+ // return canvas;
+ // }
requestUserMedia() {
const { props } = this;