Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webcam Not working for IE11 in React project #317

Open
Ayushsinghcs opened this issue Aug 31, 2020 · 1 comment
Open

Webcam Not working for IE11 in React project #317

Ayushsinghcs opened this issue Aug 31, 2020 · 1 comment

Comments

@Ayushsinghcs
Copy link

I'm trying to reuse the code in my React project and it's working fine for all the browsers except IE11.
issue1

All i'm getting is blank screen on clicking open camera.

import React from "react";
import Webcam from './webcam.js'
export default function Camera() {

 const renderCamera = () => {
    Webcam.set({
      width: 320,
      height: 240,
      image_format: "jpeg",
      jpeg_quality: 90,
    });
    Webcam.attach("#my_camera");
  };

  const take_snapshot = () => {
    // take snapshot and get image data
    Webcam.snap(function (data_uri) {
      // display results in page
      document.getElementById("results").innerHTML =
        "<h2>Here is your image:</h2>" + '<img src="' + data_uri + '"/>';
    });
  };
  return (
    <div className="App">
      <h1>Image Capture</h1>
      <button onClick={renderCamera}>open Camera</button>
      <div id="my_camera"></div>
      <div id="results">Your captured image will appear here...</div>
      <button onClick={take_snapshot}>take a picture</button>
    </div>
  );
}

Please help me with a solution, Thanks.

@ghrace
Copy link

ghrace commented Sep 1, 2020

not working for ie in vue project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants