From f28ef25044440b6362764362afe5182415cd7345 Mon Sep 17 00:00:00 2001 From: albanqoku Date: Thu, 15 Mar 2018 10:04:49 +0000 Subject: [PATCH] Pass through HLS errors to onError Dealing with errors within ReactPlayer just caused more bugs Closes https://github.com/CookPete/react-player/issues/354 Closes https://github.com/CookPete/react-player/pull/355 --- src/players/FilePlayer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/players/FilePlayer.js b/src/players/FilePlayer.js index 102b6c9..26efea9 100644 --- a/src/players/FilePlayer.js +++ b/src/players/FilePlayer.js @@ -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) })