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.