I want to add this feature to my chat app. take photo using mdg:camera and insert it into the chat message.
using react component only or have to use BLAZE.
thanks
Kevin
I want to add this feature to my chat app. take photo using mdg:camera and insert it into the chat message.
using react component only or have to use BLAZE.
thanks
Kevin
First step, could anybody help convert simplephoto example to react version please?
I can take the picture, but could not save the image to the props or state.
here is the code
import React from ‘react’;
import {MeteorCamera} from ‘meteor/mdg:camera’;
export class CameraPage extends React.Component {
constructor(props) {
super(props);
this.state = {
photo: null
};
}
selectedPhoto(newPhoto) {
if ( newPhoto ) {
this.setState({
photo: newPhoto,
});
}
}
takePhoto(){
let cameraOptions = {
width: 800,
height: 600
};
MeteorCamera.getPicture(cameraOptions, function (error, data) {
this.selectedPhoto(data).bind(this);
});
}
render() {
return (
Take a Photo
)
}
}
after I took photo from camera, i got error
Uncaught TypeError: this.selectedPhoto is not a function
any one could help please?
Sorry, how could insert the code here? looks like the format and html code gone.