Giter Club home page Giter Club logo

ngx-webcam-demo's People

Contributors

angular-cli avatar basst314 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ngx-webcam-demo's Issues

Browser freezes

Hi there is a new update to google chrome browser and ngx-webcam stopped working. I do not have a problem on the web browser, but when the camera switches from front to back in the mobile browser, the browser freezes. When I take a picture, it freezes and I cannot do anything. I have to close the browser

Type 'null' is not assignable to type 'WebcamImage'.ts

Hi,
following the example I ended up with the following line in my code:

public webcamImage: WebcamImage = null;

Unfortunately, it does not like the = null and tells me I cannot assign null value...

The thing is, I don't know what to do since the example is doing exactly that :-/

Maybe there is a bug with the latest version of Angular I am using?

Thank you.

iOS support

Should the live demo work on my iPhone X? I’m getting a message “Cannot access media from User Device.” No prompt for permissions or camera access when I run the demo or press take picture.

user denied camera access message after building an apk via android Studio with an angular-Project

I am building an Angular-App and i want to build a nativ android app through android studio.
But i cant access the camera thougt the emulator and also not througt building and installing an apk on another mobile phone.

I also dont get any permission-question from android

I nearly copied everything in the src/app folder and used it 1:1
https://github.com/pretteter/BA_Projekt/tree/master/smartphoneapp_for_cameramanagementsystem

I always get the message, that the user denied camera access
{ "message": "Permission denied",
"mediaStreamError":{}}

Using the Demo-Programm and developing in Chrome do not have any Problems at all

error in prod env

Not able to build the code base in production environment, shows the following error

ERROR in Error during template compile of 'WebcamModule'
Function calls are not supported in decorators but '?makeDecorator' was called
in 'NgModule'
'NgModule' calls '?makeDecorator'.

When i run the angualr 5 project in dev mode, build is successful
but when i choose Prod mode command as "ng build --aot", the above error pops up in CLI.

Angular ngx-webcam error enumerateDevices() not supported.

After deploying angular application to server ngx-webcam is showing errors.
https://user-images.githubusercontent.com/34974441/68767400-73e1af80-0642-11ea-8da2-f14db9e1c787.png
Angular Dependencies:
"dependencies": { "@angular/animations": "8.0.0", "@angular/cdk": "^8.0.0", "@angular/common": "8.0.0", "@angular/compiler": "8.0.0", "@angular/core": "8.0.0", "@angular/forms": "8.0.0", "@angular/platform-browser": "8.0.0", "@angular/platform-browser-dynamic": "8.0.0", "@angular/router": "8.0.0", "@fullcalendar/core": "4.0.2", "@fullcalendar/daygrid": "4.0.1", "@fullcalendar/interaction": "4.0.2", "@fullcalendar/timegrid": "4.0.1", "chart.js": "2.7.3", "font-awesome": "^4.7.0", "intl": "1.2.5", "ngx-webcam": "^0.2.6", "primeflex": "1.0.0-rc.1", "primeicons": "^2.0.0", "primeng": "8.0.0", "quill": "^1.3.7", "rxjs": "6.4.0", "web-animations-js": "github:angular/web-animations-js#release_pr208", "zone.js": "0.9.1" }

TypeScript

import { Component, OnInit } from '@angular/core';
import { WebcamImage, WebcamInitError, WebcamUtil } from 'ngx-webcam';
import { Observable, Subject } from 'rxjs';

@Component({
  selector: 'app-camera',
  templateUrl: './camera.component.html',
  styleUrls: ['./camera.component.css']
})
export class CameraComponent implements OnInit {
  public showWebcam = true;
  public allowCameraSwitch = true;
  public multipleWebcamsAvailable = false;
  public deviceId: string;
  public videoOptions: MediaTrackConstraints = {
    // width: {ideal: 1024},
    // height: {ideal: 576}
  };
  public errors: WebcamInitError[] = [];
  public webcamImage: WebcamImage = null;
  private trigger: Subject<void> = new Subject<void>();
  private nextWebcam: Subject<boolean | string> = new Subject<boolean | string>();
  constructor() { }

  ngOnInit() {
    WebcamUtil.getAvailableVideoInputs()
      .then((mediaDevices: MediaDeviceInfo[]) => {
        this.multipleWebcamsAvailable = mediaDevices && mediaDevices.length > 1;
      });
  }
  public triggerSnapshot(): void {
    this.trigger.next();
  }
  public toggleWebcam(): void {
    this.showWebcam = !this.showWebcam;
  }

  public handleInitError(error: WebcamInitError): void {
    if (error.message === "Permission denied") {
      error.message += " To Access Camera"; 
      this.errors.push(error);
    } else {
      this.errors.push(error);
    }
  }

  public showNextWebcam(directionOrDeviceId: boolean | string): void {
    this.nextWebcam.next(directionOrDeviceId);
  }

  public handleImage(webcamImage: WebcamImage): void {
    this.webcamImage = webcamImage;
  }

  public cameraWasSwitched(deviceId: string): void {
    console.log('active device: ' + deviceId);
    this.deviceId = deviceId;
  }

  public get triggerObservable(): Observable<void> {
    return this.trigger.asObservable();
  }

  public get nextWebcamObservable(): Observable<boolean | string> {
    return this.nextWebcam.asObservable();
  }
}

Html

<div class="ui-g-4">
            <img style="width:50%;"
              [src]="webcamImage.imageAsDataUrl" />
    </div>
   <div class="ui-g-8">
            <button id="capturebtn" (click)="captureImageDialogShow()"
              class="myCaptureBtn ui-button ui-widget ui-state-default ui-corner-all">
              <span class="ui-button-text ui-c"><i class="fa fa-camera" aria-hidden="true"></i>                             
                   &nbsp;Capture Image</span>
            </button>
   </div>

Error after introducing webcam

"@angular/cli": "~9.1.3",
"typescript": "~3.8.3"
"rxjs": "~6.5.4",

ERROR in node_modules/ngx-webcam/src/app/modules/webcam/webcam.module.d.ts:1:22 - error NG6002: Appears in the NgModule.imports of DocDeviceModule, but could not be resolved to an NgModule class.

This likely means that the library (ngx-webcam) which declares WebcamModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.