0

please I am looking for a way to use JW Player with ReactJS. I have implemented it in the best form i could think possible but i keep getting an error that says jwplayer is not a function.

My Implementation

var  jwplayer = require('../../../assets/plugins/jwplayer-7.6.1/jwplayer.js');

loadPlayer(){
    var {ui} = this.props;
    var {camera} = ui;

    jwplayer(this.state.playerEl).setup({
        sources: [{
            file: camera.src,
        }],
        streamer: camera.streamname,
        provider: 'rtmp',
        aspectRation: '16:9',
        width: '100%',
        rtmp: {
            bufferlength: 3
        },
    });
}

The loadPlayer() function is actually in a component where I call it from the componentDidMount()method.

Thanks in advance.

Daniel Barde
  • 2,603
  • 5
  • 31
  • 40
  • Take a look at [this question + answers](http://stackoverflow.com/questions/34677234/proper-way-to-implement-jwplayer-in-react-component-using-webpack-react-starter). – robertklep Sep 27 '16 at 11:34
  • @robertklep thanks, I already looked at that question and tried it, I even asked a question at the comment section of the answer, but have had no reply from there yet, thanks still. – Daniel Barde Sep 27 '16 at 13:01
  • If you submit a Git issue, one of the JW Player engineers can help you out: https://github.com/jwplayer/jwplayer – Josie Keller Sep 27 '16 at 19:01

0 Answers0