Skip to content

Commit

Permalink
fix: appendsdone abort and handle multiple id3 sections. (#971)
Browse files Browse the repository at this point in the history
appendsdone may cause an abort in segmentloaders which can then cause pendingSegment to be null after we just null checked it. Instead we should check if we have a pendingSegment then trigger appends done and see if an abort happens.

We also want to make sure that if audio contains multiple id3 sections, we support playing back to it as we did in previos versions of VHS.
  • Loading branch information
brandonocasey authored Oct 6, 2020
1 parent aaf53f0 commit 57260e3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@
],
"dependencies": {
"@babel/runtime": "^7.5.5",
"@videojs/vhs-utils": "^2.2.0",
"@videojs/vhs-utils": "^2.2.1",
"aes-decrypter": "3.0.2",
"global": "^4.3.2",
"m3u8-parser": "4.4.3",
"mpd-parser": "0.12.0",
"mux.js": "5.6.6",
"mux.js": "5.6.7",
"video.js": "^6 || ^7"
},
"devDependencies": {
Expand Down
7 changes: 5 additions & 2 deletions src/segment-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2529,6 +2529,11 @@ export default class SegmentLoader extends videojs.EventTarget {
* @private
*/
handleAppendsDone_() {
// appendsdone can cause an abort
if (this.pendingSegment_) {
this.trigger('appendsdone');
}

if (!this.pendingSegment_) {
this.state = 'READY';
// TODO should this move into this.checkForAbort to speed up requests post abort in
Expand All @@ -2539,8 +2544,6 @@ export default class SegmentLoader extends videojs.EventTarget {
return;
}

this.trigger('appendsdone');

const segmentInfo = this.pendingSegment_;

// Now that the end of the segment has been reached, we can set the end time. It's
Expand Down

0 comments on commit 57260e3

Please sign in to comment.