title: How execute a Java function from a Constructor of React component throuhg webview
body: <p>I am making a video chat app which has to work in a webview of my android application.</p>
  <p>So What I want is to set audio and video to <strong>true or false</strong> depending on java. it means if I clicked to audio call button in ui button I should set video to false and vice versa.</p>
  <pre><code>this.getUserMedia = navigator.mediaDevices.getUserMedia({
        audio: true,
        video: true
      })
  </code></pre>
  <p>Here is the full code for the Component containing the above lines.</p>
  <pre><code>import React, { Component } from 'react';
  import MediaContainer from './MediaContainer'
  import CommunicationContainer from './CommunicationContainer'
  import { connect } from 'react-redux'
  import store from '../store'
  import io from 'socket.io-client'
  
  class RoomPage extends Component {
    constructor(props) {
      super(props);
      this.getUserMedia = navigator.mediaDevices.getUserMedia({
        audio: true,
        video: true
      }).catch(e =&gt; alert('getUserMedia() error: ' + e.name))
      this.socket = io.connect();
    }
    componentDidMount() {
      this.props.addRoom();
    }
    render(){
      return (
        &lt;div&gt;
          &lt;MediaContainer media={media =&gt; this.media = media} socket={this.socket} getUserMedia={this.getUserMedia} /&gt;
          &lt;CommunicationContainer socket={this.socket} media={this.media} getUserMedia={this.getUserMedia} /&gt;
        &lt;/div&gt;
      );
    }
  }
  const mapStateToProps = store =&gt; ({rooms: new Set([...store.rooms])});
  const mapDispatchToProps = (dispatch, ownProps) =&gt; (
      {
        addRoom: () =&gt; store.dispatch({ type: 'ADD_ROOM', room: ownProps.match.params.room })
      }
    );
  export default connect(mapStateToProps, mapDispatchToProps)(RoomPage);
  </code></pre>
  <p>If you can provide me with a sample code please. I am new in React, so please be as explicit as possible.</p>