Skip to content

Commit

Permalink
fix: end of stream when last GOP is played (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyuhen authored Apr 19, 2019
1 parent 19d0dfc commit 1aaf240
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 @@ -266,9 +266,13 @@ export default class MSE {
const {
videoInterval: {offsetInterVal = []} = [],
mp4Data: {videoSamplesLength},
timeRange = [],
} = this.mp4Probe
if (this.mediaSource.readyState !== 'closed') {
if (offsetInterVal[1] === videoSamplesLength) {
if (
offsetInterVal[1] === videoSamplesLength &&
this.video.currentTime > timeRange[0]
) {
this.destroy()
} else if (this.shouldFetchNextSegment()) {
this.seek()
Expand Down

0 comments on commit 1aaf240

Please sign in to comment.