-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
Hi there, I can't seem to be able to set camera options.
I'm trying to enable only photos and no video or audio. And I can't seem to be able to pass this props.
Here is my code
import React, { Component, Fragment } from "react";
import Uppy from "@uppy/core";
import Webcam from "@uppy/webcam";
import { Dashboard } from "@uppy/react";
import Helmet from "react-helmet";
class AvatarPicker extends Component {
constructor(props) {
super(props);
this.uppy = Uppy({
id: "uploader",
autoProceed: false,
allowMultipleUploads: true,
debug: false,
restrictions: {
maxFileSize: null,
maxNumberOfFiles: 1,
minNumberOfFiles: 1,
allowedFileTypes: ["image/*", ".jpg", ".jpeg", ".png", ".gif"]
}
})
.use(Webcam)
.use(Webcam, {
countdown: true,
modes: ["picture"],
id: "webcam"
});
}
componentWillUnmount() {
this.uppy.close();
}
render() {
return (
<Fragment>
<Helmet>
<link href="/css/uppy/main.css" rel="stylesheet" type="text/css" />
</Helmet>
<Dashboard
plugins={["Webcam"]}
uppy={this.uppy}
/>
</Fragment>
);
}
}
export default AvatarPicker;