Skip to content

Commit

Permalink
Pass through HLS errors to onError
Browse files Browse the repository at this point in the history
Dealing with errors within ReactPlayer just caused more bugs
Closes cookpete/react-player#354
Closes cookpete/react-player#355
  • Loading branch information
seniorapple committed Mar 15, 2018
1 parent 3b3be50 commit f29a4d7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/players/FilePlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ export class FilePlayer extends Component {
if (this.shouldUseHLS(url)) {
getSDK(HLS_SDK_URL, HLS_GLOBAL).then(Hls => {
this.hls = new Hls(this.props.config.file.hlsOptions)
this.hls.on(Hls.Events.ERROR, (e, data) => {
this.props.onError(e, data, this.hls, Hls)
})
this.hls.loadSource(url)
this.hls.attachMedia(this.player)
})
Expand Down

0 comments on commit f29a4d7

Please sign in to comment.