Click here to see a minimal implementation to log errors
CODE
…
import OTVPlayer from '@nagra/react-otvplayer'
…
const App: () => Node = () => {
…
this.otvplayer = {
ref: OTVPlayer
};
this._onError = (eventData) => {
console.log(`Error witnessed ${JSON.stringify(eventData)}`);
};
this.events = {
onError: this._onError.bind(this)
};
return (
<OTVPlayer
// You will need to retain a reference to the OTVPlayer element in order to interact with the playback on user events
ref={otvplayer => this.otvplayer.ref = otvplayer}
// A source can be specified in the element declaration or programmatically, specifying it in here starts the content loading immediately
source={{
src: "https://d3bqrzf9w11pn3.cloudfront.net/basic_hls_bbb_clear/index.m3u8"
type: "application/x-mpegURL",
}}
// There are several playback events that can be hooked in to and trigger actions in the application
onError={this.events.onError}
>
</OTVPlayer>
);
…
}
…
JavaScript errors detected
Please note, these errors can depend on your browser setup.
If this problem persists, please contact our support.