Changeset - 9bb0eb587d5b
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 8 months ago 2024-05-21 18:58:13
drewp@bigasterisk.com
640x480 camera res
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
web/calibrate/Light9Camera.ts
Show inline comments
 
@@ -67,24 +67,26 @@ export class Light9Camera extends LitEle
 
    `;
 
  }
 

	
 
  protected async firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>) {
 
    this.videoEl = this.shadowRoot!.getElementById("video") as HTMLVideoElement;
 
    this.canvas = this.shadowRoot!.getElementById("canvas") as HTMLCanvasElement;
 
    this.ctx = this.canvas.getContext("2d", { willReadFrequently: true })!;
 

	
 
    const constraints: MediaStreamConstraints = {
 
      video: {
 
        facingMode: { ideal: "environment" },
 
        frameRate: { max: 10 },
 
        width: 640,
 
        height: 480,
 
      },
 
    };
 
    const stream = await navigator.mediaDevices.getUserMedia(constraints);
 
    const t = stream.getVideoTracks()[0];
 
    await t.applyConstraints({
 
      brightness: 0,
 
      contrast: 32,
 
      colorTemperature: 6600,
 
      exposureMode: "manual",
 
      exposureTime: 250,
 
      whiteBalanceMode: "manual",
 
      focusMode: "manual",
0 comments (0 inline, 0 general)