From 4a0e079f73165dcbd4eac44b70534d78ace529ee Mon Sep 17 00:00:00 2001 From: Cheng Wang Date: Wed, 10 Apr 2019 11:46:47 +0800 Subject: [PATCH] fix: Fix a hls bug when switching quality (#59) * fix: add plugin config. fix hls bug --- packages/griffith-hls/src/Video.js | 10 +++----- packages/griffith-hls/src/index.js | 8 +++++- packages/griffith-mp4/src/index.js | 9 ++++--- .../src/components/Video/NormalVideo.js | 7 +++++- .../griffith/src/components/Video/Video.js | 25 +++++++++++-------- 5 files changed, 38 insertions(+), 21 deletions(-) diff --git a/packages/griffith-hls/src/Video.js b/packages/griffith-hls/src/Video.js index eb33b521..28b55c66 100644 --- a/packages/griffith-hls/src/Video.js +++ b/packages/griffith-hls/src/Video.js @@ -6,10 +6,7 @@ export default class Video extends Component { hasLoadStarted = false componentDidMount() { - const {autoStartLoad = false} = this.props - this.hls = new Hls({ - autoStartLoad, - }) + this.hls = new Hls({autoStartLoad: false}) this.hls.attachMedia(this.video) const {sources} = this.props const master = getMasterM3U8Blob(sources) @@ -38,11 +35,12 @@ export default class Video extends Component { componentWillUnmount() { this.hls.destroy() + URL.revokeObjectURL(this.src) } render() { - // eslint-disable-next-line - const {onRef, currentQuality, src, paused, ...props} = this.props + // eslint-disable-next-line no-unused-vars + const {onRef, currentQuality, src, sources, paused, ...props} = this.props return (