Skip to content

Commit

Permalink
Reset hls and dash before loading new url
Browse files Browse the repository at this point in the history
  • Loading branch information
webmiraclepro committed May 22, 2020
1 parent 3623ceb commit e87248b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/players/FilePlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ export default class FilePlayer extends Component {

load (url) {
const { hlsVersion, hlsOptions, dashVersion } = this.props.config
if (this.hls) {
this.hls.destroy()
}
if (this.dash) {
this.dash.reset()
}
if (this.shouldUseHLS(url)) {
getSDK(HLS_SDK_URL.replace('VERSION', hlsVersion), HLS_GLOBAL).then(Hls => {
this.hls = new Hls(hlsOptions)
Expand Down

0 comments on commit e87248b

Please sign in to comment.