Skip to content

Commit

Permalink
fix: failed to execute endOfStream on MediaSource (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyuhen authored Apr 16, 2019
1 parent 7cd145b commit c8c91ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/griffith-mp4/src/mse/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ export default class MSE {
destroy = () => {
this.mediaSource.removeEventListener('sourceopen', this.handleSourceOpen)
URL.revokeObjectURL(this.video.src)
if (this.mediaSource.readyState === 'open') {
if (
this.mediaSource.readyState === 'open' &&
!this.sourceBuffers.video.updating &&
!this.sourceBuffers.audio.updating
) {
this.mediaSource.endOfStream()
}
}
Expand Down

0 comments on commit c8c91ff

Please sign in to comment.