title: Calling a function which is inside another function
body: <p>I am trying to call a function which is inside a Json from outside it. I want to trigger the "next" function on button "onClick" method. Here is my code. I tried calling it by onClick={this.next}, but it is never being called by this method. </p>
  
  <pre><code>export default class PlayerLogic extends Component{
  
      componentDidMount() {
          var self = this;
          var player = videojs(this.refs.video, this.props.options).ready(function () {
              self.player = this;
              self.player.on('play', self.handlePlay);
          });
  
          player.markers({
              onMarkerReached: function () {
                  player.pause();
              },
  
              next : function() {
                  // go to the next marker from current timestamp
                  console.log("reached")
                  var currentTime = player.currentTime();
                  for (var i = 0; i &lt; markersList.length; i++) {
                      var markerTime = setting.markerTip.time(markersList[i]);
                      if (markerTime &gt; currentTime) {
                          player.currentTime(markerTime);
                          break;
                      }
                  }
              }
          });
  
      }
  
      render() {
          return (
              &lt;div&gt;
                  &lt;video {... props}&gt;
                      &lt;source src={this.props.src} type={this.props.type} id={this.props.id}/&gt;
                  &lt;/video&gt;
  &lt;button onClick={this.next}&gt;Next&lt;/button&gt;
  
              &lt;/div&gt;)
  
      }
  };
  </code></pre>