Skip to content

Commit

Permalink
Merge pull request souporserious#41 from dobrite/better-method-of-can…
Browse files Browse the repository at this point in the history
…celing-network-calls

fix(network): workaround to cancel outstanding buffering network requests
  • Loading branch information
souporserious authored Nov 2, 2017
2 parents 229df3e + 1f3eee6 commit 0290430
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/vendors/HTML5.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class HTML5 extends Component {
}

stop() {
this._player.pause()
this._player.pause(0)
this._player.currentTime = 0
}

Expand Down Expand Up @@ -148,7 +148,14 @@ class HTML5 extends Component {
}

_destroyAudioObject() {
// even when stopped and set to null,
// chrome will continue to buffer files
// set the source to some benign value
// (FF throws on an empty string)
// and load it to truly stop buffering
this.stop()
this._player.src = 'about:blank'
this._player.load()
this._player = null
}

Expand Down

0 comments on commit 0290430

Please sign in to comment.