Skip to content

Commit

Permalink
fix: some MSE error (#26)
Browse files Browse the repository at this point in the history
* fix: mediaSource.endOfStream() Throws error

* fix: SourceBuffer has been removed
  • Loading branch information
xiaoyuhen authored Mar 25, 2019
1 parent 7df92e7 commit 8f38191
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions packages/griffith-mp4/src/mse/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export default class MSE {
this.handleTimeUpdate()
}
})
this.init()
}

init() {
Expand Down Expand Up @@ -134,7 +133,7 @@ export default class MSE {
} = this.mp4Probe

if (this.mediaSource.readyState === 'open') {
if (offsetInterVal[1] === videoSamplesLength) {
if (offsetInterVal[1] === videoSamplesLength && !this.mseUpdating) {
this.mediaSource.endOfStream()
} else if (this.shouldFetchNextSegment()) {
this.seek()
Expand Down
1 change: 1 addition & 0 deletions packages/griffith-mp4/src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {isSafari} = ua
export default class Player extends Component {
componentDidMount() {
this.mse = new MSE(this.video, this.props.src)
this.mse.init()
}

componentDidUpdate(prevProps) {
Expand Down

0 comments on commit 8f38191

Please sign in to comment.