title: React + ES6: Dash.js, MediaPlayer is not a function
body: <p>I'm trying to build a component on ReactJs which basically wraps the [Dash.js][1] web-player to handle working with MPEG-DASH format.</p>
  <p>What I have in my file is:</p>
  <pre><code>import React, { Component } from 'react'
  import dashjs from 'dashjs/dist/dash.all.min.js'
  
  export default class Player extends Component {
  
      constructor(props){
          super(props);
          this.classRef = React.createRef(null);
          this.src = props.src;
      }
  
      componentDidMount(){
          const video = this.classRef.current;
          const player = dashjs.MediaPlayer().create();
  
          player.initialize(video, this.src, true);
          
      }
      
      render() {
          return (
              &lt;video
                  ref={this.classRef}
              /&gt;
          )
      }
  }
  </code></pre>
  <p>which returns the message on browser <strong>dashjs_dist_dash_all_min_js__WEBPACK_IMPORTED_MODULE_2___default.a.MediaPlayer is not a function</strong>, pointing the error to the second line on <em>componentDidMount</em> method.</p>
  <p>I look into the source code present on <em>dash.all.debug.js</em> to see how should I handle the MediaPlayer object, and what I have is that MediaPlayer is indeed a function:</p>
  <pre><code>function MediaPlayer() {
     (... ommited)
  }
  </code></pre>
  <p>With success, I maded a component on shaka-player using almost the same method of wrapping its player. To be honest. I'm not really that experience on javascript to understand exactly what is going on. Maybe someone knows something obvious which I don't see?</p>
  <p>Thanks.
  [1]: <a href="https://github.com/Dash-Industry-Forum/dash.js" rel="nofollow noreferrer">https://github.com/Dash-Industry-Forum/dash.js</a></p>